undo: implement gas switch

This is a bit hairy as - in theory - one gas switch can remove
other gas switch(es) at the same timestamp. However, I did not
find a way to test it. Moreover, it is not clear whether the
dive-tabs are properly updated on undo/redo.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-03-04 21:10:05 +01:00
parent c585fd9f8e
commit 0bd821183d
6 changed files with 83 additions and 20 deletions

View file

@ -354,4 +354,9 @@ void removeEvent(struct dive *d, int dcNr, struct event *ev)
execute(new RemoveEvent(d, dcNr, ev));
}
void addGasSwitch(struct dive *d, int dcNr, int seconds, int tank)
{
execute(new AddGasSwitch(d, dcNr, seconds, tank));
}
} // namespace Command