core: convert cylinder_t and cylinder_table to C++

This had to be done simultaneously, because the table macros
do not work properly with C++ objects.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-28 21:31:11 +02:00 committed by bstoeger
parent 284582d2e8
commit 28520da655
48 changed files with 593 additions and 710 deletions

View file

@ -23,6 +23,7 @@
#include "profile-widget/profilewidget2.h"
#include "commands/command.h"
#include "core/metadata.h"
#include "core/range.h"
#include "core/tag.h"
void RenumberDialog::buttonClicked(QAbstractButton *button)
@ -348,11 +349,10 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button)
text << "\n";
}
if (what->cylinders) {
int cyl;
text << tr("Cylinders:\n");
for (cyl = 0; cyl < current_dive->cylinders.nr; cyl++) {
if (is_cylinder_used(current_dive, cyl))
text << get_cylinder(current_dive, cyl)->type.description << " " << gasname(get_cylinder(current_dive, cyl)->gasmix) << "\n";
for (auto [idx, cyl]: enumerated_range(current_dive->cylinders)) {
if (is_cylinder_used(current_dive, idx))
text << QString::fromStdString(cyl.type.description) << " " << gasname(cyl.gasmix) << "\n";
}
}
if (what->weights) {