Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -676,7 +676,7 @@ void MessageDispatcher::onAdjustment(const AdjustPatientDisconnectionNotifyRequestData &) { QVariantList mData; - onActionTransmit(GuiActionType::ID_AdjustPatientDisconnectionNotifyReq, mData); + onActionTransmit(GuiActionType::ID_AdjustPatientDisconnectNotifyReq, mData); } /*! @@ -688,7 +688,7 @@ void MessageDispatcher::onAdjustment(const AdjustPatientDisconnectionConfirmRequestData &) { QVariantList mData; - onActionTransmit(GuiActionType::ID_AdjustPatientDisconnectionConfirmReq, mData); + onActionTransmit(GuiActionType::ID_AdjustPatientDisconnectConfirmReq, mData); } /*! Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -144,8 +144,8 @@ GuiActionType::ID_AdjustRecirculateReq , GuiActionType::ID_AdjustTreatmentEndReq , // Post-Treatment - GuiActionType::ID_AdjustPatientDisconnectionNotifyReq , - GuiActionType::ID_AdjustPatientDisconnectionConfirmReq , + GuiActionType::ID_AdjustPatientDisconnectNotifyReq , + GuiActionType::ID_AdjustPatientDisconnectConfirmReq , GuiActionType::ID_AdjustDisposablesRemovalConfirmReq , // Disinfect GuiActionType::ID_AdjustDisinfectModeReq , Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -209,9 +209,9 @@ // ---- Post-Treatment // ---- Patient Disconnect - {Gui::GuiActionType::ID_AdjustPatientDisconnectionNotifyReq , 0 * 4 }, // 0 parameter - {Gui::GuiActionType::ID_AdjustPatientDisconnectionConfirmReq , 0 * 4 }, // 0 parameter - {Gui::GuiActionType::ID_AdjustPatientDisconnectionConfirmRsp , 2 * 4 }, // 2 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustPatientDisconnectNotifyReq , 0 * 4 }, // 0 parameter + {Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmReq , 0 * 4 }, // 0 parameter + {Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmRsp , 2 * 4 }, // 2 parameter each 4bytes // ---- Disposables Removal {Gui::GuiActionType::ID_AdjustDisposablesRemovalConfirmReq , 0 * 4 }, // 0 parameter Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -265,8 +265,8 @@ case Gui::GuiActionType::ID_AdjustRecirculateReq : INTERPRET_TRANSMIT_MESSAGE(AdjustRecirculateRequestData ); break; case Gui::GuiActionType::ID_AdjustTreatmentEndReq : INTERPRET_TRANSMIT_MESSAGE(AdjustTreatmentEndRequestData ); break; // Post-Treatment - case Gui::GuiActionType::ID_AdjustPatientDisconnectionNotifyReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientDisconnectionNotifyRequestData ); break; - case Gui::GuiActionType::ID_AdjustPatientDisconnectionConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientDisconnectionConfirmRequestData ); break; + case Gui::GuiActionType::ID_AdjustPatientDisconnectNotifyReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientDisconnectionNotifyRequestData ); break; + case Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustPatientDisconnectionConfirmRequestData ); break; case Gui::GuiActionType::ID_AdjustDisposablesRemovalConfirmReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustDisposablesRemovalConfirmRequestData ); break; case Gui::GuiActionType::ID_AdjustTreatmentLogReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustTreatmentLogRequestData ); break; // Disinfection @@ -497,6 +497,7 @@ case Gui::GuiActionType::ID_AdjustTreatmentEndRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustTreatmentEndRsp ); break; // ----- Post-Treatment Adjust + case Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustPatientDisconnectConfirmRsp ); break; case Gui::GuiActionType::ID_AdjustDisposablesRemovalConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDisposablesRemovalConfirmRsp); break; case Gui::GuiActionType::ID_AdjustTreatmentLogRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustTreatmentLogRsp ); break; // ----- Treatment Log Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -252,9 +252,9 @@ // Post-Treatment // Patient Disconnect - ID_AdjustPatientDisconnectionNotifyReq = 0x4A00, // 74 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response - ID_AdjustPatientDisconnectionConfirmReq = 0x0600, // 6 - ID_AdjustPatientDisconnectionConfirmRsp = 0x7E00, // 126 + ID_AdjustPatientDisconnectNotifyReq = 0x4A00, // 74 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + ID_AdjustPatientDisconnectConfirmReq = 0x0600, // 6 + ID_AdjustPatientDisconnectConfirmRsp = 0x7E00, // 126 // Disposables Removal ID_AdjustDisposablesRemovalConfirmReq = 0x7300, // 115 Index: sources/model/MModel.h =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/model/MModel.h (.../MModel.h) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/model/MModel.h (.../MModel.h) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -131,6 +131,7 @@ // Post-Treatment #include "MPostTreatmentAdjustRequests.h" +#include "MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h" #include "MPostTreatmentAdjustDisposablesRemovalConfirmResponse.h" // Treatment Log #include "MPostTreatmentAdjustTreatmentLogResponse.h" @@ -410,6 +411,7 @@ \ /* Response */ \ /* Post-Treatment */ \ + REGISTER_METATYPE( AdjustPatientDisconnectionConfirmResponseData ) \ REGISTER_METATYPE( AdjustDisposablesRemovalConfirmResponseData ) \ REGISTER_METATYPE( AdjustTreatmentLogResponseData ) \ /* Pre-Treatment */ \ @@ -540,6 +542,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PreTreatmentDisposablesPrimeData ) \ /* Response */ \ /* Post-Treatment */ \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustPatientDisconnectionConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDisposablesRemovalConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustTreatmentLogResponseData ) \ /* Pre-Treatment */ \ @@ -730,6 +733,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( PreTreatmentDisposablesPrimeData ) \ /* Response */ \ /* Post-Treatment */ \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustPatientDisconnectionConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDisposablesRemovalConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustTreatmentLogResponseData ) \ /* Pre-Treatment */ \ @@ -1019,6 +1023,7 @@ ACTION_RECEIVE_SIGNAL( PreTreatmentDisposablesPrimeData ) \ /* Response */ \ /* Post-Treatment */ \ + ACTION_RECEIVE_SIGNAL( AdjustPatientDisconnectionConfirmResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDisposablesRemovalConfirmResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustTreatmentLogResponseData ) \ /* Pre-Treatment */ \ Index: sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.cpp =================================================================== diff -u --- sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.cpp (revision 0) +++ sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.cpp (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -0,0 +1,45 @@ +/*! + * + * Copyright (c) 2021-2023 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 MPostTreatmentAdjustPatientDisconnectionConfirmResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h" + +using namespace Model; + +QVariantList MAdjustPatientDisconnectionConfirmResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustPatientDisconnectionConfirmResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +/*! + * \brief MAdjustPatientDisconnectionConfirmResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustPatientDisconnectionConfirmResponseData MAdjustPatientDisconnectionConfirmResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h =================================================================== diff -u --- sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h (revision 0) +++ sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -0,0 +1,84 @@ +/*! + * + * Copyright (c) 2021-2023 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 MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustPatientDisconnectionConfirmResponse class + * \details The PatientDisconnectionConfirm adjustment response model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * |0x7E00| 0x020 | Rsp | Y | HD | UI | Disposables Removal Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * \sa MAdjustPatientDisconnectionConfirmReq : PatientDisconnectionConfirm Request + * \sa MTreatmentPatientDisconnectionConfirm : PatientDisconnectionConfirm Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustPatientDisconnectionConfirm | + * + */ +class MAdjustPatientDisconnectionConfirmResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eHD ; } + QString infoText () const override { return QString("AdjustPatientDisconnectionConfirm") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustPatientDisconnectionConfirmResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustPatientDisconnectionConfirmResponse::Data AdjustPatientDisconnectionConfirmResponseData; Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.cpp =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.cpp (.../VPostTreatmentAdjustPatientDisconnectionConfirm.cpp) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.cpp (.../VPostTreatmentAdjustPatientDisconnectionConfirm.cpp) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -23,8 +23,9 @@ \details All the class signal/slot connections are defined here. */ void View::VPostTreatmentAdjustmentPatientDisconnectionConfirm::initConnections() { - ADJUST_VIEW_CONNECTION( AdjustPatientDisconnectionNotifyRequestData); - ADJUST_VIEW_CONNECTION(AdjustPatientDisconnectionConfirmRequestData); + ADJUST_VIEW_CONNECTION( AdjustPatientDisconnectionNotifyRequestData); + ADJUST_VIEW_CONNECTION( AdjustPatientDisconnectionConfirmRequestData); + ACTION_VIEW_CONNECTION(AdjustPatientDisconnectionConfirmResponseData); } /*! @@ -44,3 +45,18 @@ AdjustPatientDisconnectionConfirmRequestData data; emit didAdjustment(data); } + +/*! + * \brief VPostTreatmentAdjustmentPatientDisconnectionConfirm::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void View::VPostTreatmentAdjustmentPatientDisconnectionConfirm::onActionReceive(const AdjustPatientDisconnectionConfirmResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the Previous values before being set. *** + adjustment ( true ); +} Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.h =================================================================== diff -u -r8f8fc462e36e2ea9fbd236b86aaab5f048c17509 -r7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.h (.../VPostTreatmentAdjustPatientDisconnectionConfirm.h) (revision 8f8fc462e36e2ea9fbd236b86aaab5f048c17509) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustPatientDisconnectionConfirm.h (.../VPostTreatmentAdjustPatientDisconnectionConfirm.h) (revision 7f976c0ffdc727ddb89c1fe11ad250cb724cc4ce) @@ -18,6 +18,7 @@ // Project #include "main.h" // Doxygen : do not remove +#include "MPostTreatmentAdjustPatientDisconnectionConfirmResponse.h" #include "VAdjustmentResponseBase.h" namespace View { @@ -43,7 +44,7 @@ TRIGGER( bool , adjustment , 0) // disabled coco end - VIEW_DEC_CLASS(VPostTreatmentAdjustmentPatientDisconnectionConfirm) + VIEW_DEC_CLASS_ADJUSTMENT(VPostTreatmentAdjustmentPatientDisconnectionConfirm, AdjustPatientDisconnectionConfirmResponseData) public slots: void doNotify ();