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

Function tickRepeatTimer

app/src/UI/Dashboard.cpp:103–117  ·  view source on GitHub ↗

* @brief Decrements a RepeatNTimes counter and stops the timer when it hits zero. */

Source from the content-addressed store, hash-verified

101 * @brief Decrements a RepeatNTimes counter and stops the timer when it hits zero.
102 */
103static void tickRepeatTimer(int index, QMap<int, QTimer*>& timers, QMap<int, int>& counters)
104{
105 const auto it = counters.find(index);
106 if (it == counters.end())
107 return;
108
109 if (--it.value() > 0)
110 return;
111
112 const auto timerIt = timers.find(index);
113 if (timerIt != timers.end() && timerIt.value())
114 timerIt.value()->stop();
115
116 counters.erase(it);
117}
118
119/**
120 * @brief Applies a non-RepeatNTimes timer mode to an action's QTimer.

Callers 1

activateActionMethod · 0.85

Calls 3

findMethod · 0.80
valueMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected