Index: leahi.pro =================================================================== diff -u -r3da801fd23f007886f7fda5e9b45d17d565150d2 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- leahi.pro (.../leahi.pro) (revision 3da801fd23f007886f7fda5e9b45d17d565150d2) +++ leahi.pro (.../leahi.pro) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -189,6 +189,7 @@ sources/model/td/data/MTDTemperatureData.h \ sources/model/td/data/MTDValvesData.h \ sources/model/td/data/MTDVoltageData.h \ + sources/model/td/data/MWaterSampleData.h \ sources/model/td/data/treatment/MTreatmentBloodFlowData.h \ sources/model/td/data/treatment/MTreatmentBloodPrimeData.h \ sources/model/td/data/treatment/MTreatmentIsolatedUFData.h \ @@ -266,6 +267,7 @@ sources/view/td/data/VTDValvesData.h \ sources/view/td/data/VTDVoltageData.h \ sources/view/td/data/VTreatmentRanges.h \ + sources/view/td/data/VWaterSampleData.h \ \ # ---------- Views - TD - Data - In-Treatment sources/view/td/data/treatment/VTDTreatmentStatesData.h \ sources/view/td/data/treatment/VTreatmentBloodFlow.h \ @@ -300,6 +302,7 @@ \ # ---------- Views - TD - Adjustment - Pre-Treatment sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesConfirm.h \ sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.h \ + sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h \ \ # ---------- Models - TD - Adjustment - In-Treatment sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.h \ sources/model/td/adjustment/treatment/MTreatmentAdjustRecirculateResponse.h \ @@ -315,6 +318,7 @@ \ # ---------- Models - TD - Adjustment - Pre-Treatment sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustDisposablesConfirmResponse.h \ sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustStartTreatmentResponse.h \ + sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h \ \ # ---------- Models - confirm sources/model/confirm/MDuetConfirmHDi.h \ \ # ---------- Models - POST @@ -350,7 +354,6 @@ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.h \ - sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustDisposablesPrimeResponse.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustPatientConnectionBeginResponse.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustUltrafiltrationInitResponse.h \ @@ -451,7 +454,6 @@ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h \ \ # ---------- Views - HD - Adjustment - Pre-Treatment sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.h \ - sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentConsumablesConfirm.h \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesPrime.h \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionBegin.h \ @@ -554,6 +556,7 @@ sources/model/td/data/MTDTemperatureData.cpp \ sources/model/td/data/MTDValvesData.cpp \ sources/model/td/data/MTDVoltageData.cpp \ + sources/model/td/data/MWaterSampleData.cpp \ sources/model/td/data/treatment/MTreatmentBloodFlowData.cpp \ sources/model/td/data/treatment/MTreatmentBloodPrimeData.cpp \ sources/model/td/data/treatment/MTreatmentIsolatedUFData.cpp \ @@ -651,6 +654,7 @@ \ # ---------- Models - TD - Adjustment - Pre-Treatment sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustDisposablesConfirmResponse.cpp \ sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustStartTreatmentResponse.cpp \ + sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp \ \ # ---------- Models - TD - Adjustment - In-Treatment sources/model/td/adjustment/treatment/MTreatmentAdjustRecirculateResponse.cpp \ \ # ---------- Models - DD - Adjustment - Settings @@ -662,7 +666,6 @@ \ # ---------- Models - HD - Adjustment - Pre-Treatment sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp \ - sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustDisposablesPrimeResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustPatientConnectionBeginResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustUltrafiltrationInitResponse.cpp \ @@ -744,6 +747,7 @@ sources/view/td/data/VTDValvesData.cpp \ sources/view/td/data/VTDVoltageData.cpp \ sources/view/td/data/VTreatmentRanges.cpp \ + sources/view/td/data/VWaterSampleData.cpp \ \ # ---------- Views - TD - Data - In-Treatment sources/view/td/data/treatment/VTDTreatmentStatesData.cpp \ sources/view/td/data/treatment/VTreatmentBloodFlow.cpp \ @@ -778,6 +782,7 @@ \ # ---------- Views - TD - Adjustment - Pre-Treatment sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesConfirm.cpp \ sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentStartTreatment.cpp \ + sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp \ \ # ---------- Views - CONFIRM sources/view/confirm/VConfirm.cpp \ \ # ---------- Views - POST @@ -806,7 +811,6 @@ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp \ \ # ---------- Views - HD - Adjustment - Pre-Treatment sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentInitTreatment.cpp \ - sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentConsumablesConfirm.cpp \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentDisposablesPrime.cpp \ sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentPatientConnectionBegin.cpp \ Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -rb2db816026524a19086e900eef867d7f5a3aa6f2 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision b2db816026524a19086e900eef867d7f5a3aa6f2) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -719,7 +719,7 @@ void MessageDispatcher::onAdjustment(const AdjustWaterSampleResultRequestData &vData) { QVariantList mData; - mData += vData.requestedState; + mData += vData.result; onActionTransmit(GuiActionType::ID_AdjustWaterSampleResultReq, mData); } Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r83acad721bd36d2c88a15feddd6812d2e591bef3 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 83acad721bd36d2c88a15feddd6812d2e591bef3) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -229,6 +229,8 @@ {Gui::GuiActionType::ID_AdjustWaterSampleReq , 1 * 4 }, // 1 parameters each 4bytes {Gui::GuiActionType::ID_AdjustWaterSampleRsp , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_AdjustWaterSampleResultReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustWaterSampleData , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustWaterSampleTimeout , 0 * 4 }, // 0 parameters each 4bytes // Pre-Treatment Consumables Installation Confirm {Gui::GuiActionType::ID_AdjustConsumablesConfirmReq , 0 * 4 }, // 0 parameter // Pre-Treatment SelfTest NoCartridge Progress Data Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rf723048b0efe2edf7cb08b9bba2ef67c55917503 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision f723048b0efe2edf7cb08b9bba2ef67c55917503) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -516,7 +516,8 @@ case Gui::GuiActionType::ID_SelfTestNoCartridgeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_SelfTestNoCartridgeData ); break; case Gui::GuiActionType::ID_SelfTestDryData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_SelfTestDryData ); break; case Gui::GuiActionType::ID_DisposablesPrimeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DisposablesPrimeData ); break; - // ----- Pre-Treatment - Adjust + + // ----- Pre-Treatment - Adjust case Gui::GuiActionType::ID_AdjustInitTreatmentRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustInitTreatmentRsp ); break; case Gui::GuiActionType::ID_AdjustParametersValidationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustParametersValidationRsp ); break; case Gui::GuiActionType::ID_AdjustWaterSampleRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustWaterSampleRsp ); break; @@ -526,6 +527,8 @@ case Gui::GuiActionType::ID_AdjustUltrafiltrationInitRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustUltrafiltrationInitRsp ); break; case Gui::GuiActionType::ID_AdjustPatientConnectionConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustPatientConnectionConfirmRsp ); break; case Gui::GuiActionType::ID_AdjustStartTreatmentRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustStartTreatmentRsp ); break; + case Gui::GuiActionType::ID_AdjustWaterSampleData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustWaterSampleData ); break; +// case Gui::GuiActionType::ID_AdjustWaterSampleTimeout : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustWaterSampleTimeout ); break; // ----- In-Treatment - Datum case Gui::GuiActionType::ID_TreatmentTime : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentTime ); break; Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -103,6 +103,7 @@ #include "VTDEjectorData.h" #include "VTDTemperatureData.h" #include "VTreatmentTrends.h" +#include "VWaterSampleData.h" // DG data #include "VDGDrainPumpData.h" #include "VDDHeatersData.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r3da801fd23f007886f7fda5e9b45d17d565150d2 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 3da801fd23f007886f7fda5e9b45d17d565150d2) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -168,6 +168,9 @@ ID_AdjustWaterSampleReq = 0x5D00, // 93 ID_AdjustWaterSampleRsp = 0x5E00, // 94 ID_AdjustWaterSampleResultReq = 0XA300, // 163 + ID_AdjustWaterSampleData = 0xAB00, // + ID_AdjustWaterSampleTimeout = 0xAc00, // + // Pre-Treatment Consumables Installation Confirm ID_AdjustConsumablesConfirmReq = 0x6800, // 104 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment SelfTest NoCartridge Progress Data Index: sources/gui/qml/main.qml =================================================================== diff -u -r5941bc1d07e5d58f9d848afbf1414ef4f78e9185 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/gui/qml/main.qml (.../main.qml) (revision 5941bc1d07e5d58f9d848afbf1414ef4f78e9185) +++ sources/gui/qml/main.qml (.../main.qml) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -65,6 +65,7 @@ import VPreTreatmentStates 0.1 import VTDTreatmentStates 0.1 import VPostTreatmentStates 0.1 +import VWaterSample 0.1 // Treatment - Common import VTreatmentVitals 0.1 @@ -239,6 +240,7 @@ VTDEjector { id: vTDEjector } VTDTemperature { id: vTDTemperature } VListModel { id: vListModel } + VWaterSample { id: vWaterSample } VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } VTreatmentIsolatedUF { id: vTreatmentIsolatedUF } Index: sources/model/MModel.h =================================================================== diff -u -rf723048b0efe2edf7cb08b9bba2ef67c55917503 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/model/MModel.h (.../MModel.h) (revision f723048b0efe2edf7cb08b9bba2ef67c55917503) +++ sources/model/MModel.h (.../MModel.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -75,8 +75,8 @@ #include "MTDSwitchesData.h" #include "MTDEjectorData.h" #include "MTDTemperatureData.h" +#include "MWaterSampleData.h" - // Debugging Messages #include "MHDDebugText.h" #include "MDGDebugText.h" @@ -390,6 +390,7 @@ REGISTER_METATYPE( TDAirPumpData ) \ REGISTER_METATYPE( HDUsageInfoResponseData ) \ REGISTER_METATYPE( HDUsageInfoRequestData ) \ + REGISTER_METATYPE( WaterSampleData ) \ /* Treatment Log */ \ REGISTER_METATYPE( TreatmentLogAvrgeData ) \ REGISTER_METATYPE( TreatmentLogAlarmData ) \ @@ -624,6 +625,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TDSwitchesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TDBatteryData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TDValvesData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, WaterSampleData ) \ /* Treatment Log */ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentLogAvrgeData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentLogAlarmData ) \ @@ -871,6 +873,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( TDSwitchesData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TDEjectorData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TDTemperatureData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( WaterSampleData ) \ /* Treatment Log */ \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentLogAvrgeData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentLogAlarmData ) \ @@ -1252,6 +1255,7 @@ ACTION_RECEIVE_SIGNAL( TDTemperatureData ) \ ACTION_RECEIVE_SIGNAL( TDAirBubbleData ) \ ACTION_RECEIVE_SIGNAL( TDAirPumpData ) \ + ACTION_RECEIVE_SIGNAL( WaterSampleData ) \ /* Alarms */ \ ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \ ACTION_RECEIVE_SIGNAL( AlarmTriggeredData ) \ Index: sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h =================================================================== diff -u -r0d1a10c754665f397bf7e507643d928657ed9561 -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision 0d1a10c754665f397bf7e507643d928657ed9561) +++ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -227,19 +227,14 @@ * * | Payload || * | || - * | #1:(U32) | \ref request | + * | #1:(U32) | \ref result | * */ class MAdjustWaterSampleResultReq : public MModel { public: - enum Options { - eUnknown = -1, - eFailed = 0, - ePassed = 1, - }; - Options requestedState = eUnknown; + float result = 0; QString toString() { - return toString({requestedState}); + return toString({result}); } static QString toString(const QVariantList &vParameters) { Fisheye: Tag ca67f7413160dfba507856222bd9aa95c5fa6200 refers to a dead (removed) revision in file `sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ca67f7413160dfba507856222bd9aa95c5fa6200 refers to a dead (removed) revision in file `sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp (revision 0) +++ sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,49 @@ +/*! + * + * 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 MPreTreatmentAdjustWaterSampleResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MPreTreatmentAdjustWaterSampleResponse.h" + +using namespace Model; + +QVariantList MAdjustWaterSampleResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustWaterSampleResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustWaterSampleResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustWaterSampleResponseData MAdjustWaterSampleResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h =================================================================== diff -u --- sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h (revision 0) +++ sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,84 @@ +/*! + * + * 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 MPreTreatmentAdjustWaterSampleResponse.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 MAdjustWaterSampleResponse class + * \details The WaterSample adjustment response model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:----------------: | + * |0x5E00| 0x020 | 6 | Rsp | Y | HD | UI | WaterSample Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * \sa MAdjustWaterSampleReq : WaterSample Request + * \sa MPreTreatmentWaterSample : WaterSample Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustWaterSample | + * + */ +class MAdjustWaterSampleResponse : 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::eTD ; } + QString infoText () const override { return QString("AdjustWaterSample") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustWaterSampleResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustWaterSampleResponse::Data AdjustWaterSampleResponseData; Index: sources/model/td/data/MWaterSampleData.cpp =================================================================== diff -u --- sources/model/td/data/MWaterSampleData.cpp (revision 0) +++ sources/model/td/data/MWaterSampleData.cpp (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,36 @@ + +#include "MWaterSampleData.h" + +using namespace Model; + +QVariantList MWaterSample::parameters() const { + return { + _data.mValve .value, + _data.mResult .value, + }; +} + +bool MWaterSample::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mValve )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mResult )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MWaterSample::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +WaterSampleData MWaterSample::data() const { + Data data; + data.mValve = _data.mValve .value; + data.mResult = _data.mResult .value; + return data; +} Index: sources/model/td/data/MWaterSampleData.h =================================================================== diff -u --- sources/model/td/data/MWaterSampleData.h (revision 0) +++ sources/model/td/data/MWaterSampleData.h (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,70 @@ + +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MWaterSample class + * \details The WaterSample data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0xAB00| 0x020 | 6 | 1 Hz | N | TD | UI | WaterSample Data | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mValve | + * | #2:(U32) | \ref Data::mResult | + * + * \sa Data + * \sa MWaterSample : WaterSample Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | TD | + * | infoText | AdjustWaterSample | + * + */ +class MWaterSample : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mValve ; + Types::U32 mResult ; + } _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("WaterSampleData") ; } + + struct Data { + quint32 mValve = 0; /*!< valve value of type quint32 extracted out */ + quint32 mResult = 0; /*!< result value of type quint32 extracted out */ + }; + + MWaterSample () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MWaterSample::Data WaterSampleData; Index: sources/view/VView.h =================================================================== diff -u -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c -rca67f7413160dfba507856222bd9aa95c5fa6200 --- sources/view/VView.h (.../VView.h) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) +++ sources/view/VView.h (.../VView.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -150,6 +150,7 @@ REGISTER_TYPE( VAlarmActiveList ) \ /* Treatment Common */ \ REGISTER_TYPE( VTreatmentVitals ) \ + REGISTER_TYPE( VWaterSample ) \ /* Data - States */ \ REGISTER_TYPE( VTDOpMode ) \ REGISTER_TYPE( VPreTreatmentStates ) \ Fisheye: Tag ca67f7413160dfba507856222bd9aa95c5fa6200 refers to a dead (removed) revision in file `sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ca67f7413160dfba507856222bd9aa95c5fa6200 refers to a dead (removed) revision in file `sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp =================================================================== diff -u --- sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp (revision 0) +++ sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,68 @@ +/*! + * + * 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 VPreTreatmentAdjustmentWaterSample.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VPreTreatmentAdjustmentWaterSample.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VPreTreatmentAdjustmentWaterSample) + +/*! \brief Connection Initializer + \details All the class signal/slot connections are defined here. +*/ +void View::VPreTreatmentAdjustmentWaterSample::initConnections() { +// ADJUST_VIEW_CONNECTION(AdjustWaterSampleRequestData ); + ADJUST_VIEW_CONNECTION(AdjustWaterSampleResultRequestData ); +// ACTION_VIEW_CONNECTION(AdjustWaterSampleResponseData ); +} + +///*! +// * \brief VPreTreatmentAdjustmentWaterSample::onActionReceive +// * \details received response model data handler +// * \param vData - model data +// */ +//void View::VPreTreatmentAdjustmentWaterSample::onActionReceive(const AdjustWaterSampleResponseData &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 ); +//} + +///*! +// * \brief View::VPreTreatmentAdjustmentWaterSample::doSample +// * \details requests to start or stop the water sample +// * \param vStart - the boolean value to indicate the request. +// */ +//void View::VPreTreatmentAdjustmentWaterSample::doSample(bool vStart) { +// AdjustWaterSampleRequestData data; +// data.requestedState = vStart ? +// AdjustWaterSampleRequestData::eStart: +// AdjustWaterSampleRequestData::eStop ; +// emit didAdjustment(data); +//} + +/*! + * \brief View::VPreTreatmentAdjustmentWaterSample::doResult + * \details requests to send the user result of the water sample. + * \param vPassed - the boolean value to indicate the result if passed is true, false otherwise. + */ +void View::VPreTreatmentAdjustmentWaterSample::doResult(float vResult) { + AdjustWaterSampleResultRequestData data; + data.result = vResult; + emit didAdjustment(data); +} Index: sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h =================================================================== diff -u --- sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h (revision 0) +++ sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,70 @@ +/*! + * + * 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 VPreTreatmentAdjustmentWaterSample.h + * \author (last) Behrouz NematiPour + * \date (last) 18-Apr-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VAdjustmentResponseBase.h" +#include "MPreTreatmentAdjustWaterSampleResponse.h" + +namespace View { + +/*! + * \brief The VPreTreatmentAdjustmentWaterSample class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustWaterSampleResponse + * + */ +class VPreTreatmentAdjustmentWaterSample : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + TRIGGER( bool , adjustment , 0) + +// VIEW_DEC_CLASS_ADJUSTMENT(VPreTreatmentAdjustmentWaterSample, AdjustWaterSampleResponseData) + VIEW_DEC_CLASS(VPreTreatmentAdjustmentWaterSample) + + // ----------- Adjust Ultrafiltration +public slots: +// void doSample (bool vStart); + void doResult (float vResult); + +signals: + void didTimeout(); + + /*! + * \brief didAdjustment + * \details the notification signal to send user request of start/stop the water sample. + * \param vData - data model that contains the request data. + */ +// void didAdjustment(const AdjustWaterSampleRequestData &vData); + + /*! + * \brief didAdjustment + * \details the notification signal to request to send the user water sample result. + * \param vData - data model that contains the request data. + */ + void didAdjustment(const AdjustWaterSampleResultRequestData &vData); + +}; +} Index: sources/view/td/data/VWaterSampleData.cpp =================================================================== diff -u --- sources/view/td/data/VWaterSampleData.cpp (revision 0) +++ sources/view/td/data/VWaterSampleData.cpp (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,13 @@ + +#include "VWaterSampleData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VWaterSample, WaterSampleData) + +void VWaterSample::onActionReceive(const WaterSampleData &vData) +{ + Valve (vData.mValve ); + Result (vData.mResult ); +} Index: sources/view/td/data/VWaterSampleData.h =================================================================== diff -u --- sources/view/td/data/VWaterSampleData.h (revision 0) +++ sources/view/td/data/VWaterSampleData.h (revision ca67f7413160dfba507856222bd9aa95c5fa6200) @@ -0,0 +1,31 @@ + +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MWaterSampleData.h" + +// namespace +namespace View { + +/*! + * \brief The VWaterSample class + * \details View for Model's data representation. + * + * \sa Model::MWaterSample + * + */ +class VWaterSample : public QObject +{ + Q_OBJECT + + PROPERTY( quint32 , Valve , 0) + PROPERTY( quint32 , Result , 0) + + VIEW_DEC(VWaterSample, WaterSampleData) +}; +}