Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -r9bd436782039b50ac45eb38f561a36706517271b -rae31b8fc6d423cdcbe99c60c711d6175da6be8fb --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 9bd436782039b50ac45eb38f561a36706517271b) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision ae31b8fc6d423cdcbe99c60c711d6175da6be8fb) @@ -76,7 +76,6 @@ void View::VTreatmentVitals::doSkip() { LOG_APPED_UI(tr("Vital Skipped")); - timerReset(); } /*! @@ -171,8 +170,7 @@ */ void View::VTreatmentVitals::onIntervalChanged() { - if ( _interval ) timerReset(); - else timerStop (); // Timer stop is resetting timer too. + if ( ! _interval ) timerStop (); } /*! @@ -185,10 +183,13 @@ if ( _timerId ) killTimer(_timerId); // this typically should not happen. if ( ! _interval ) return; // if interval is 0/OFF return - timerReset(); _timerId = startTimer(1000); // 1 sec interval which will used as 1 min in timerEvent (easier to debug) } +/*! + * \brief View::VTreatmentVitals::updateTimer + * \details Update timer from current time with set interval and update UI data + */ void View::VTreatmentVitals::updateTimer() { _now = QDateTime::currentDateTime(); @@ -206,7 +207,6 @@ if (_total_sec_left <= 1 ) { timerStop(); emit didTrigger(); - _total_sec_left = _interval * 60; } // construct count down string @@ -217,23 +217,6 @@ } /*! - * \brief View::VTreatmentVitals::timerReset - * \details Resets the timer counters based on the current interval. - */ -void View::VTreatmentVitals::timerReset() -{ - if ( _interval && _canStartInterval && _timerId ) { // get time past interval - updateTimer(); - } - else { // if _interval == 0, clear counters - _counter_sec = 0; - _counter_min = 0; - _totalCount = 0; - _total_sec_left = 0; - } -} - -/*! * \brief View::VTreatmentVitals::stop * \details stops the timer and resets the interval */ @@ -242,5 +225,4 @@ if ( ! _timerId ) return; // No timer started or failed starting killTimer(_timerId); _timerId = 0; - timerReset(); }