Index: leahi.pro =================================================================== diff -u -rb0ad6789ac542b1c24db1d89af3d4e1411a4d4f1 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- leahi.pro (.../leahi.pro) (revision b0ad6789ac542b1c24db1d89af3d4e1411a4d4f1) +++ leahi.pro (.../leahi.pro) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -360,7 +360,6 @@ sources/model/hd/data/posttreatment/MPostTreatmentStatesData.h \ \ # ---------- Models - HD - Adjustment sources/model/hd/adjustment/MAdjustRequestsBase.h \ - sources/model/hd/adjustment/MAdjustPowerOff.h \ sources/model/hd/adjustment/settings/MAdjustHDRequests.h \ \ # ---------- Models - HD - Adjustment - Settings sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.h \ @@ -610,6 +609,8 @@ \ # ---------- Models - TD - Data - Treatment Log sources/model/td/data/treatmentlog/MTreatmentLogAlarmData.cpp \ sources/model/td/data/treatmentlog/MTreatmentLogEventData.cpp \ + \ # ---------- Models - TD - Adjustment + sources/model/td/adjustment/MAdjustPowerOff.h \ \ # ---------- Models - TD - Adjustment - In-Treatment sources/model/td/adjustment/treatment/MTreatmentAdjustBloodPrimeResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustBloodFlowRateResponse.cpp \ @@ -655,6 +656,8 @@ \ # ---------- Models - Data - States sources/model/hd/data/pretreatment/MPreTreatmentStatesData.cpp \ sources/model/hd/data/posttreatment/MPostTreatmentStatesData.cpp \ + \ # ---------- Models - TD - Adjustment + sources/model/td/adjustment/MAdjustPowerOff.cpp \ \ # ---------- Models - TD - Adjustment - Settings sources/model/td/adjustment/settings/MAdjustTDDateTimeResponse.cpp \ sources/model/td/adjustment/settings/MTDInstitutionalRecordResponse.cpp \ @@ -671,8 +674,6 @@ sources/model/td/adjustment/treatment/MTreatmentAdjustRecirculateResponse.cpp \ \ # ---------- Models - DD - Adjustment - Settings sources/model/dd/adjustment/settings/MAdjustDDDateTimeResponse.cpp \ - \ # ---------- Models - HD - Adjustment - sources/model/hd/adjustment/MAdjustPowerOff.cpp \ \ # ---------- Models - HD - Adjustment - Settings sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.cpp \ \ # ---------- Models - HD - Adjustment - Pre-Treatment Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r54dac829fccaf4646e2e21c18226893afd3d8e73 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 54dac829fccaf4646e2e21c18226893afd3d8e73) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -54,7 +54,7 @@ {Gui::GuiActionType::ID_TDCheckIn , 0 }, //// ----- @LEAHIZED // Generic Confirm - {Gui::GuiActionType::ID_DuetConfirmHDi , 3 * 4 }, // 3 parameters each 4bytes + {Gui::GuiActionType::ID_DuetConfirmTDi , 3 * 4 }, // 3 parameters each 4bytes {Gui::GuiActionType::ID_DuetConfirmUIr , 2 * 4 }, // 2 parameters each 4bytes // POST Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rc70815ad2b3beadf61832f2e4d12eb90d476e020 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision c70815ad2b3beadf61832f2e4d12eb90d476e020) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -465,7 +465,7 @@ case Gui::GuiActionType::ID_PowerOff : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PowerOff ); break; case Gui::GuiActionType::ID_ShuttingDown : ok = true; LOG_APPED("HD,ShuttingDown"); /* TODO : implement notify<>() */ break; - case Gui::GuiActionType::ID_DuetConfirmHDi : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DuetConfirmHDi ); break; + case Gui::GuiActionType::ID_DuetConfirmTDi : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DuetConfirmTDi ); break; // ----- POST case Gui::GuiActionType::ID_HDPostSingleResultData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDPostSingleResultData ); break; Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r1c922f3a562ec4bb5b295d870b31a473168ef3d0 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 1c922f3a562ec4bb5b295d870b31a473168ef3d0) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -78,8 +78,8 @@ ID_TDCheckIn = 0x1000, // 16 //// ----- @LEAHIZED // Generic Confirmation - ID_DuetConfirmHDi = 0xBA00, // 186 - ID_DuetConfirmUIr = 0xBB00, // 187 + ID_DuetConfirmTDi = 0xB500, // 181 + ID_DuetConfirmUIr = 0xB600, // 182 // POST ID_HDPostSingleResultData = 0x8E0F, // 142 //// ----- @CRAPIZED: had to change to avoid duplication @@ -127,7 +127,7 @@ ID_PostTreatmentStates = 0x770F, // 119 //// ----- @CRAPIZED: had to change to avoid duplication // ----- - ID_PowerOff = 0x010F, // 010F //// ----- @CRAPIZED + ID_PowerOff = 0xB700, // 183 //// ----- @LEAHIZED ID_ShuttingDown = 0x0E0F, // 35 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentTime = 0x3B00, // 59 //// ----- @LEAHIZED ID_BloodFlow = 0x1100, // 17 //// ----- @LEAHIZED Index: sources/gui/qml/PowerItem.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/PowerItem.qml (.../PowerItem.qml) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -54,15 +54,15 @@ } onAccepted: { if ( vConfirm.isPowerOff ) { - _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.Accepted) + vConfirm.doConfirm( true ) } else { if ( ! vConfirm.isReject ) vConfirm.doConfirm( true ) } } onRejected: { if ( vConfirm.isPowerOff ) { - _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.Rejected) + vConfirm.doConfirm( false ) } else { if ( ! vConfirm.isReject ) vConfirm.doConfirm( false ) Index: sources/model/confirm/MDuetConfirmHDi.h =================================================================== diff -u -ra58f91b077c8131bea3dbde0fc338adb113fc9f3 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/model/confirm/MDuetConfirmHDi.h (.../MDuetConfirmHDi.h) (revision a58f91b077c8131bea3dbde0fc338adb113fc9f3) +++ sources/model/confirm/MDuetConfirmHDi.h (.../MDuetConfirmHDi.h) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -32,7 +32,7 @@ * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| - * |0xBA00| 0x020 | INIT | Y | HD | UI | Confirm | + * |0xB500| 0x020 | INIT | Y | TD | UI | Confirm | * * | Payload || * | || @@ -46,7 +46,7 @@ * | || * | || * | typeText | Event | - * | unitText | HD | + * | unitText | TD | * | infoText | Confirm | * */ Fisheye: Tag c66898d4ac69b72f1b9cc59e3039e7d9a1e59154 refers to a dead (removed) revision in file `sources/model/hd/adjustment/MAdjustPowerOff.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c66898d4ac69b72f1b9cc59e3039e7d9a1e59154 refers to a dead (removed) revision in file `sources/model/hd/adjustment/MAdjustPowerOff.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h =================================================================== diff -u -r1c922f3a562ec4bb5b295d870b31a473168ef3d0 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 1c922f3a562ec4bb5b295d870b31a473168ef3d0) +++ sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -66,7 +66,7 @@ * * | MSG | CAN ID | Type | Ack | Src | Dst | Description | * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | - * |0xBB00| 0x020 | Rsp | Y | UI | TD | Confirm | + * |0xB600| 0x020 | Rsp | Y | UI | TD | Confirm | * * | Payload || * | || Index: sources/model/td/adjustment/MAdjustPowerOff.cpp =================================================================== diff -u --- sources/model/td/adjustment/MAdjustPowerOff.cpp (revision 0) +++ sources/model/td/adjustment/MAdjustPowerOff.cpp (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -0,0 +1,46 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MAdjustPowerOff.cpp + * \author (last) Behrouz NematiPour + * \date (last) 22-Mar-2021 + * \author (original) Behrouz NematiPour + * \date (original) 22-Mar-2021 + * + */ +#include "MAdjustPowerOff.h" + +using namespace Model; + +QVariantList MPowerOff::parameters() const { + return { + _data.mStatus .value + }; +} + +bool MPowerOff::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mStatus )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MPowerOff::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MPowerOff::Data MPowerOff::data() const { + Data data; + data.mStatus = _data.mStatus.value; + return data; +} Index: sources/model/td/adjustment/MAdjustPowerOff.h =================================================================== diff -u --- sources/model/td/adjustment/MAdjustPowerOff.h (revision 0) +++ sources/model/td/adjustment/MAdjustPowerOff.h (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -0,0 +1,72 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MAdjustPowerOff.h + * \author (last) Behrouz NematiPour + * \date (last) 22-Mar-2021 + * \author (original) Behrouz NematiPour + * \date (original) 22-Mar-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +namespace Model { + +/*! + * \brief The MPowerOff class + * \details The power off model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------:| + * |0xB700| 0x020 | 6 | Cmd | N | TD | UI | Power Off | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mStatus | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | TD | + * | infoText | PowerOff | + * + */ +class MPowerOff : public MAbstract { +public: + Type_Enum typeText () const override { return Type_Enum::eEvent; } + Unit_Enum unitText () const override { return Unit_Enum::eTD ; } + QString infoText () const override { return QString("PowerOff"); } + QVariantList parameters() const override; + + struct { + Types::U32 mStatus ; + } _data; + +public: + struct Data { + quint32 mStatus = 0; + bool mShutDown = false; + }; + + MPowerOff () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MPowerOff::Data PowerOffData; Index: sources/view/hd/data/pretreatment/VPreTreatmentStatesData.cpp =================================================================== diff -u -r1c922f3a562ec4bb5b295d870b31a473168ef3d0 -rc66898d4ac69b72f1b9cc59e3039e7d9a1e59154 --- sources/view/hd/data/pretreatment/VPreTreatmentStatesData.cpp (.../VPreTreatmentStatesData.cpp) (revision 1c922f3a562ec4bb5b295d870b31a473168ef3d0) +++ sources/view/hd/data/pretreatment/VPreTreatmentStatesData.cpp (.../VPreTreatmentStatesData.cpp) (revision c66898d4ac69b72f1b9cc59e3039e7d9a1e59154) @@ -75,7 +75,7 @@ // Consumable and cartridge installation state - bool mInstallation = vData.mSubMode == GuiPreTreatmentStates ::TD_PRE_TREATMENT_CART_INSTALL_STATE ; + bool mInstallation = vData.mSubMode == GuiPreTreatmentStates ::TD_PRE_TREATMENT_TUBING_SET_INSTALL_STATE ; if ( mInstallation ) { // There is not state(enum) for this and it is always 0 for now. but will be used to notify UI about being in this state. installation_start ( vData.mInstallationState == 0 /* There is no other state and it is always 0 for now */ );