Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -rfaf6802c35d530181106342f840b4cd9c851e272 -r0be698733fd4570240a91703978fee7d53a76121 --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision faf6802c35d530181106342f840b4cd9c851e272) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision 0be698733fd4570240a91703978fee7d53a76121) @@ -47,6 +47,7 @@ .arg(vData.mSystolic ) .arg(vData.mDiastolic) .arg(vData.mHeartRate)); + emit didTrigger(); } /*! @@ -157,7 +158,6 @@ void View::VTreatmentVitals::timerEvent(QTimerEvent *) { if ( ! _timerId ) return; // No timer started or failed starting - if ( ! _interval ) return; // if interval is 0/OFF return if ( ! _canStartInterval ) return; // parameters have not been confirmed yet updateTimer(); @@ -170,7 +170,6 @@ */ void View::VTreatmentVitals::onIntervalChanged() { - if ( ! _interval ) timerStop (); } /*! @@ -181,7 +180,6 @@ void View::VTreatmentVitals::timerStart() { if ( _timerId ) killTimer(_timerId); // this typically should not happen. - if ( ! _interval ) return; // if interval is 0/OFF return _timerId = startTimer(1000); // 1 sec interval which will used as 1 min in timerEvent (easier to debug) } @@ -192,28 +190,32 @@ */ void View::VTreatmentVitals::updateTimer() { + int interval = _interval && _enableBPCuff ? _interval : 15; _now = QDateTime::currentDateTime(); // minutes past last interval mark - int past = _now.time().minute() % _interval; + int past = _now.time().minute() % interval; + int currentCount = past * 60 + _now.time().second(); // Seconds since the last interval mark - totalCount( past * 60 + _now.time().second()); + if ( _interval && _enableBPCuff ) { totalCount( currentCount ); } // Seconds until the next interval mark - int totalSecLeft = _interval * 60 - _totalCount; + int totalSecLeft = interval * 60 - currentCount; // trigger timeout when timer countdown is done if (totalSecLeft <= 1 ) { timerStop(); - emit didTrigger(); + emit didTimeout(); } // construct count down string - int counter_min = totalSecLeft / 60; - int counter_sec = totalSecLeft % 60; - countdown( QStringLiteral("%1:%2") .arg(counter_min,2,10,QChar('0')) - .arg(counter_sec,2,10,QChar('0')) ); + if ( _interval && _enableBPCuff ) { + int counter_min = totalSecLeft / 60; + int counter_sec = totalSecLeft % 60; + countdown( QStringLiteral("%1:%2") .arg(counter_min,2,10,QChar('0')) + .arg(counter_sec,2,10,QChar('0')) ); + } } /*!