Index: denali.pro.user =================================================================== diff -u -r89e3ca8e108dd4b3315ae7862c631eba43f8fd0f -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- denali.pro.user (.../denali.pro.user) (revision 89e3ca8e108dd4b3315ae7862c631eba43f8fd0f) +++ denali.pro.user (.../denali.pro.user) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -89,7 +89,7 @@ Desktop Qt 5.12.5 GCC 64bit Desktop Qt 5.12.5 GCC 64bit qt.qt5.5125.gcc_64_kit - 9 + 1 0 0 @@ -1185,7 +1185,7 @@ false true - /home/denali/Projects/tmp/build/unittest/tst_views + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Release 1 Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -r89e3ca8e108dd4b3315ae7862c631eba43f8fd0f -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 89e3ca8e108dd4b3315ae7862c631eba43f8fd0f) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -95,6 +95,7 @@ } MuteButton { id: _muteButton + objectName: "_alarmMuteButton" anchors { verticalCenter : _titleBar.verticalCenter left : _titleBar.left Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -r66e87ea403ec12a273553284919684282d87bc6a -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 66e87ea403ec12a273553284919684282d87bc6a) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -82,6 +82,23 @@ } } + TouchRect { id : _clearAlarmCondition + objectName: "_clearAlarmCondition" + width: 300 + height: Variables.logoHeight + animated: true + anchors { + top : parent.top + right : _endTreatmentButton.left + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + text.text: qsTr("Clear Alarm Condition") + button.onPressed: { + vAlarmStatus.doClearCondition(); + } + } + TitleText { id: _titleText anchors.horizontalCenter: parent.horizontalCenter; anchors.top: parent.top Index: sources/storage/FileHandler.cpp =================================================================== diff -u -r66e87ea403ec12a273553284919684282d87bc6a -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 66e87ea403ec12a273553284919684282d87bc6a) +++ sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -200,13 +200,15 @@ { QDir dir(vFolder); if ( ! dir.exists(vFolder) ) { + // coco begin validated: Has been validated manually if ( ! dir.mkpath(vFolder) ) { QString msg = "Can't create folder " + vFolder; // here can't use LOG_XXXX because if the folder can't be created then the log can't be written. errOut(msg); return false; } } + // coco end return true; } Index: sources/storage/Logger.cpp =================================================================== diff -u -rc8b2c06141831ba2908323138d94dec0ccc0d402 -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/storage/Logger.cpp (.../Logger.cpp) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -167,12 +167,13 @@ // coco begin validated: It can only happen if the file system is readonly for any reason. // it has been tested and works perfectly fine in normal run. if (! setLogPath()) { // check and create log folders & if unsuccessful then - // coco end setLogBasePath(true); // try to use application folder setLogPath ( ); // check and create log folders // Note: it may require to check for write access regarding device setup } } +// coco end + /*! * \brief Logger::setLogBasePath * \details Tries to the set the log path to the default log path (Log_Base_Path_Name) @@ -182,6 +183,7 @@ */ void Logger::setLogBasePath(bool vUseApplicationDirPath) { + // coco begin validated: Has been validated manually if (vUseApplicationDirPath) { _dir.setPath(qApp->applicationDirPath()); // Don't use LOG_XXXXX, At this moment Logger has not been initialized yet @@ -191,6 +193,7 @@ _dir.setPath(SDCard_Base_Path_Name); } } +// coco end /*! * \brief Logger::setLogPath Index: sources/view/VTreatmentBegin.cpp =================================================================== diff -u -r89e3ca8e108dd4b3315ae7862c631eba43f8fd0f -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/view/VTreatmentBegin.cpp (.../VTreatmentBegin.cpp) (revision 89e3ca8e108dd4b3315ae7862c631eba43f8fd0f) +++ sources/view/VTreatmentBegin.cpp (.../VTreatmentBegin.cpp) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -50,6 +50,7 @@ LOG_DEBUG("Checking BLE Connection..."); GuiAlertRequestData request; request.id = GuiAlertID::ID_Alert_BLE_Connection; + // coco begin validated: Has been validated manually if (!_bleConnected) { request.title = tr("The Blood Pressure Cuff is Not Connected"); @@ -61,8 +62,8 @@ request.title = tr("Ready for Blood Pressure Measurement"); request.description = tr("Press 'Confirm' once the blood pressure measurement has been taken."); emit didRequestShowAlert(request); - } +// coco end /*! * \brief VTreatmentBegin::doStartTreatment @@ -91,17 +92,21 @@ */ void VTreatmentBegin::onDeviceConnected() { + // coco begin validated: Has been validated manually _bleConnected = true; } +// coco end /*! * \brief VTreatmentBegin::onDeviceDisconnected * Called when a BLE BP Cuff is disconnected */ void VTreatmentBegin::onDeviceDisconnected() { + // coco begin validated: Has been validated manually _bleConnected = false; } +// coco end /*! * \brief VTreatmentBegin::onAdjustment @@ -111,14 +116,18 @@ void VTreatmentBegin::onAdjustment(const GuiAlertResponseData &messageData) { qDebug() << __FUNCTION__ << messageData.id; + // coco begin validated: Has been validated manually if (messageData.id != GuiAlertID::ID_Alert_BLE_Connection) return; + // coco end LOG_DEBUG(QString("Blood Pressure Prompt response: %1").arg(messageData.confirmed)); + // coco begin validated: Has been validated manually if (messageData.confirmed) { emit didConfirmReadyToStartTreament(); } + // coco end } Index: sources/view/VTreatmentBegin.h =================================================================== diff -u -r89e3ca8e108dd4b3315ae7862c631eba43f8fd0f -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/view/VTreatmentBegin.h (.../VTreatmentBegin.h) (revision 89e3ca8e108dd4b3315ae7862c631eba43f8fd0f) +++ sources/view/VTreatmentBegin.h (.../VTreatmentBegin.h) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -39,7 +39,9 @@ TREATMENT_PARAMETER(float, ufVolume, 0.1, 0, 8.0, 0.1 ) // mL // coco end protected: + // coco begin validated: This has been validated manually PROPERTY(bool, continueEnabled, false) + // coco end signals: void didStartNewTreatment(const TreatmentStartRequestData &data); void didRequestShowAlert(GuiAlertRequestData); Index: sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationInit.h =================================================================== diff -u -r28f3f8dd18981262995386d29d3c2ab31418bfc4 -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationInit.h (.../VTreatmentAdjustmentUltrafiltrationInit.h) (revision 28f3f8dd18981262995386d29d3c2ab31418bfc4) +++ sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationInit.h (.../VTreatmentAdjustmentUltrafiltrationInit.h) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -44,10 +44,10 @@ // and to always trigger the change event to work as a notifier for GUI // has been manually tested that it works perfectly fine TRIGGER( bool , adjustment , 0) - // coco end // Treatment Ultrafiltration data PROPERTY( float , volume , 0) + // coco end VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationInit, AdjustUltrafiltrationInitResponseData) Index: unittests/tst_models.cpp =================================================================== diff -u -r89e3ca8e108dd4b3315ae7862c631eba43f8fd0f -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- unittests/tst_models.cpp (.../tst_models.cpp) (revision 89e3ca8e108dd4b3315ae7862c631eba43f8fd0f) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -41,6 +41,7 @@ #include "MTreatmentSalineData.h" #include "MPrimingData.h" +#include "MTreatmentAdjustUltrafiltrationInitResponse.h" #include "MTreatmentAdjustUltrafiltrationStateResponse.h" #include "MTreatmentAdjustUltrafiltrationEditResponse.h" #include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" @@ -232,6 +233,52 @@ } } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Init Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAdjustUltrafiltrationInitResponse_data () +{ + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); +} + +void tst_models::tst_MAdjustUltrafiltrationInitResponse () +{ + Model::MAdjustUltrafiltrationInitResponse mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration State Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustUltrafiltrationStateResponse_data () { @@ -1469,7 +1516,43 @@ } } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmClearedCondition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmClearedCondition data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAlarmClearedCondition_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmCleared test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAlarmClearedCondition() { + Model::MAlarmClearedCondition mData; + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mAlarmID; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp data definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentParametersResp_data() @@ -1940,3 +2023,27 @@ QByteArray payload; QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_TreatmentCreateReq, vData, payload)); } + +void tst_models::tst_MAdjustUltrafiltrationInitRequest() +{ + MessageInterpreter interpreter; + QVariantList vData; + QByteArray payload; + QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AdjustUltrafiltrationInitReq, vData, payload)); +} + +void tst_models::tst_MAlarmUserActionRequest() +{ + MessageInterpreter interpreter; + QVariantList vData; + QByteArray payload; + QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AlarmUserActionReq, vData, payload)); +} + +void tst_models::tst_MAlarmClearedConditionRequest() +{ + MessageInterpreter interpreter; + QVariantList vData; + QByteArray payload; + QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AlarmClearedConditionReq, vData, payload)); +} Index: unittests/tst_models.h =================================================================== diff -u -r89e3ca8e108dd4b3315ae7862c631eba43f8fd0f -r3d0a160e4e8c0348c688ed5efe4d86dc66121e6b --- unittests/tst_models.h (.../tst_models.h) (revision 89e3ca8e108dd4b3315ae7862c631eba43f8fd0f) +++ unittests/tst_models.h (.../tst_models.h) (revision 3d0a160e4e8c0348c688ed5efe4d86dc66121e6b) @@ -51,6 +51,10 @@ void tst_MAdjustBloodDialysateResponse (); // -- Ultrafiltration + // --- Init + void tst_MAdjustUltrafiltrationInitRequest(); + void tst_MAdjustUltrafiltrationInitResponse_data (); + void tst_MAdjustUltrafiltrationInitResponse (); // --- State void tst_MAdjustUltrafiltrationStateResponse_data (); void tst_MAdjustUltrafiltrationStateResponse (); @@ -118,6 +122,8 @@ // Alarms void tst_MAlarmStatus_text(); + void tst_MAlarmClearedConditionRequest(); + void tst_MAlarmUserActionRequest(); void tst_MAlarmStatus_data(); void tst_MAlarmStatus(); @@ -128,6 +134,9 @@ void tst_MAlarmCleared_data(); void tst_MAlarmCleared(); + void tst_MAlarmClearedCondition_data(); + void tst_MAlarmClearedCondition(); + // Treatment Parameters void tst_MTreatmentParametersResp_data(); void tst_MTreatmentParametersResp();