Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rc1d0546e2d1a51ff919b2172ce647003359f0853 --- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision c1d0546e2d1a51ff919b2172ce647003359f0853) @@ -20,7 +20,7 @@ // Project #include "GuiController.h" #include "TreatmentLog.h" -#include "BluetoothInterface.h" +//#include "BluetoothInterface.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentVitals) @@ -29,33 +29,54 @@ * \details All the class signal/slot connections are defined here. */ void View::VTreatmentVitals::initConnections() { - ACTION_RECEIVE_BRIDGE_CONNECTION(_BluetoothInterface, UIBloodPressureData); +// ACTION_RECEIVE_BRIDGE_CONNECTION(_BluetoothInterface, UIBloodPressureData); +// ACTION_VIEW_CONNECTION(AdjustVitalsResponseData); +// ADJUST_VIEW_CONNECTION(AdjustVitalsRequestData ); connect(this, SIGNAL( intervalChanged (const quint8 &)), this, SLOT(onIntervalChanged ( ))); } +void View::VTreatmentVitals::onActionReceive(const TreatmentVitalsData &vData) +// void View::VTreatmentVitals::onActionReceive(const AdjustVitalsResponseData &vData) +{ + update_rt (vData.mSystolic, vData.mDiastolic, vData.mHeartRate); +// update (vData.mSystolic, vData.mDiastolic, vData.mHeartRate); + emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mHeartRate); + + qDebug() << tr("**************8Vital received,%1,%2,%3") + .arg(vData.mSystolic ) + .arg(vData.mDiastolic) + .arg(vData.mHeartRate); + + LOG_APPED_UI(tr("Vital received,%1,%2,%3") + .arg(vData.mSystolic ) + .arg(vData.mDiastolic) + .arg(vData.mHeartRate)); +} + + /*! * \brief View::VTreatmentVitals::onActionReceive * \details The data handler which gets the data form GuiControl and GuiController will get the data from BtCuff controller. * \param vData - Vital values * \note the accepted and reason in this case should be the BtCuff status which may not necessarily comes front BtCuff itself, * and the intermediate controller like the GuiController or the BtCuffController can report from BtCuff behalf if it is connected or not responsive. */ -void View::VTreatmentVitals::onActionReceive(const UIBloodPressureData &vData) -{ - // Not used yet. - // adjustment_Accepted ( vData.mAccepted ); - // adjustment_Reason ( vData.mReason ); +//void View::VTreatmentVitals::onActionReceive(const UIBloodPressureData &vData) +//{ +// // Not used yet. +// // adjustment_Accepted ( vData.mAccepted ); +// // adjustment_Reason ( vData.mReason ); - update_rt (vData.mSystolic, vData.mDiastolic, vData.mPulseRate); - emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mPulseRate); - // if the vitals is disabled it means Gui is probably in an incorrect state and is unable to handle the vital information. - LOG_APPED_UI(tr("Vital received,%1,%2,%3") - .arg(vData.mSystolic ) - .arg(vData.mDiastolic) - .arg(vData.mPulseRate)); -} +// update_rt (vData.mSystolic, vData.mDiastolic, vData.mPulseRate); +// emit didTrigger(vData.mSystolic, vData.mDiastolic, vData.mPulseRate); +// // if the vitals is disabled it means Gui is probably in an incorrect state and is unable to handle the vital information. +// LOG_APPED_UI(tr("Vital received,%1,%2,%3") +// .arg(vData.mSystolic ) +// .arg(vData.mDiastolic) +// .arg(vData.mPulseRate)); +//} /*! * \brief View::VTreatmentVitals::doConfirm @@ -174,19 +195,23 @@ if ( ! _timerId ) return; // No timer started or failed starting if ( ! _interval ) return; // if interval is 0/OFF return - // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; + /* DEBUG:*/ qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; _counter_sec++; min_left(_counter_min ); sec_left(60 - _counter_sec); - countdown(QString("%1:%2").arg(_min_left,2,10,QChar('0')).arg(_sec_left,2,10,QChar('0'))); + countdown(QStringLiteral("%1:%2").arg(_min_left,2,10,QChar('0')).arg(_sec_left,2,10,QChar('0'))); if ( _counter_sec % 60 ) return; // only check every minute if ( ! _counter_min ) { timerStop(); - emit didTrigger(); + AdjustVitalsRequestData mData; + emit didAdjustment(mData); + qDebug() << "****didAdjustment --- AdjustVitalsRequestData" ; + +// emit didTrigger(); } else { _counter_min--; @@ -196,7 +221,7 @@ void View::VTreatmentVitals::onIntervalChanged() { - // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; + /* DEBUG: */qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; if ( _interval ) timerReset(); else timerStop (); // Timer stop is resetting timer too. } @@ -210,7 +235,7 @@ { if ( _timerId ) killTimer(_timerId); // this typically should not happen. if ( ! _interval ) return; // if interval is 0/OFF return - // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; + /* DEBUG:*/ qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; timerReset(); _timerId = startTimer(1000); // 1 sec interval which will used as 1 min in timerEvent (easier to debug) } @@ -226,7 +251,7 @@ _counter_min = 0; } _counter_sec = 0; - // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; + /* DEBUG: */qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; } /*! @@ -236,7 +261,7 @@ void View::VTreatmentVitals::timerStop() { if ( ! _timerId ) return; // No timer started or failed starting - // DEBUG: qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; + /*DEBUG:*/ qDebug() << __FUNCTION__ << _counter_sec << _counter_min << _interval << _timerId; killTimer(_timerId); _timerId = 0; timerReset();