Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp =================================================================== diff -u -r73da05e9b761c559cd4d6741e574fc0f40475ebc -rde099919f262c3429cb0592ef71deb6a16e92892 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp (.../VTreatmentAdjustmentVitals.cpp) (revision 73da05e9b761c559cd4d6741e574fc0f40475ebc) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentVitals.cpp (.../VTreatmentAdjustmentVitals.cpp) (revision de099919f262c3429cb0592ef71deb6a16e92892) @@ -27,6 +27,12 @@ void View::VTreatmentAdjustmentVitals::initConnections() { ACTION_VIEW_CONNECTION(AdjustVitalsResponseData); ADJUST_VIEW_CONNECTION(AdjustVitalsRequestData ); + + // set singleshot timer when requesting and stop if responded from fw. + // if timeout is emited then let QML know to skip measurement + _timeoutTimer.setSingleShot(true); + _timeoutTimer.setInterval(2 * 60 * 1000); // 2 min timeout + connect(&_timeoutTimer, &QTimer::timeout, this, [this]() { emit didTimeout(); }); } /*! @@ -36,6 +42,8 @@ */ void View::VTreatmentAdjustmentVitals::onActionReceive(const AdjustVitalsResponseData &vData) { + _timeoutTimer.stop(); + adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); @@ -50,6 +58,8 @@ */ void View::VTreatmentAdjustmentVitals::doRequest() { + _timeoutTimer.start(); + AdjustVitalsRequestData data; emit didAdjustment(data); }