Index: denali.pro.user =================================================================== diff -u -r1aa53e9869f4c27d53dd9052271ca38befbe22e9 -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- denali.pro.user (.../denali.pro.user) (revision 1aa53e9869f4c27d53dd9052271ca38befbe22e9) +++ denali.pro.user (.../denali.pro.user) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -rff8553ddbd24f3b7e4727e78bc74c13e8eb7eeb5 -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- en_US.udic (.../en_US.udic) (revision ff8553ddbd24f3b7e4727e78bc74c13e8eb7eeb5) +++ en_US.udic (.../en_US.udic) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -13,3 +13,4 @@ HD Rsp PRS +Dialysate Index: sources/storage/Logger.cpp =================================================================== diff -u -r1aa53e9869f4c27d53dd9052271ca38befbe22e9 -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- sources/storage/Logger.cpp (.../Logger.cpp) (revision 1aa53e9869f4c27d53dd9052271ca38befbe22e9) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -269,9 +269,11 @@ logPathName = _logPathNames[eLogDebug]; _logFileName = logPathName + fileName; FileHandler::write(_logFileName, mContent + "\r\n", true); + // coco begin validated: This code is only for debugging purposes and had been tested manually. if (_enableConsoleOut) { qDebug().noquote() << mContent; } + // coco end } /*! Index: sources/view/hd/adjustment/VTreatmentAdjustmentPressuresLimits.h =================================================================== diff -u -r1aa53e9869f4c27d53dd9052271ca38befbe22e9 -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- sources/view/hd/adjustment/VTreatmentAdjustmentPressuresLimits.h (.../VTreatmentAdjustmentPressuresLimits.h) (revision 1aa53e9869f4c27d53dd9052271ca38befbe22e9) +++ sources/view/hd/adjustment/VTreatmentAdjustmentPressuresLimits.h (.../VTreatmentAdjustmentPressuresLimits.h) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -52,11 +52,14 @@ PROPERTY( qint32 , venousLimitLow , _data.VenousLimitLowDef ) PROPERTY( qint32 , venousLimitHigh , _data.VenousLimitHighDef ) + // coco begin validated: Tested manually + // these are manufacturing default values which will be assigned to the pressure parameters initially. + // since after the first change it will be overwritten by user value it has been provided here in case it is needed. CONSTANT( qint32 , arterialLimitLowDef , _data.ArterialLimitLowDef ) // default by PRS354 CONSTANT( qint32 , arterialLimitHighDef , _data.ArterialLimitHighDef ) // default by PRS355 CONSTANT( qint32 , venousLimitLowDef , _data.VenousLimitLowDef ) // default by PRS356 CONSTANT( qint32 , venousLimitHighDef , _data.VenousLimitHighDef ) // default by PRS357 - + // coco end VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentPressuresLimits, AdjustPressuresLimitsResponseData) // ----- Adjust Pressures Limits Index: unittests/tst_messaging.cpp =================================================================== diff -u -ra6abc05918a15924460d2b9358365b3eeedf1d1c -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- unittests/tst_messaging.cpp (.../tst_messaging.cpp) (revision a6abc05918a15924460d2b9358365b3eeedf1d1c) +++ unittests/tst_messaging.cpp (.../tst_messaging.cpp) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -766,6 +766,15 @@ QVERIFY(payload.isEmpty()); } +void tst_messaging::tst_MessageInterpreter_interpretMessage_AdjustPressuresReq() +{ + Can::MessageInterpreter iMsg; + QByteArray payload; + // if the payload is empty the len is not valid and should return false and empty payload + QVERIFY( ! iMsg.interpretMessage(Gui::GuiActionType::ID_AdjustPressuresLimitsReq, {}, payload)); + QVERIFY(payload.isEmpty()); +} + /*! * \brief tst_messaging::tst_MessageInterpreter_interpretMessage_CANBusFaultCount * \details Tests MessageInterpreter interpretMessage to handle ID_CANBusFaultCount message type Index: unittests/tst_messaging.h =================================================================== diff -u -ra6abc05918a15924460d2b9358365b3eeedf1d1c -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- unittests/tst_messaging.h (.../tst_messaging.h) (revision a6abc05918a15924460d2b9358365b3eeedf1d1c) +++ unittests/tst_messaging.h (.../tst_messaging.h) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -90,6 +90,7 @@ void tst_MessageInterpreter_interpretMessage_AdjustUltrafiltrationEditReq(); void tst_MessageInterpreter_interpretMessage_AdjustUltrafiltrationConfirmReq(); void tst_MessageInterpreter_interpretMessage_AdjustSalineReq(); + void tst_MessageInterpreter_interpretMessage_AdjustPressuresReq(); void tst_MessageInterpreter_interpretMessage_CANBusFaultCount(); void tst_MessageInterpreter_interpretMessage_String(); Index: unittests/tst_models.cpp =================================================================== diff -u -rcc1e9d6d55c816f3fcd626dc6948cca24da283b3 -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- unittests/tst_models.cpp (.../tst_models.cpp) (revision cc1e9d6d55c816f3fcd626dc6948cca24da283b3) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -44,6 +44,7 @@ #include "MTreatmentAdjustUltrafiltrationEditResponse.h" #include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" #include "MTreatmentAdjustSalineResponse.h" +#include "MTreatmentAdjustPressuresLimitsResponse.h" #include "MAlarmStatusData.h" #include "MAlarmTriggered.h" @@ -399,6 +400,68 @@ } } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Pressures Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAdjustPressuresLimitsResponse_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" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); + 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("mArterialLimitLow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mArterialLimitLow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mArterialLimitLow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mArterialLimitLow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mArterialLimitHigh ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mArterialLimitHigh ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mArterialLimitHigh ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mArterialLimitHigh ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mVenousLimitLow ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mVenousLimitLow ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mVenousLimitLow ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mVenousLimitLow ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); + QTest::newRow("mVenousLimitHigh ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mVenousLimitHigh ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); + QTest::newRow("mVenousLimitHigh ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); + QTest::newRow("mVenousLimitHigh ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); +} + +void tst_models::tst_MAdjustPressuresLimitsResponse() +{ + Model::MAdjustPressuresLimitsResponse 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.mArterialLimitLow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mArterialLimitHigh ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mVenousLimitLow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mVenousLimitHigh ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // Index: unittests/tst_models.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- unittests/tst_models.h (.../tst_models.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ unittests/tst_models.h (.../tst_models.h) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -52,6 +52,10 @@ void tst_MAdjustUltrafiltrationConfirmResponse_data (); void tst_MAdjustUltrafiltrationConfirmResponse (); + // -- Treatment Inline pressures + void tst_MAdjustPressuresLimitsResponse_data (); + void tst_MAdjustPressuresLimitsResponse (); + // - Data Messages void tst_DGROPumpData_data(); void tst_DGROPumpData();