summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/command.cpp5
-rw-r--r--commands/command.h1
-rw-r--r--commands/command_event.cpp6
-rw-r--r--commands/command_event.h5
4 files changed, 17 insertions, 0 deletions
diff --git a/commands/command.cpp b/commands/command.cpp
index 4f92038b9..44eb4b8f0 100644
--- a/commands/command.cpp
+++ b/commands/command.cpp
@@ -339,4 +339,9 @@ void addEventDivemodeSwitch(struct dive *d, int dcNr, int seconds, int divemode)
execute(new AddEventDivemodeSwitch(d, dcNr, seconds, divemode));
}
+void addEventSetpointChange(struct dive *d, int dcNr, int seconds, pressure_t pO2)
+{
+ execute(new AddEventSetpointChange(d, dcNr, seconds, pO2));
+}
+
} // namespace Command
diff --git a/commands/command.h b/commands/command.h
index 1644063a7..aa7c75ab3 100644
--- a/commands/command.h
+++ b/commands/command.h
@@ -108,6 +108,7 @@ void editTripNotes(dive_trip *trip, const QString &s);
void addEventBookmark(struct dive *d, int dcNr, int seconds);
void addEventDivemodeSwitch(struct dive *d, int dcNr, int seconds, int divemode);
+void addEventSetpointChange(struct dive *d, int dcNr, int seconds, pressure_t pO2);
} // namespace Command
diff --git a/commands/command_event.cpp b/commands/command_event.cpp
index ddef502bc..a1e13f252 100644
--- a/commands/command_event.cpp
+++ b/commands/command_event.cpp
@@ -49,4 +49,10 @@ AddEventDivemodeSwitch::AddEventDivemodeSwitch(struct dive *d, int dcNr, int sec
setText(tr("Add dive mode switch to %1").arg(gettextFromC::tr(divemode_text_ui[divemode])));
}
+AddEventSetpointChange::AddEventSetpointChange(struct dive *d, int dcNr, int seconds, pressure_t pO2) :
+ AddEventBase(d, dcNr, create_event(seconds, SAMPLE_EVENT_PO2, 0, pO2.mbar, QT_TRANSLATE_NOOP("gettextFromC", "SP change")))
+{
+ setText(tr("Add set point change")); // TODO: format pO2 value in bar or psi.
+}
+
} // namespace Command
diff --git a/commands/command_event.h b/commands/command_event.h
index 3130a128f..8cceaeb25 100644
--- a/commands/command_event.h
+++ b/commands/command_event.h
@@ -44,6 +44,11 @@ public:
AddEventDivemodeSwitch(struct dive *d, int dcNr, int seconds, int divemode);
};
+class AddEventSetpointChange : public AddEventBase {
+public:
+ AddEventSetpointChange(struct dive *d, int dcNr, int seconds, pressure_t pO2);
+};
+
} // namespace Command
#endif // COMMAND_EVENT_H