core: use C++ structures for tanksystem info

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-03 23:18:45 +02:00
parent 3bfbf12b9a
commit 5f36c8ccde
13 changed files with 77 additions and 106 deletions

View file

@ -1319,8 +1319,9 @@ EditCylinder::EditCylinder(int index, cylinder_t cylIn, EditCylinderType typeIn,
void EditCylinder::redo()
{
for (size_t i = 0; i < dives.size(); ++i) {
set_tank_info_size(&tank_info_table, cyl[i].type.description, cyl[i].type.size);
set_tank_info_workingpressure(&tank_info_table, cyl[i].type.description, cyl[i].type.workingpressure);
std::string name = cyl[i].type.description;
set_tank_info_size(tank_info_table, name, cyl[i].type.size);
set_tank_info_workingpressure(tank_info_table, name, cyl[i].type.workingpressure);
std::swap(*get_cylinder(dives[i], indexes[i]), cyl[i]);
update_cylinder_related_info(dives[i]);
emit diveListNotifier.cylinderEdited(dives[i], indexes[i]);