general: simplify a few unit manipulations

Now that we have defined addition and subtraction on unit
classes, let's use them in a few examples.

Yes, some of these are a bit pointless, because they are
of the kind
        a.mbar - b.mbar => (a-b).mbar

However, these probably should be further simplified
by storing the result in a unit type.

This commit is mostly a proof-of-concept.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-09-02 20:42:05 +02:00 committed by bstoeger
parent 729cc16fc5
commit 110e64bc66
14 changed files with 59 additions and 68 deletions

View file

@ -1260,8 +1260,8 @@ EditCylinder::EditCylinder(int index, cylinder_t cylIn, EditCylinderType typeIn,
cyl[i].cylinder_use = cylIn.cylinder_use;
break;
case EditCylinderType::PRESSURE:
cyl[i].start.mbar = cylIn.start.mbar;
cyl[i].end.mbar = cylIn.end.mbar;
cyl[i].start = cylIn.start;
cyl[i].end = cylIn.end;
break;
case EditCylinderType::GASMIX:
cyl[i].gasmix = cylIn.gasmix;