Index: leahi.pro =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- leahi.pro (.../leahi.pro) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ leahi.pro (.../leahi.pro) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -318,7 +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 \ + sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.h \ \ # ---------- Models - confirm sources/model/confirm/MDuetConfirmHDi.h \ \ # ---------- Models - POST @@ -654,7 +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 \ + sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.cpp \ \ # ---------- Models - TD - Adjustment - In-Treatment sources/model/td/adjustment/treatment/MTreatmentAdjustRecirculateResponse.cpp \ \ # ---------- Models - DD - Adjustment - Settings Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -699,19 +699,6 @@ /*! * \brief MessageDispatcher::onAdjustment - * \details This method transmits the Water Sample Adjustment Denali message. - * \param vData - Data model contains Water Sample adjustment. - * \return void - */ -void MessageDispatcher::onAdjustment(const AdjustWaterSampleRequestData &vData) -{ - QVariantList mData; - mData += vData.requestedState; - onActionTransmit(GuiActionType::ID_AdjustWaterSampleReq, mData); -} - -/*! - * \brief MessageDispatcher::onAdjustment * \details This method transmits the Water Sample Result Adjustment Denali message. * \param vData - Data model contains Water Sample Result adjustment. * \return void Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -rf723048b0efe2edf7cb08b9bba2ef67c55917503 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision f723048b0efe2edf7cb08b9bba2ef67c55917503) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -119,7 +119,6 @@ GuiActionType::ID_AlarmVolumeSetReq , // Pre-Treatment GuiActionType::ID_AdjustInitTreatmentReq , - GuiActionType::ID_AdjustWaterSampleReq , GuiActionType::ID_AdjustWaterSampleResultReq , GuiActionType::ID_AdjustConsumablesConfirmReq , GuiActionType::ID_AdjustDisposablesConfirmReq , Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -226,11 +226,9 @@ {Gui::GuiActionType::ID_AdjustParametersConfirmReq , 1 * 4 }, // 1 parameters each 4bytes // Pre-Treatment Water Sample {Gui::GuiActionType::ID_DGFilterFlushData , 2 * 4 }, // 2 parameters each 4bytes - {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_AdjustWaterSampleResultRsp , 3 * 4 }, // 2 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 @@ -293,7 +291,7 @@ // ---- Treatment Log {Gui::GuiActionType::ID_AdjustTreatmentLogReq , 0 * 4 }, // 0 parameter - {Gui::GuiActionType::ID_AdjustTreatmentLogRsp , 36 * 4 }, //36 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustTreatmentLogRsp , 62 * 4 }, // 62 parameter each 4bytes {Gui::GuiActionType::ID_TreatmentLogAvrgeData , 5 * 4 }, // 5 parameter each 4bytes {Gui::GuiActionType::ID_TreatmentLogAlarmData , 3 * 4 }, // 3 parameter each 4bytes {Gui::GuiActionType::ID_TreatmentLogEventData , 3 * 4 }, // 3 parameter each 4bytes Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -520,7 +520,7 @@ // ----- 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; + case Gui::GuiActionType::ID_AdjustWaterSampleResultRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustWaterSampleResultRsp ); break; case Gui::GuiActionType::ID_AdjustDisposablesConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDisposablesConfirmRsp ); break; case Gui::GuiActionType::ID_AdjustDisposablesPrimeRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDisposablesPrimeRsp ); break; case Gui::GuiActionType::ID_AdjustPatientConnectionBeginRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustPatientConnectionBeginRsp ); break; Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -165,11 +165,9 @@ // Pre-Treatment Water Sample ID_DGFilterFlushData = 0x600F, // ?? //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustWaterSampleReq = 0x5D00, // 93 - ID_AdjustWaterSampleRsp = 0x5E00, // 94 ID_AdjustWaterSampleResultReq = 0XA300, // 163 - ID_AdjustWaterSampleData = 0xAB00, // - ID_AdjustWaterSampleTimeout = 0xAc00, // + ID_AdjustWaterSampleResultRsp = 0xAB00, // + ID_AdjustWaterSampleData = 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 @@ -318,16 +316,17 @@ // Post-Treatment // Patient Disconnect 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 = 0x060F, // 060f //// ----- @CRAPIZED - ID_AdjustPatientDisconnectConfirmRsp = 0x7E0F, // 126 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustPatientDisconnectConfirmReq = 0x5500, // 85 + ID_AdjustPatientDisconnectConfirmRsp = 0x5600, // 86 // Disposables Removal ID_AdjustDisposablesRemovalConfirmReq = 0x9400, // 148 ID_AdjustDisposablesRemovalConfirmRsp = 0x9500, // 149 // Treatment Log Adjs - ID_AdjustTreatmentLogReq = 0x750F, // 117 //// ----- @CRAPIZED: had to change to avoid duplication - ID_AdjustTreatmentLogRsp = 0x760F, // 118 //// ----- @CRAPIZED: had to change to avoid duplication + ID_AdjustTreatmentLogReq = 0xA900, // 166 + ID_AdjustTreatmentLogRsp = 0xAA00, // 167 + // Treatment Log Data ID_TreatmentLogAvrgeData = 0x940F, // 148 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentLogAlarmData = 0x6A00, // 106 //// ----- @LEAHIZED Index: sources/model/MModel.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/model/MModel.h (.../MModel.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/model/MModel.h (.../MModel.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -135,7 +135,7 @@ #include "MPreTreatmentAdjustInitTreatmentResponse.h" #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "MDGFilterFlushData.h" // DG message but part of the Pre-Treatment messaging flow -#include "MPreTreatmentAdjustWaterSampleResponse.h" +#include "MPreTreatmentAdjustWaterSampleResultResponse.h" #include "MPreTreatmentSelfTestNoCartridgeData.h" #include "MPreTreatmentSelfTestDryData.h" #include "MPreTreatmentAdjustDisposablesConfirmResponse.h" @@ -443,7 +443,6 @@ REGISTER_METATYPE( AdjustInitTreatmentRequestData ) \ REGISTER_METATYPE( AdjustParametersValidationRequestData ) \ REGISTER_METATYPE( AdjustParametersConfirmRequestData ) \ - REGISTER_METATYPE( AdjustWaterSampleRequestData ) \ REGISTER_METATYPE( AdjustWaterSampleResultRequestData ) \ REGISTER_METATYPE( AdjustConsumablesConfirmRequestData ) \ REGISTER_METATYPE( AdjustDisposablesConfirmRequestData ) \ @@ -501,7 +500,7 @@ /* Pre-Treatment */ \ REGISTER_METATYPE( AdjustInitTreatmentResponseData ) \ REGISTER_METATYPE( AdjustParametersValidationResponseData ) \ - REGISTER_METATYPE( AdjustWaterSampleResponseData ) \ + REGISTER_METATYPE( AdjustWaterSampleResultResponseData ) \ REGISTER_METATYPE( AdjustDisposablesConfirmResponseData ) \ REGISTER_METATYPE( AdjustDisposablesPrimeResponseData ) \ REGISTER_METATYPE( AdjustPatientConnectionBeginResponseData ) \ @@ -676,7 +675,7 @@ /* Pre-Treatment */ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustInitTreatmentResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustParametersValidationResponseData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustWaterSampleResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustWaterSampleResultResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDisposablesConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDisposablesPrimeResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustPatientConnectionBeginResponseData ) \ @@ -779,7 +778,6 @@ /* Pre-Treatment */ \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustInitTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustParametersValidationRequestData ) \ - ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustWaterSampleRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustWaterSampleResultRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustConsumablesConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDisposablesConfirmRequestData ) \ @@ -924,7 +922,7 @@ /* Pre-Treatment */ \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustInitTreatmentResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustParametersValidationResponseData ) \ - ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustWaterSampleResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustWaterSampleResultResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDisposablesConfirmResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDisposablesPrimeResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustPatientConnectionBeginResponseData ) \ @@ -997,7 +995,6 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustInitTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustParametersValidationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustParametersConfirmRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustWaterSampleRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustWaterSampleResultRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustConsumablesConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDisposablesConfirmRequestData ) \ @@ -1072,7 +1069,6 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustInitTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustParametersValidationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustParametersConfirmRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustWaterSampleRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustWaterSampleResultRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustConsumablesConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDisposablesConfirmRequestData ) \ @@ -1147,7 +1143,6 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustInitTreatmentRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustParametersValidationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustParametersConfirmRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustWaterSampleRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustWaterSampleResultRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustConsumablesConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDisposablesConfirmRequestData ) \ @@ -1307,7 +1302,7 @@ /* Pre-Treatment */ \ ACTION_RECEIVE_SIGNAL( AdjustInitTreatmentResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustParametersValidationResponseData ) \ - ACTION_RECEIVE_SIGNAL( AdjustWaterSampleResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustWaterSampleResultResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDisposablesConfirmResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDisposablesPrimeResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustPatientConnectionBeginResponseData ) \ Index: sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -189,35 +189,6 @@ }; /*! - * \brief The MAdjustWaterSampleReq class - * \details The model to request start/stop water sample - * - * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | - * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| - * |0x5D00| 0x100 | 9 | Req | Y | UI | HD | Water Sample Request | - * - * | Payload || - * | || - * | #1:(U32) | \ref requestedState | - * - */ -class MAdjustWaterSampleReq : public MModel { -public: - enum Options { - eStop = 0, - eStart = 1, - }; - Options requestedState = eStop; - QString toString() { - return toString({requestedState}); - } - - static QString toString(const QVariantList &vParameters) { - return MModel::toString("WaterSample", vParameters); - } -}; - -/*! * \brief The MAdjustWaterSampleResultReq class * \details The model to provide water sample result * @@ -369,11 +340,10 @@ * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| - * |0x7100| 0x100 | 9 | Req | Y | UI | TD | Start Treatment Request | + * |0xA100| 0x100 | 9 | Req | Y | UI | TD | Start Treatment Request | * * | Payload || * | || - * | #1:(U32) | \ref request | * */ class MAdjustStartTreatmentReq : public MModel { @@ -388,7 +358,6 @@ typedef Model:: MAdjustInitTreatmentReq AdjustInitTreatmentRequestData; typedef Model:: MAdjustParametersValidationReq AdjustParametersValidationRequestData; typedef Model:: MAdjustParametersConfirmReq AdjustParametersConfirmRequestData; -typedef Model:: MAdjustWaterSampleReq AdjustWaterSampleRequestData; typedef Model:: MAdjustWaterSampleResultReq AdjustWaterSampleResultRequestData; typedef Model:: MAdjustConsumablesConfirmReq AdjustConsumablesConfirmRequestData; typedef Model:: MAdjustDisposablesConfirmReq AdjustDisposablesConfirmRequestData; Fisheye: Tag 9403146058e7c4cef17bd542bbd39bbf032be9f3 refers to a dead (removed) revision in file `sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 9403146058e7c4cef17bd542bbd39bbf032be9f3 refers to a dead (removed) revision in file `sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.cpp (revision 0) +++ sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.cpp (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -0,0 +1,39 @@ + +#include "MPreTreatmentAdjustWaterSampleResultResponse.h" + +using namespace Model; + +QVariantList MAdjustWaterSampleResultResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + _data.mValue .value, + }; +} + +bool MAdjustWaterSampleResultResponse::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; + if ( ! GetValue(vByteArray, index, _data.mValue )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustWaterSampleResultResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustWaterSampleResultResponseData MAdjustWaterSampleResultResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + data.mValue = _data.mValue .value; + return data; +} Index: sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.h =================================================================== diff -u --- sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.h (revision 0) +++ sources/model/td/adjustment/pretreatment/MPreTreatmentAdjustWaterSampleResultResponse.h (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -0,0 +1,73 @@ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustWaterSampleResultResponse class + * \details The WaterSample adjustment response model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:----------------: | + * |0x5E00| 0x020 | 6 | Rsp | Y | TD | UI | WaterSample Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | #3:(F32) | \ref Data::mValue | + * + * \sa Data + * \sa MAdjustWaterSampleReq : WaterSample Request + * \sa MPreTreatmentWaterSample : WaterSample Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | TD | + * | infoText | AdjustWaterSample | + * + */ +class MAdjustWaterSampleResultResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + Types::F32 mValue ; + } _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("AdjustWaterSampleResult") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + float mValue = 0; /*!< Value value of type quint32 extracted out */ + }; + + MAdjustWaterSampleResultResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustWaterSampleResultResponse::Data AdjustWaterSampleResultResponseData; Index: sources/model/td/data/MWaterSampleData.cpp =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/model/td/data/MWaterSampleData.cpp (.../MWaterSampleData.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/model/td/data/MWaterSampleData.cpp (.../MWaterSampleData.cpp) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -6,20 +6,20 @@ QVariantList MWaterSample::parameters() const { return { _data.mValve .value, - _data.mResult .value, + _data.mTimeout .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; + if ( ! GetValue(vByteArray, index, _data.mTimeout )) goto lError; return true ; - + lError: if(vIndex) { *vIndex = index; } - + return false ; } @@ -31,6 +31,6 @@ WaterSampleData MWaterSample::data() const { Data data; data.mValve = _data.mValve .value; - data.mResult = _data.mResult .value; + data.mTimeout = _data.mTimeout .value; return data; } Index: sources/model/td/data/MWaterSampleData.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/model/td/data/MWaterSampleData.h (.../MWaterSampleData.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/model/td/data/MWaterSampleData.h (.../MWaterSampleData.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -24,7 +24,7 @@ * | Payload || * | || * | #1:(U32) | \ref Data::mValve | - * | #2:(U32) | \ref Data::mResult | + * | #2:(U32) | \ref Data::mTimeout | * * \sa Data * \sa MWaterSample : WaterSample Data @@ -46,7 +46,7 @@ struct { Types::U32 mValve ; - Types::U32 mResult ; + Types::U32 mTimeout ; } _data; public: @@ -56,8 +56,8 @@ 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 */ + quint32 mValve = 0; /*!< valve value of type quint32 extracted out */ + quint32 mTimeout = 0; /*!< result value of type quint32 extracted out */ }; MWaterSample () { } Index: sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp (.../VPreTreatmentAdjustmentWaterSample.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp (.../VPreTreatmentAdjustmentWaterSample.cpp) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -23,38 +23,26 @@ \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 ); + ADJUST_VIEW_CONNECTION(AdjustWaterSampleResultRequestData ); + ACTION_VIEW_CONNECTION(AdjustWaterSampleResultResponseData ); } -///*! -// * \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 ); +/*! + * \brief VPreTreatmentAdjustmentWaterSample::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void View::VPreTreatmentAdjustmentWaterSample::onActionReceive(const AdjustWaterSampleResultResponseData &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 ); -//} + resultValue (vData.mValue ); -///*! -// * \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); -//} + // *** 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::doResult Index: sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h (.../VPreTreatmentAdjustmentWaterSample.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/view/td/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.h (.../VPreTreatmentAdjustmentWaterSample.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -19,15 +19,15 @@ // Project #include "main.h" // Doxygen : do not remove #include "VAdjustmentResponseBase.h" -#include "MPreTreatmentAdjustWaterSampleResponse.h" +#include "MPreTreatmentAdjustWaterSampleResultResponse.h" namespace View { /*! * \brief The VPreTreatmentAdjustmentWaterSample class * \details View for Model's Data representation. * - * \sa Model::MAdjustWaterSampleResponse + * \sa Model::MAdjustWaterSampleResultResponse * */ class VPreTreatmentAdjustmentWaterSample : public VAdjustmentResponseBase @@ -39,25 +39,17 @@ // 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) + TRIGGER ( bool , adjustment , 0) -// VIEW_DEC_CLASS_ADJUSTMENT(VPreTreatmentAdjustmentWaterSample, AdjustWaterSampleResponseData) - VIEW_DEC_CLASS(VPreTreatmentAdjustmentWaterSample) + PROPERTY ( float , resultValue , 0) - // ----------- Adjust Ultrafiltration + VIEW_DEC_CLASS_ADJUSTMENT(VPreTreatmentAdjustmentWaterSample, AdjustWaterSampleResultResponseData) + 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 Index: sources/view/td/data/VWaterSampleData.cpp =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/view/td/data/VWaterSampleData.cpp (.../VWaterSampleData.cpp) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/view/td/data/VWaterSampleData.cpp (.../VWaterSampleData.cpp) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -9,5 +9,5 @@ void VWaterSample::onActionReceive(const WaterSampleData &vData) { Valve (vData.mValve ); - Result (vData.mResult ); + Timeout (vData.mTimeout ); } Index: sources/view/td/data/VWaterSampleData.h =================================================================== diff -u -rca67f7413160dfba507856222bd9aa95c5fa6200 -r9403146058e7c4cef17bd542bbd39bbf032be9f3 --- sources/view/td/data/VWaterSampleData.h (.../VWaterSampleData.h) (revision ca67f7413160dfba507856222bd9aa95c5fa6200) +++ sources/view/td/data/VWaterSampleData.h (.../VWaterSampleData.h) (revision 9403146058e7c4cef17bd542bbd39bbf032be9f3) @@ -23,8 +23,8 @@ { Q_OBJECT - PROPERTY( quint32 , Valve , 0) - PROPERTY( quint32 , Result , 0) + PROPERTY( quint32 , Valve , 0) + PROPERTY( quint32 , Timeout , 0) VIEW_DEC(VWaterSample, WaterSampleData) };