Index: sources/view/VVitals.cpp =================================================================== diff -u -r510ea07f96362a18f9961f41b5b91740df075c1f -ra47e7059c91c50cee3e05972fe5d96c053cdfb31 --- sources/view/VVitals.cpp (.../VVitals.cpp) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) +++ sources/view/VVitals.cpp (.../VVitals.cpp) (revision a47e7059c91c50cee3e05972fe5d96c053cdfb31) @@ -9,8 +9,13 @@ using namespace View; using namespace Gui; +VIEW_DEF_CLASS(VVitals) -VVitals::VVitals(QObject *parent) : QObject(parent) +/*! + * \brief VVitals::initConnections + * Makes the necessary connections. Called inside VIEW_DEF_CLASS + */ +void VVitals::initConnections() { // incoming connect(&_BLEScanner, SIGNAL(didReceiveBPMeasurement(BLEMeasurementData)), @@ -19,9 +24,6 @@ connect(&_GuiController, SIGNAL(didActionReceive(HDOperationModeData)), this, SLOT(onHDOperationModeUpdate(HDOperationModeData))); - connect(&_MainTimer, SIGNAL(didTimeout()), - this, SLOT(onTimeout())); - connect(&_GuiController, SIGNAL(didAlertResponse(GuiAlertResponseData)), this, SLOT(onReceiveAlertResponse(GuiAlertResponseData))); @@ -30,9 +32,22 @@ // outgoing connect(this, SIGNAL(didRequestShowAlert(GuiAlertRequestData)), &_GuiController, SLOT(doAlertRequest(GuiAlertRequestData))); + + _timerID = startTimer(_timerInterval); } /*! + * \brief VVitals::timerEvent + * Called every _timerInterval (s) + * \param event (QTimerEvent*) the timer event + */ +void VVitals::timerEvent(QTimerEvent *event) +{ + Q_UNUSED(event); + notifyTakeMeasurement(); +} + +/*! * \brief VVitals::doUpdateBPMeasureInterval * Updates the blood pressure and hr measurement interval during a treatment * Called whenever a new treatment parameters request is issued @@ -93,7 +108,7 @@ * \brief VVitals::onTimeout * Notifies the user to take a measurement */ -void VVitals::onTimeout() +void VVitals::notifyTakeMeasurement() { // coco begin validated: Has been validated manually if (bloodPressureMeasureIntervalMinutes() == 0)