Index: leahi.pro =================================================================== diff -u -rb0ad6789ac542b1c24db1d89af3d4e1411a4d4f1 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- leahi.pro (.../leahi.pro) (revision b0ad6789ac542b1c24db1d89af3d4e1411a4d4f1) +++ leahi.pro (.../leahi.pro) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -153,6 +153,7 @@ \ # Controllers sources/ApplicationController.h \ sources/device/DeviceController.h \ + sources/model/confirm/MDuetConfirmTDi.h \ sources/model/dd/adjustment/settings/MAdjustDDSerialNumberResponse.h \ sources/model/dd/adjustment/settings/MAdjustDDVersionsResponse.h \ sources/model/dd/data/MDDBloodLeakData.h \ @@ -334,7 +335,6 @@ sources/model/td/adjustment/posttreatment/MPostTreatmentAdjustDisposablesRemovalConfirmResponse.h \ sources/model/td/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h \ \ # ---------- Models - confirm - sources/model/confirm/MDuetConfirmHDi.h \ \ # ---------- Models - POST sources/model/dg/data/post/MDGPostFinalResultData.h \ sources/model/dg/data/post/MDGPostSingleResultData.h \ @@ -524,6 +524,7 @@ \ # Controllers sources/ApplicationController.cpp \ sources/device/DeviceController.cpp \ + sources/model/confirm/MDuetConfirmTDi.cpp \ sources/model/dd/adjustment/settings/MAdjustDDSerialNumberResponse.cpp \ sources/model/dd/adjustment/settings/MAdjustDDVersionsResponse.cpp \ sources/model/dd/data/MDDBloodLeakData.cpp \ @@ -632,7 +633,6 @@ sources/model/td/adjustment/treatment/MTreatmentAdjustVitalsResponse.cpp \ sources/model/td/adjustment/treatment/MTreatmentAdjustRinsebackResponse.cpp \ \ # ---------- Models - CONFIRM - sources/model/confirm/MDuetConfirmHDi.cpp \ \ # ---------- Models - POST sources/model/dg/data/post/MDGPostFinalResultData.cpp \ sources/model/dg/data/post/MDGPostSingleResultData.cpp \ Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r54dac829fccaf4646e2e21c18226893afd3d8e73 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 54dac829fccaf4646e2e21c18226893afd3d8e73) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -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 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision c70815ad2b3beadf61832f2e4d12eb90d476e020) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -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 -r490a131c41be4c335a7fbd74ff79b5784fb1726c -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 490a131c41be4c335a7fbd74ff79b5784fb1726c) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -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 @@ -329,7 +329,7 @@ ID_AdjustTreatmentLogRsp = 0xAA00, // 167 // Treatment Log Data - ID_TreatmentLogAvrgeData = 0xAD00, // + ID_TreatmentLogAvrgeData = 0x940F, // 148 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentLogAlarmData = 0x6A00, // 106 //// ----- @LEAHIZED ID_TreatmentLogEventData = 0x6B00, // 107 //// ----- @LEAHIZED Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreatePatientPrescription.qml =================================================================== diff -u -ra8ce0941b44e15fb7b9365f98d4656e232d4bf35 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreatePatientPrescription.qml (.../PreTreatmentCreatePatientPrescription.qml) (revision a8ce0941b44e15fb7b9365f98d4656e232d4bf35) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreatePatientPrescription.qml (.../PreTreatmentCreatePatientPrescription.qml) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -42,6 +42,29 @@ _heparinRx.reset() vTreatmentCreate.ufPreWeight = vTreatmentRanges.weightDef vTreatmentCreate.ufEstimatedTargetWeight = vTreatmentRanges.weightDef + + if ( _GuiView.dryDemoMode ) { + vTreatmentCreate.hdfTreatmentModeSet = true + vTreatmentCreate.substitutionFluidVolumeSet = true + vTreatmentCreate.bloodFlowRateSet = true + vTreatmentCreate.dialysateFlowRateSet = true + vTreatmentCreate.treatmentDurationSet = true + vTreatmentCreate.ultrafiltrationVolumeSet = true + vTreatmentCreate.acidConcentrateSet = true + vTreatmentCreate.dryBicarbCartSizeSet = true + vTreatmentCreate.dialyzerTypeSet = true + vTreatmentCreate.dialysateTempSet = true + vTreatmentCreate.heparinBolusVolumeSet = true + vTreatmentCreate.heparinDispensingRateSet = true + vTreatmentCreate.heparinDeliveryDurationSet = true + + vTreatmentCreate.substitutionFluidVolume = vTreatmentRanges.substitutionVolumeDef + vTreatmentCreate.bloodFlowRate = vTreatmentRanges.bloodFlowRateDef + vTreatmentCreate.dialysateFlowRate = vTreatmentRanges.dialysateFlowRateDef + vTreatmentCreate.treatmentDuration = vTreatmentRanges.treatmentDurationDef + vTreatmentCreate.ultrafiltrationVolume = vTreatmentRanges.ultrafiltrationVolumeDef + vTreatmentCreate.dialysateTemp = vTreatmentRanges.dialysateTempDef + } } function refreshAll () { Index: sources/model/MModel.h =================================================================== diff -u -rc70815ad2b3beadf61832f2e4d12eb90d476e020 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/model/MModel.h (.../MModel.h) (revision c70815ad2b3beadf61832f2e4d12eb90d476e020) +++ sources/model/MModel.h (.../MModel.h) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -29,7 +29,7 @@ #include "MAlarmActiveList.h" #include "MAdjustHDAlarmVolumeResponse.h" -#include "MDuetConfirmHDi.h" +#include "MDuetConfirmTDi.h" // POST #include "MHDPostSingleResultData.h" @@ -311,7 +311,7 @@ */ #define REGISTER_MODEL_METATYPES \ /* CONFIRM */ \ - REGISTER_METATYPE( DuetConfirmHDiData ) \ + REGISTER_METATYPE( DuetConfirmTDiData ) \ REGISTER_METATYPE( DuetConfirmUIrData ) \ /* RO Water Mode */ \ REGISTER_METATYPE( DuetRoWaterStatDGqData ) \ @@ -579,7 +579,7 @@ #define ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ \ /* CONFIRM */ \ - ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DuetConfirmHDiData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DuetConfirmTDiData ) \ /* RO Water Mode */ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DuetRoWaterStatDGqData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DuetRoWaterModeDGrData ) \ @@ -825,7 +825,7 @@ */ #define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \ /* CONFIRM */ \ - ACTION_RECEIVE_BRIDGE_DEFINITION( DuetConfirmHDiData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( DuetConfirmTDiData ) \ /* RO Water Mode */ \ ACTION_RECEIVE_BRIDGE_DEFINITION( DuetRoWaterStatDGqData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DuetRoWaterModeDGrData ) \ @@ -1202,7 +1202,7 @@ //== MessageInterpreter Signal Definition =======================================// #define ACTION_RECEIVE_SIGNALS \ /* CONFIRM */ \ - ACTION_RECEIVE_SIGNAL( DuetConfirmHDiData ) \ + ACTION_RECEIVE_SIGNAL( DuetConfirmTDiData ) \ /* RO Water Mode */ \ ACTION_RECEIVE_SIGNAL( DuetRoWaterStatDGqData ) \ ACTION_RECEIVE_SIGNAL( DuetRoWaterModeDGrData ) \ Fisheye: Tag bf57221d2e46597ae61607ee90272653c30b9a37 refers to a dead (removed) revision in file `sources/model/confirm/MDuetConfirmHDi.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag bf57221d2e46597ae61607ee90272653c30b9a37 refers to a dead (removed) revision in file `sources/model/confirm/MDuetConfirmHDi.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/confirm/MDuetConfirmTDi.cpp =================================================================== diff -u --- sources/model/confirm/MDuetConfirmTDi.cpp (revision 0) +++ sources/model/confirm/MDuetConfirmTDi.cpp (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -0,0 +1,52 @@ +/*! + * + * Copyright (c) 2022-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 MDuetConfirmTDi.cpp + * \author (last) Behrouz NematiPour + * \date (last) 22-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 22-Sep-2022 + * + */ +#include "MDuetConfirmTDi.h" + +using namespace Model; + +QVariantList MDuetConfirmTDi::parameters() const { + return { + _data.mId .value, + _data.mCommand .value, + _data.mReason .value, + }; +} + +bool MDuetConfirmTDi::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mId )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mCommand )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false; +} + +/*! + * \brief MDuetConfirmTDi::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +DuetConfirmTDiData MDuetConfirmTDi::data() const { + Data data; + data.mId = _data.mId .value; + data.mCommand = _data.mCommand .value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/confirm/MDuetConfirmTDi.h =================================================================== diff -u --- sources/model/confirm/MDuetConfirmTDi.h (revision 0) +++ sources/model/confirm/MDuetConfirmTDi.h (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -0,0 +1,85 @@ +/*! + * + * Copyright (c) 2022-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 MDuetConfirmTDi.h + * \author (last) Behrouz NematiPour + * \date (last) 22-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 22-Sep-2022 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MDuetConfirmTDi class + * \details The HD Confirmation request model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * |0xB500| 0x020 | INIT | Y | TD | UI | Confirm | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mId | + * | #2:(U32) | \ref Data::mCommand | + * | #3:(U32) | \ref Data::mReason | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | TD | + * | infoText | Confirm | + * + */ +class MDuetConfirmTDi : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mId ; /*!< Request ID */ + Types::U32 mCommand ; /*!< Request Command */ + Types::U32 mReason ; /*!< Request Rejection Reason */ + + } _data; + +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("Confirm" ) ; } + + struct Data { + quint32 mId = 0; /*!< Request ID */ + quint32 mCommand = 0; /*!< Request Command */ + quint32 mReason = 0; /*!< Request Rejection Reason */ + }; + + MDuetConfirmTDi () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MDuetConfirmTDi::Data DuetConfirmTDiData; Index: sources/view/confirm/VConfirm.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/view/confirm/VConfirm.cpp (.../VConfirm.cpp) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -25,7 +25,7 @@ * \details All the class signal/slot connections are defined here. */ void View::VConfirm::initConnections() { - ACTION_VIEW_CONNECTION(DuetConfirmHDiData ); + ACTION_VIEW_CONNECTION(DuetConfirmTDiData ); ACTION_VIEW_CONNECTION(PowerOffData ); ACTION_VIEW_CONNECTION(SettingsData ); @@ -36,7 +36,7 @@ * \brief View::VConfirm::setConfirmCommand * \param vCommand - confirm command */ -void View::VConfirm::setConfirmCommand(const DuetConfirmHDiData &vData) +void View::VConfirm::setConfirmCommand(const DuetConfirmTDiData &vData) { command ( vData.mCommand ); GuiConfirmCommand cmd = static_cast( _command ); @@ -81,7 +81,7 @@ * \brief View::VConfirm::setConfirmId * \param vId - confirm id */ -void View::VConfirm::setConfirmId(const DuetConfirmHDiData &vData) +void View::VConfirm::setConfirmId(const DuetConfirmTDiData &vData) { titleByID (); messageByID (); @@ -130,7 +130,7 @@ * \details received response model data handler * \param vData - model data */ -void View::VConfirm::onActionReceive(const DuetConfirmHDiData &vData) +void View::VConfirm::onActionReceive(const DuetConfirmTDiData &vData) { isPowerOff(false ); Index: sources/view/confirm/VConfirm.h =================================================================== diff -u -ra58f91b077c8131bea3dbde0fc338adb113fc9f3 -rbf57221d2e46597ae61607ee90272653c30b9a37 --- sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision a58f91b077c8131bea3dbde0fc338adb113fc9f3) +++ sources/view/confirm/VConfirm.h (.../VConfirm.h) (revision bf57221d2e46597ae61607ee90272653c30b9a37) @@ -19,7 +19,7 @@ // Project #include "main.h" // Doxygen : do not remove #include "VAdjustmentResponseBase.h" -#include "MDuetConfirmHDi.h" +#include "MDuetConfirmTDi.h" #include "MAdjustPowerOff.h" #include "MSettings.h" @@ -73,15 +73,15 @@ IDBASED (QString , confirm ,tr("CONFIRM" ), confirms, id) IDBASED (QString , cancel ,tr("CANCEL" ), confirms, id) - void setConfirmCommand (const DuetConfirmHDiData &vData); - void setConfirmId (const DuetConfirmHDiData &vData); + void setConfirmCommand (const DuetConfirmTDiData &vData); + void setConfirmId (const DuetConfirmTDiData &vData); void setPowerOffCommand (); void setPowerOffId (); VIEW_DEC_CLASS (VConfirm ) - VIEW_DEC_SLOT (DuetConfirmHDiData ) + VIEW_DEC_SLOT (DuetConfirmTDiData ) VIEW_DEC_SLOT (PowerOffData ) VIEW_DEC_SLOT (SettingsData )