MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / applyTimerMode

Function applyTimerMode

app/src/UI/Dashboard.cpp:122–141  ·  view source on GitHub ↗

* @brief Applies a non-RepeatNTimes timer mode to an action's QTimer. */

Source from the content-addressed store, hash-verified

120 * @brief Applies a non-RepeatNTimes timer mode to an action's QTimer.
121 */
122static void applyTimerMode(QTimer* timer,
123 DataModel::TimerMode mode,
124 bool guiTrigger,
125 const QString& actionTitle)
126{
127 if (!timer) {
128 qWarning() << "Invalid timer pointer for action" << actionTitle;
129 return;
130 }
131
132 if (mode == DataModel::TimerMode::StartOnTrigger && !timer->isActive())
133 timer->start();
134
135 else if (mode == DataModel::TimerMode::ToggleOnTrigger && guiTrigger) {
136 if (timer->isActive())
137 timer->stop();
138 else
139 timer->start();
140 }
141}
142
143//--------------------------------------------------------------------------------------------------
144// Constructor & singleton access

Callers 1

activateActionMethod · 0.85

Calls 3

isActiveMethod · 0.45
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected