Index: leahi.pro =================================================================== diff -u -r3c07dc803109f716937b692cb4a67a5324bb9ca3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- leahi.pro (.../leahi.pro) (revision 3c07dc803109f716937b692cb4a67a5324bb9ca3) +++ leahi.pro (.../leahi.pro) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -67,6 +67,10 @@ sources/model/dd/data \ sources/model/dd/adjustment \ sources/model/dd/adjustment/settings \ + sources/model/fp \ + sources/model/fp/data \ + sources/model/fp/adjustment \ + sources/model/fp/adjustment/settings \ sources/view \ sources/view/td \ sources/view/td/data \ @@ -75,6 +79,8 @@ sources/view/dd/data \ sources/view/confirm \ sources/view/settings \ + sources/view/fp \ + sources/view/fp/data \ \ sources/gui \ sources/utility \ @@ -128,6 +134,7 @@ common/AlarmDefs.h \ common/Compatible.h \ common/DDDefs.h \ + common/FPDefs.h \ common/TDDefs.h \ common/MsgDefs.h \ \ # Main @@ -153,6 +160,15 @@ sources/model/dd/data/MDDPressuresData.h \ sources/model/dd/data/MDDTemperaturesData.h \ sources/model/dd/data/MDDValvesStatesData.h \ + sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.h \ + sources/model/fp/data/MFPBoostPumpData.h \ + sources/model/fp/data/MFPConductivityData.h \ + sources/model/fp/data/MFPFlowData.h \ + sources/model/fp/data/MFPLevelData.h \ + sources/model/fp/data/MFPPressuresData.h \ + sources/model/fp/data/MFPROPumpData.h \ + sources/model/fp/data/MFPTemperatureData.h \ + sources/model/fp/data/MFPValvesStatesData.h \ sources/model/td/adjustment/settings/MAdjustTDSerialNumberResponse.h \ sources/model/td/adjustment/settings/MAdjustTDVersionsRequest.h \ sources/model/td/adjustment/settings/MAdjustTDVersionsResponse.h \ @@ -194,6 +210,14 @@ sources/view/dd/data/VDDPressuresData.h \ sources/view/dd/data/VDDTemperaturesData.h \ sources/view/dd/data/VDDValvesStatesData.h \ + sources/view/fp/data/VFPBoostPumpData.h \ + sources/view/fp/data/VFPConductivityData.h \ + sources/view/fp/data/VFPFlowData.h \ + sources/view/fp/data/VFPLevelData.h \ + sources/view/fp/data/VFPPressuresData.h \ + sources/view/fp/data/VFPROPumpData.h \ + sources/view/fp/data/VFPTemperatureData.h \ + sources/view/fp/data/VFPValvesStatesData.h \ sources/view/hd/data/VTreatmentRanges.h \ sources/view/td/data/VTDAirBubbleData.h \ sources/view/td/data/VTDAirPumpData.h \ @@ -458,6 +482,15 @@ sources/model/dd/data/MDDPressuresData.cpp \ sources/model/dd/data/MDDTemperaturesData.cpp \ sources/model/dd/data/MDDValvesStatesData.cpp \ + sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.cpp \ + sources/model/fp/data/MFPBoostPumpData.cpp \ + sources/model/fp/data/MFPConductivityData.cpp \ + sources/model/fp/data/MFPFlowData.cpp \ + sources/model/fp/data/MFPLevelData.cpp \ + sources/model/fp/data/MFPPressuresData.cpp \ + sources/model/fp/data/MFPROPumpData.cpp \ + sources/model/fp/data/MFPTemperatureData.cpp \ + sources/model/fp/data/MFPValvesStatesData.cpp \ sources/model/td/adjustment/settings/MAdjustTDSerialNumberResponse.cpp \ sources/model/td/adjustment/settings/MAdjustTDVersionsRequest.cpp \ sources/model/td/adjustment/settings/MAdjustTDVersionsResponse.cpp \ @@ -490,6 +523,14 @@ sources/view/dd/data/VDDPressuresData.cpp \ sources/view/dd/data/VDDTemperaturesData.cpp \ sources/view/dd/data/VDDValvesStatesData.cpp \ + sources/view/fp/data/VFPBoostPumpData.cpp \ + sources/view/fp/data/VFPConductivityData.cpp \ + sources/view/fp/data/VFPFlowData.cpp \ + sources/view/fp/data/VFPLevelData.cpp \ + sources/view/fp/data/VFPPressuresData.cpp \ + sources/view/fp/data/VFPROPumpData.cpp \ + sources/view/fp/data/VFPTemperatureData.cpp \ + sources/view/fp/data/VFPValvesStatesData.cpp \ sources/view/hd/data/post/VHDPOSTData.cpp \ sources/bluetooth/BluetoothInterface.cpp \ sources/cloudsync/CloudSyncController.cpp \ Index: leahi.qrc =================================================================== diff -u -r544066717110941fc0133c22d197fd50953e65d5 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- leahi.qrc (.../leahi.qrc) (revision 544066717110941fc0133c22d197fd50953e65d5) +++ leahi.qrc (.../leahi.qrc) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -41,6 +41,7 @@ sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml sources/gui/qml/dialogs/diagnostics/DiagnosticsTD.qml sources/gui/qml/dialogs/diagnostics/DiagnosticsDD.qml + sources/gui/qml/dialogs/diagnostics/DiagnosticsFP.qml sources/gui/qml/dialogs/headerbar/WiFiDialog.qml Index: sources/canbus/FrameInterface.cpp =================================================================== diff -u -rf2e4eba6e85c5d36537be782926f23cc9dc01037 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision f2e4eba6e85c5d36537be782926f23cc9dc01037) +++ sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -194,7 +194,7 @@ //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync case eChlid_DD_Alarm : case eChlid_DD_Sync : - //case eChlid_FP_UI : // Only in α, will be removed in ꞵ + //case eChlid_FP_UI : // has duplicate value as eChlid_FP_Sync, Only in α, will be removed in ꞵ case eChlid_FP_Alarm : // Only in α, will be removed in ꞵ case eChlid_FP_Sync : // Only in α, will be removed in ꞵ channelGroup = ChannelGroup::eChannel_Listens; Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r47b25a76644ca44b81b5a4a728346f8e72e1dc3b -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 47b25a76644ca44b81b5a4a728346f8e72e1dc3b) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -111,6 +111,15 @@ {Gui::GuiActionType::ID_DDLevelData , 3 * 4 }, // 3 parameters each 4bytes {Gui::GuiActionType::ID_DDGenDialysateData , 9 * 4 }, // 9 parameters each 4bytes {Gui::GuiActionType::ID_DDBloodLeakData , 1 * 4 }, // 1 parameters each 4bytes + //FP Data Messages + {Gui::GuiActionType::ID_FPValvesStatesData , 2 * 1 + 10 }, // 1 parameter 16bits & 10 parameters each 1 byte + {Gui::GuiActionType::ID_FPROPumpData , 9 * 4 }, // 9 parameters each 4bytes + {Gui::GuiActionType::ID_FPPressuresData , 9 * 4 }, // 9 parameters each 4bytes + {Gui::GuiActionType::ID_FPLevelData , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_FPFlowSensorData , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_FPConductivityData , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_FPTemperaturesData , 13 * 4 }, // 13 parameters each 4bytes + {Gui::GuiActionType::ID_FPROBoosterPumpData , 9 * 4 }, // 9 parameters each 4bytes // HD Data Messages {Gui::GuiActionType::ID_HDAccelerometerData , 9 * 4 }, // 9 parameters each 4bytes {Gui::GuiActionType::ID_HDSyringePumpData , 9 * 4 }, // 9 parameters each 4bytes @@ -244,6 +253,7 @@ {Gui::GuiActionType::ID_AdjustVersionsUIReq ,1+1+1+2+4 }, // variable length parameters {Gui::GuiActionType::ID_AdjustVersionsTDRsp ,3*1+2+4*1+4 }, // variable length parameters {Gui::GuiActionType::ID_AdjustVersionsDDRsp ,3*1+2+4*1+4 }, // variable length parameters + {Gui::GuiActionType::ID_AdjustVersionsFPRsp ,3*1+2+4*1+4 }, // variable length parameters {Gui::GuiActionType::ID_AdjustSerialTDRsp , 1 * 1 }, // minimum 1 parameter 1 byte {Gui::GuiActionType::ID_AdjustSerialDDRsp , 1 * 1 }, // minimum 1 parameter 1 byte // ---- @@ -354,6 +364,7 @@ // UI listens occasionally eChlid_DD_UI = eChlid_DD_Sync , ///< DD => UI + eChlid_FP_UI = eChlid_FP_Sync , ///< FP => UI eChlid_UI_DD = eChlid_UI_Sync , ///< UI => DD [Out] // Dialing channel has been requested by V&V team for CANBus testing Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r3c07dc803109f716937b692cb4a67a5324bb9ca3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 3c07dc803109f716937b692cb4a67a5324bb9ca3) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -307,14 +307,14 @@ return Can_Source::eCan_TD; case eChlid_DD_TD : + case eChlid_DD_FP : //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync case eChlid_DD_Alarm: case eChlid_DD_Sync : if (vText) *vText = "DD"; return Can_Source::eCan_DD; - case eChlid_DD_FP : - //case eChlid_FP_UI : + //case eChlid_FP_UI : // has duplicate value as eChlid_FP_Sync case eChlid_FP_Alarm: case eChlid_FP_Sync : if (vText) *vText = "FP"; @@ -357,18 +357,18 @@ return Can_Id::eChlid_UI_TD; //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync + case eChlid_DD_FP : case eChlid_DD_Alarm: case eChlid_DD_Sync : if (vText) *vText = "DD"; return Can_Id::eChlid_UI_DD; // FP is not designed to directly communicate with UI - //case eChlid_DD_FP : - //case eChlid_FP_UI : - //case eChlid_FP_Alarm: - //case eChlid_FP_Sync : - // if (vText) *vText = "FP"; - // return Can_Id::eChlid_UI_Sync; + //case eChlid_FP_UI : // has duplicate value as eChlid_FP_Sync + case eChlid_FP_Alarm: + case eChlid_FP_Sync : + if (vText) *vText = "FP"; + return Can_Id::eChlid_UI_Sync; case eDialin_TD : case eTD_Dialin : @@ -411,8 +411,9 @@ if ( ! gLogUnhandledOnly ) { switch (identifySource(vMessage.can_id)) { - case Can_Source::eCan_TD: ok = interpretMessage_HD(vMessage, vData); break; - case Can_Source::eCan_DD: ok = interpretMessage_DG(vMessage, vData); break; + case Can_Source::eCan_TD: ok = interpretMessage_TD(vMessage, vData); break; + case Can_Source::eCan_DD: ok = interpretMessage_DD(vMessage, vData); break; + case Can_Source::eCan_FP: ok = interpretMessage_FP(vMessage, vData); break; default : printUnhandled (vMessage ); break; // ok is false, the individual interpreters for ?HD/DG should not be called, and it should be done here. } } @@ -424,9 +425,9 @@ } /*! - * \brief MessageInterpreter::interpretMessage_HD + * \brief MessageInterpreter::interpretMessage_TD * \details This method will be called - * for received messages from HD to interpret the vMessage of type Message + * for received messages from TD to interpret the vMessage of type Message * to vData of type QVariantList which UI understands regarding the Can_Id. * \param vMessage - The complete message of type Message which needs to be interpreted. * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. @@ -436,7 +437,7 @@ * \return true if the message CANBus channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage_HD(const Message &vMessage, QVariantList &vData) +bool MessageInterpreter::interpretMessage_TD(const Message &vMessage, QVariantList &vData) { bool ok = false; vData.clear(); @@ -563,9 +564,9 @@ } /*! - * \brief MessageInterpreter::interpretMessage_DG + * \brief MessageInterpreter::interpretMessage_DD * \details This method will be called - * for received messages from DG to interpret the vMessage of type Message + * for received messages from DD to interpret the vMessage of type Message * to vData of type QVariantList which UI understands regarding the Can_Id. * \param vMessage - The complete message of type Message which needs to be interpreted. * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. @@ -575,7 +576,7 @@ * \return true if the message CANBus channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage_DG(const Message &vMessage, QVariantList &vData) +bool MessageInterpreter::interpretMessage_DD(const Message &vMessage, QVariantList &vData) { bool ok = false; vData.clear(); @@ -624,6 +625,48 @@ return ok; } +/*! + * \brief MessageInterpreter::interpretMessage_FP + * \details This method will be called + * for received messages from FP to interpret the vMessage of type Message + * to vData of type QVariantList which UI understands regarding the Can_Id. + * \param vMessage - The complete message of type Message which needs to be interpreted. + * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. + * \param vData - The values of QVariantList which is understandable for UI + * and has been extracted from hex values of the CANBus Message Payload + * in vMessage of type Message regarding each Message Id definition. + * \return true if the message CANBus channel is in the range which can be interpreted, false otherwise. + * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not + */ +bool MessageInterpreter::interpretMessage_FP(const Message &vMessage, QVariantList &vData) +{ + bool ok = false; + vData.clear(); + switch (vMessage.actionId) { // notice we are in receive mode + case Gui::GuiActionType::ID_Acknow : ok = true; /* TODO : implement notify<>() */ break; + LOG_APPED(QString("FP,CheckIn," + QVariant(vData).toStringList().join(','))); break; + + // FP data messages + case Gui::GuiActionType::ID_FPValvesStatesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPValvesStatesData ); break; + case Gui::GuiActionType::ID_FPROPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPROPumpData ); break; + case Gui::GuiActionType::ID_FPPressuresData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPPressuresData ); break; + case Gui::GuiActionType::ID_FPLevelData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPLevelData ); break; + case Gui::GuiActionType::ID_FPFlowSensorData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPFlowSensorData ); break; + case Gui::GuiActionType::ID_FPConductivityData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPConductivityData ); break; + case Gui::GuiActionType::ID_FPTemperaturesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPTemperaturesData ); break; + case Gui::GuiActionType::ID_FPROBoosterPumpData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_FPROBoosterPumpData ); break; + + // FP Response Messages + case Gui::GuiActionType::ID_AdjustVersionsFPRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustVersionsFPRsp ); break; + + // unhandled messages: these will only be logged as received message + // there has nothing been defined for these messages. + default : printUnhandled (vMessage ); break; + } + + return ok; +} + // ---------- ---------- Message handlers ---------- ---------- // // ---------- ---------- ---------- ---------- ---------- Debug ---------- ---------- ---------- ---------- ---------- // Index: sources/canbus/MessageInterpreter.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -62,8 +62,9 @@ void printUnhandled (const Message &vMessage ) const; - bool interpretMessage_HD (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - bool interpretMessage_DG (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool interpretMessage_TD (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool interpretMessage_DD (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool interpretMessage_FP (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; // ----- Debug bool canbusFaultCountData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r3c07dc803109f716937b692cb4a67a5324bb9ca3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 3c07dc803109f716937b692cb4a67a5324bb9ca3) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -115,6 +115,15 @@ #include "VDDGenDialysateData.h" #include "VDDLevelData.h" #include "VDDBloodLeakData.h" +// FP data +#include "VFPValvesStatesData.h" +#include "VFPROPumpData.h" +#include "VFPPressuresData.h" +#include "VFPLevelData.h" +#include "VFPFlowData.h" +#include "VFPConductivityData.h" +#include "VFPTemperatureData.h" +#include "VFPBoostPumpData.h" // ----- #include "VTreatmentCreate.h" // ----- In-Treatment Adjustments Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r47b25a76644ca44b81b5a4a728346f8e72e1dc3b -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 47b25a76644ca44b81b5a4a728346f8e72e1dc3b) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -100,6 +100,7 @@ ID_AdjustVersionsTDReq = 0x1500, // 21 // ID_TDVersionsRxq - TD Version request received //// ----- @LEAHIZED ID_AdjustVersionsTDRsp = 0x0E00, // 14 //// ----- @LEAHIZED ID_AdjustVersionsDDRsp = 0x0F00, // 15 //// ----- @LEAHIZED + ID_AdjustVersionsFPRsp = 0x5A00, // 90 //// ----- @LEAHIZED ID_AdjustSerialTDRsp = 0x5100, // 81 //// ----- @LEAHIZED ID_AdjustSerialDDRsp = 0x5200, // 82 //// ----- @LEAHIZED @@ -209,6 +210,16 @@ ID_DDGenDialysateData = 0x2F00, // 47 //// ----- @LEAHIZED ID_DDBloodLeakData = 0x6000, // 96 //// ----- TODO: Payload subject to change given FW implementation + // FP Data Messages + ID_FPValvesStatesData = 0x3100, // 49 //// ----- @LEAHIZED + ID_FPROPumpData = 0x3200, // 50 //// ----- @LEAHIZED + ID_FPPressuresData = 0x3400, // 52 //// ----- @LEAHIZED + ID_FPLevelData = 0x3500, // 53 //// ----- @LEAHIZED + ID_FPFlowSensorData = 0x3600, // 54 //// ----- @LEAHIZED + ID_FPConductivityData = 0x3700, // 55 //// ----- @LEAHIZED + ID_FPTemperaturesData = 0x3900, // 57 //// ----- @LEAHIZED + ID_FPROBoosterPumpData = 0x5000, // 80 //// ----- @LEAHIZED + // HD Data Messages ID_HDAccelerometerData = 0x3300, // 51 ID_HDSyringePumpData = 0x6900, // 105 @@ -389,6 +400,9 @@ Q_ENUM(DD_Disinfect_States) Q_ENUM(DD_Heat_UI_States) Q_ENUM(DD_Valves) + + #include "FPDefs.h" + Q_ENUM(FP_Valves) }; // to be able to use the enum as signal/slot parameter @@ -464,6 +478,9 @@ // DD Valves typedef GuiActions::DD_Valves GuiDDValves; + // FP Valves + typedef GuiActions::FP_Valves GuiFPValves; + typedef QMap GuiStringIndexMap; typedef QPair GuiStringIndexMapItem; typedef QMapIterator GuiStringIndexMapIterator; Index: sources/gui/qml/dialogs/diagnostics/DiagnosticsFP.qml =================================================================== diff -u --- sources/gui/qml/dialogs/diagnostics/DiagnosticsFP.qml (revision 0) +++ sources/gui/qml/dialogs/diagnostics/DiagnosticsFP.qml (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,281 @@ +/*! + * + * 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 DiagnosticsDialog.qml + * \author (last) Dara Navaei + * \date (last) 05-Mar-2024 + * \author (original) Behrouz NematiPour + * \date (original) 11-May-2021 + * + */ + +// Qt +import QtQuick 2.12 +// Project +import Gui.Actions 0.1 + +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" + +/*! + * \brief the post treatment prime stack screen + */ +DiagnosticsBase { id: _root + objectName: "_DiagnosticsFP" + + title: "Filtration & Purification" + + DebugDataColumn { id: _FPPressureColumn + textObjectName :"_FPPressureData" + title : qsTr(" Pressure ") + x: col(0) + y: row(0) + model: [ + vFPPressures.beforePresureRegulator .toFixed(2) , + vFPPressures.afterPressureRegulator .toFixed(2) , + vFPPressures.beforeInletConductivity .toFixed(2) , + vFPPressures.beforeROFilter .toFixed(2) , + vFPPressures.afterROFilter .toFixed(2) , + vFPPressures.beforeROPump .toFixed(2) , + vFPPressures.ROConcentrate .toFixed(2) , + vFPPressures.ROConcentrateDrop .toFixed(2) , + vFPPressures.drainDrop .toFixed(2) , + ] + label: [ + "M1 bRegPSI ", + "M3 aRegPSI ", + "P8 bInCond ", + "P13 bROFilter ", + "P17 aROFilter ", + "X1 bROPump ", + "X2 ROConc ", + "X3 dROConc ", + "X4 dDrain ", + ] + } + + DebugDataColumn { id: _FPValvesColumn + textObjectName :"_FPValvesData" + title : qsTr(" Valves ") + x: col(1.5) + y: row(0) + model: [ + Number(vFPValvesStates. M4Valve ) , + Number(vFPValvesStates. P39Valve) , + Number(vFPValvesStates. P6Valve ) , + Number(vFPValvesStates. P11Valve) , + Number(vFPValvesStates. P33Valve) , + Number(vFPValvesStates. P34Valve) , + Number(vFPValvesStates. P37Valve) , + Number(vFPValvesStates. M7Valve ) , + Number(vFPValvesStates. P20Valve) , + Number(vFPValvesStates. P43Valve) , + ] + label: [ + "M4 ", + "P39 ", + "P6 ", + "P11 ", + "P33 ", + "P34 ", + "P37 ", + "M7 ", + "P20 ", + "P43 ", + ] + } + + DebugDataColumn { id: _FPROPumpColumn + textObjectName :"_FPROPumpData" + title : qsTr(" RO Pump ") + x: col(3) + y: row(0) + model: [ + vFPROPump.pumpState , + vFPROPump.pumpDutyCycle , + vFPROPump.pumpFBDutyCycle , + vFPROPump.pumpSpeed .toFixed(2) , + vFPROPump.targetPressure .toFixed(2) , + vFPROPump.targetFlow .toFixed(2) , + vFPROPump.targetDutyCycle .toFixed(2) , + vFPROPump.pumpDutyCyclePct .toFixed(2) , + vFPROPump.pumpFBDutyCyclePct .toFixed(2) , + ] + label: [ + "P12 State ", + "P12 DC ", + "P12 FBDC ", + "P12 Spd ", + "P12 tPSI ", + "P12 tFlow ", + "P12 tDC ", + "P12 DCPct ", + "P12 FBDCPct ", + ] + } + + DebugDataColumn { id: _FPBoostPumpColumn + textObjectName :"_FPBoostPumpData" + title : qsTr(" Boost Pump ") + x: col(4.5) + y: row(0) + model: [ + vFPBoostPump.pumpState , + vFPBoostPump.pumpDutyCycle , + vFPBoostPump.pumpFBDutyCycle , + vFPBoostPump.pumpSpeed .toFixed(2) , + vFPBoostPump.targetPressure .toFixed(2) , + vFPBoostPump.targetFlow .toFixed(2) , + vFPBoostPump.targetDutyCycle .toFixed(2) , + vFPBoostPump.pumpDutyCyclePct .toFixed(2) , + vFPBoostPump.pumpFBDutyCyclePct .toFixed(2) , + ] + label: [ + "P40 State ", + "P40 DC ", + "P40 FBDC ", + "P40 Spd ", + "P40 tPSI ", + "P40 tFlow ", + "P40 tDC ", + "P40 DCPct ", + "P40 FBDCPct ", + ] + } + + DebugDataColumn { id: _FPTemperatureColumn + textObjectName :"_FPTemperatureData" + title : qsTr(" Temperature ") + x: col(6) + y: row(0) + model: [ + vFPTemperature.inletConductivityTemp .toFixed(2) , + vFPTemperature.outletConductivityTemp .toFixed(2) , + vFPTemperature.beforePressureRegulatorTemp .toFixed(2) , + vFPTemperature.afterPressureRegulatorTemp .toFixed(2) , + vFPTemperature.beforeInletConductivityTemp .toFixed(2) , + vFPTemperature.beforeROFilterTemp .toFixed(2) , + vFPTemperature.afterROFilterTemp .toFixed(2) , + vFPTemperature.beforeROPumpTemp .toFixed(2) , + vFPTemperature.ROConcentrateTemp .toFixed(2) , + vFPTemperature.ROConcentratePumpTemp .toFixed(2) , + vFPTemperature.drainDropTemp .toFixed(2) , + vFPTemperature.ROInletTemp .toFixed(2) , + vFPTemperature.ROOutletTemp .toFixed(2) , + ] + label: [ + "P10 inCond ", + "P19 outCond ", + "M1 bReg ", + "M3 aReg ", + "P8 bInCond ", + "P13 bRO ", + "P17 aRO ", + "X1 bROPump ", + "X2 ROConc ", + "X3 ROConcPump ", + "X4 Drain ", + "P7 ROIn ", + "P16 ROOut ", + ] + } + + DebugDataColumn { id: _FPFlowColumn + textObjectName :"_FPFlowData" + title : qsTr(" Flow ") + x: col(7.5) + y: row(0) + model: [ + vFPFlow.waterInletFlow .toFixed(2) , + vFPFlow.waterInletTemp .toFixed(2) , + vFPFlow.rOFilterOutletFlow .toFixed(2) , + vFPFlow.rOFilterOutletTemp .toFixed(2) , + ] + label: [ + "P7 FlowIn ", + "P7 TempIn ", + "P16 FlowOut ", + "P16 TempOut ", + ] + } + + DebugDataColumn { id: _FPConductivityColumn + textObjectName :"_FPConductivityData" + title : qsTr(" Conductivity ") + x: col(9) + y: row(0) + model: [ + vFPConductivity.P9Conductivity .toFixed(2) , + vFPConductivity.P18Conductivity .toFixed(2) , + ] + label: [ + "P9 ", + "P18 ", + ] + } + + DebugDataColumn { id: _FPLevelColumn + textObjectName :"_FPLevelData" + title : qsTr(" Level ") + x: col(9) + y: row(1) + model: [ + vFPLevel.P25FloaterLevel , + ] + label: [ + "P25 Floater ", + ] + } + + // TODO: The TouchRect should be unnecessary since the first communication message with UI/TD is the version. + TouchRect { + x : col(9.0) + y : row(8.0) + width : 425 + height : 80 + onClicked : vAdjustmentVersions.doAdjustment() + radius : 10 + Column { + anchors.top : parent.top + anchors.topMargin: -20 + anchors.left: parent.left + anchors.leftMargin: 5 + + spacing: -30 + + DebugDataColumn { id: _FPVersionsColumn + textObjectName :"_FPVersionsData" + title : "" + horizontalAlignmentText: Text.AlignLeft + fontPixelSizeText: Fonts.fontPixelDebugTitle + model: [ "FP: v%1.%2.%3-%4 v%5.%6.%7-%8 c%9" + .arg(vAdjustmentVersions.fpVerMajor ) + .arg(vAdjustmentVersions.fpVerMinor ) + .arg(vAdjustmentVersions.fpVerMicro ) + .arg(vAdjustmentVersions.fpVerBuild ) + .arg(vAdjustmentVersions.fpVerFPGAMajor ) + .arg(vAdjustmentVersions.fpVerFPGAMinor ) + .arg(vAdjustmentVersions.fpVerFPGALab ) + .arg(vAdjustmentVersions.fpVerFPGAId ) + .arg(vAdjustmentVersions.fpVerCompatibilityRev ) + ] + } + } + } + + + Connections { target: _GuiView + function onDidActionReceive( vAction, vData ) { + // DEBUG: console.debug("onDidActionReceive", vAction, vData) + if (vAction === GuiActions.ID_CANBusFaultCount ) { + _canbusFaultCountText.count = vData[0] + } + } + } +} Index: sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml =================================================================== diff -u -r3c07dc803109f716937b692cb4a67a5324bb9ca3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml (.../DiagnosticsSwipe.qml) (revision 3c07dc803109f716937b692cb4a67a5324bb9ca3) +++ sources/gui/qml/dialogs/diagnostics/DiagnosticsSwipe.qml (.../DiagnosticsSwipe.qml) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -33,7 +33,7 @@ DiagnosticsTD { id: tdPage } DiagnosticsDD { id: ddPage } - DiagnosticsBase { id: fpPage } + DiagnosticsFP { id: fpPage } } PageIndicator { id: indicator Index: sources/gui/qml/main.qml =================================================================== diff -u -r6d2d7392d9fbae0d24a79fabd0619d446025a946 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/gui/qml/main.qml (.../main.qml) (revision 6d2d7392d9fbae0d24a79fabd0619d446025a946) +++ sources/gui/qml/main.qml (.../main.qml) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -107,6 +107,15 @@ import VDDGenDialysate 0.1 import VDDLevel 0.1 import VDDBloodLeak 0.1 +// FP Data +import VFPValvesStates 0.1 +import VFPROPump 0.1 +import VFPPressures 0.1 +import VFPLevel 0.1 +import VFPFlow 0.1 +import VFPConductivity 0.1 +import VFPTemperature 0.1 +import VFPBoostPump 0.1 // In-Treatment - Adjustemnt import VTreatmentAdjustmentDuration 0.1 import VTreatmentAdjustmentFlows 0.1 @@ -215,7 +224,7 @@ VTreatmentRinseback { id: vTreatmentRinseback } VTreatmentRecirculate { id: vTreatmentRecirculate } VTreatmentStop { id: vTreatmentStop } - // ---- DG + // ---- DD VDGDrainPump { id: vDGDrainPump } VDDHeaters { id: vDDHeaters } VDGLoadCellReadings { id: vDGLoadCellReadings } @@ -232,6 +241,15 @@ VDDGenDialysate { id: vDDGenDialysate } VDDLevel { id: vDDLevel } VDDBloodLeak { id: vDDBloodLeak } + // --- FP Data + VFPValvesStates { id: vFPValvesStates } + VFPROPump { id: vFPROPump } + VFPPressures { id: vFPPressures } + VFPLevel { id: vFPLevel } + VFPFlow { id: vFPFlow } + VFPConductivity { id: vFPConductivity } + VFPTemperature { id: vFPTemperature } + VFPBoostPump { id: vFPBoostPump } // --- Pre-Treatment Progress Data VPreTreatmentAdjustmentInitTreatment { id: vPreTreatmentAdjustmentInitTreatment } VDGFilterFlush { id: vDGFilterFlush } Index: sources/model/MAbstract.h =================================================================== diff -u -ra58f91b077c8131bea3dbde0fc338adb113fc9f3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/model/MAbstract.h (.../MAbstract.h) (revision a58f91b077c8131bea3dbde0fc338adb113fc9f3) +++ sources/model/MAbstract.h (.../MAbstract.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -36,9 +36,9 @@ * The Models using for Denali Messaging depending on the Unit on the CANBus and the type of the messages categorized into : * * **Units on the CANBus :** - * | | | | - * |:-----:|:-----:|:---:| - * | UI | HD | DG | + * | | | | | + * |:-----:|:-----:|:---:|:---:| + * | UI | HD | DG | FP | * * **Type of messages known at the moment :** * | | | | | @@ -69,6 +69,7 @@ eUI, eTD, eDD, + eFP, eDV, }; @@ -90,6 +91,7 @@ {MAbstract::Unit_Enum::eUI, "UI"}, {MAbstract::Unit_Enum::eTD, "TD"}, {MAbstract::Unit_Enum::eDD, "DD"}, + {MAbstract::Unit_Enum::eFP, "FP"}, {MAbstract::Unit_Enum::eDV, "DV"} }; return map; Index: sources/model/MModel.h =================================================================== diff -u -r3c07dc803109f716937b692cb4a67a5324bb9ca3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/model/MModel.h (.../MModel.h) (revision 3c07dc803109f716937b692cb4a67a5324bb9ca3) +++ sources/model/MModel.h (.../MModel.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -87,6 +87,7 @@ #include "MAdjustTDVersionsRequest.h" #include "MAdjustTDVersionsResponse.h" #include "MAdjustDDVersionsResponse.h" +#include "MAdjustFPVersionsResponse.h" #include "MAdjustTDSerialNumberResponse.h" #include "MAdjustDDSerialNumberResponse.h" #include "MAdjustHDServiceModeResponse.h" @@ -115,6 +116,16 @@ #include "MDDLevelData.h" #include "MDDBloodLeakData.h" +// FP Data Messages +#include "MFPValvesStatesData.h" +#include "MFPROPumpData.h" +#include "MFPPressuresData.h" +#include "MFPLevelData.h" +#include "MFPFlowData.h" +#include "MFPConductivityData.h" +#include "MFPTemperatureData.h" +#include "MFPBoostPumpData.h" + // Pre-Treatment #include "MPreTreatmentAdjustRequests.h" #include "MPreTreatmentAdjustInitTreatmentResponse.h" @@ -236,8 +247,9 @@ * * 06 - In the MessageInterpreter add a line of handler in interpretMessage_ method * and put the enum and model. - * \sa MessageInterpreter::interpretMessage_HD - * \sa MessageInterpreter::interpretMessage_DG + * \sa MessageInterpreter::interpretMessage_TD + * \sa MessageInterpreter::interpretMessage_DD + * \sa MessageInterpreter::interpretMessage_FP * \sa MessageInterpreter.cpp * * View : @@ -382,6 +394,15 @@ REGISTER_METATYPE( DDGenDialysateData ) \ REGISTER_METATYPE( DDLevelData ) \ REGISTER_METATYPE( DDBloodLeakData ) \ + /* FP Data */ \ + REGISTER_METATYPE( FPValvesStatesData ) \ + REGISTER_METATYPE( FPROPumpData ) \ + REGISTER_METATYPE( FPPressuresData ) \ + REGISTER_METATYPE( FPLevelData ) \ + REGISTER_METATYPE( FPFlowData ) \ + REGISTER_METATYPE( FPConductivityData ) \ + REGISTER_METATYPE( FPTemperatureData ) \ + REGISTER_METATYPE( FPBoostPumpData ) \ \ REGISTER_METATYPE( HDDebugTextData ) \ REGISTER_METATYPE( DGDebugTextData ) \ @@ -474,6 +495,7 @@ REGISTER_METATYPE( AdjustVersionsTDRequestData ) \ REGISTER_METATYPE( AdjustVersionsTDResponseData ) \ REGISTER_METATYPE( AdjustVersionsDDResponseData ) \ + REGISTER_METATYPE( AdjustVersionsFPResponseData ) \ REGISTER_METATYPE( AdjustSerialNumberTDResponseData ) \ REGISTER_METATYPE( AdjustSerialNumberDDResponseData ) \ REGISTER_METATYPE( AdjustServiceModeResponseData ) \ @@ -575,6 +597,15 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DDGenDialysateData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DDLevelData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DDBloodLeakData ) \ + /* FP Data */ \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPValvesStatesData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPROPumpData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPPressuresData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPLevelData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPFlowData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPConductivityData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPTemperatureData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, FPBoostPumpData ) \ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, HDDebugTextData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGDebugTextData ) \ @@ -619,6 +650,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustVersionsTDRequestData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustVersionsTDResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustVersionsDDResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustVersionsFPResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustSerialNumberTDResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustSerialNumberDDResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustServiceModeResponseData ) \ @@ -782,6 +814,15 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( DDGenDialysateData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DDLevelData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DDBloodLeakData ) \ + /* FP Data */ \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPValvesStatesData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPROPumpData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPPressuresData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPLevelData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPFlowData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPConductivityData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPTemperatureData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( FPBoostPumpData ) \ \ ACTION_RECEIVE_BRIDGE_DEFINITION( HDDebugTextData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DGDebugTextData ) \ @@ -826,6 +867,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustVersionsTDRequestData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustVersionsTDResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustVersionsDDResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustVersionsFPResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustSerialNumberTDResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustSerialNumberDDResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustServiceModeResponseData ) \ @@ -1094,6 +1136,15 @@ ACTION_RECEIVE_SIGNAL( DDGenDialysateData ) \ ACTION_RECEIVE_SIGNAL( DDLevelData ) \ ACTION_RECEIVE_SIGNAL( DDBloodLeakData ) \ + /* FP Data */ \ + ACTION_RECEIVE_SIGNAL( FPValvesStatesData ) \ + ACTION_RECEIVE_SIGNAL( FPROPumpData ) \ + ACTION_RECEIVE_SIGNAL( FPPressuresData ) \ + ACTION_RECEIVE_SIGNAL( FPLevelData ) \ + ACTION_RECEIVE_SIGNAL( FPFlowData ) \ + ACTION_RECEIVE_SIGNAL( FPConductivityData ) \ + ACTION_RECEIVE_SIGNAL( FPTemperatureData ) \ + ACTION_RECEIVE_SIGNAL( FPBoostPumpData ) \ \ ACTION_RECEIVE_SIGNAL( HDDebugTextData ) \ ACTION_RECEIVE_SIGNAL( DGDebugTextData ) \ @@ -1138,6 +1189,7 @@ ACTION_RECEIVE_SIGNAL( AdjustVersionsTDRequestData ) \ ACTION_RECEIVE_SIGNAL( AdjustVersionsTDResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustVersionsDDResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustVersionsFPResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustSerialNumberTDResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustSerialNumberDDResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustServiceModeResponseData ) \ Index: sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.cpp =================================================================== diff -u --- sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.cpp (revision 0) +++ sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,65 @@ +/*! + * + * 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 MAdjustFPVersionsResponse.cpp + * \author (last) Michael Garthwaite + * \date (last) 28-Feb-2022 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 + * + */ +#include "MAdjustFPVersionsResponse.h" + +using namespace Model; + +QVariantList MAdjustVersionsFPResponse::parameters() const { + return { + _data.mMajor .value, + _data.mMinor .value, + _data.mMicro .value, + _data.mBuild .value, + _data.mFPGAId .value, + _data.mFPGAMajor .value, + _data.mFPGAMinor .value, + _data.mFPGALab .value, + _data.mCompatibilityRev .value, + }; +} + +bool MAdjustVersionsFPResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mMajor )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mMinor )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mMicro )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mBuild )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mFPGAId )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mFPGAMajor )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mFPGAMinor )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mFPGALab )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mCompatibilityRev )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false; +} + +AdjustVersionsFPResponseData MAdjustVersionsFPResponse::data() const { + Data data; + data.mMajor = _data.mMajor .value; + data.mMinor = _data.mMinor .value; + data.mMicro = _data.mMicro .value; + data.mBuild = _data.mBuild .value; + data.mFPGAId = _data.mFPGAId .value; + data.mFPGAMajor = _data.mFPGAMajor .value; + data.mFPGAMinor = _data.mFPGAMinor .value; + data.mFPGALab = _data.mFPGALab .value; + data.mCompatibilityRev = _data.mCompatibilityRev .value; + return data; +} Index: sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.h =================================================================== diff -u --- sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.h (revision 0) +++ sources/model/fp/adjustment/settings/MAdjustFPVersionsResponse.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,104 @@ +/*! + * + * 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 MAdjustFPVersionsResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 27-Jun-2022 + * \author (original) Behrouz NematiPour + * \date (original) 16-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustVersionsFPResponse class + * \details The FP versions data model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------: | + * | 0x5A00 | 0x102 | Rsp | Y | FP | All | FP Versions Data | + * + * | Payload || + * | || + * | #1:(U08) | \ref Data::mMajor | + * | #2:(U08) | \ref Data::mMinor | + * | #3:(U08) | \ref Data::mMicro | + * | #4:(U16) | \ref Data::mBuild | + * | #5:(U08) | \ref Data::mFPGAId | + * | #6:(U08) | \ref Data::mFPGAMajor | + * | #7:(U08) | \ref Data::mFPGAMinor | + * | #8:(U08) | \ref Data::mFPGALab | + * | #9:(U32) | \ref Data::mCompatibilty Rev | + * + * \sa Data + * \sa MAdjustVersionsFPResponse : FP Versions Response Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | FP | + * | infoText | Version | + * + */ +class MAdjustVersionsFPResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U08 mMajor ; + Types::U08 mMinor ; + Types::U08 mMicro ; + Types::U16 mBuild ; + Types::U08 mFPGAId ; + Types::U08 mFPGAMajor ; + Types::U08 mFPGAMinor ; + Types::U08 mFPGALab ; + Types::U32 mCompatibilityRev ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("VersionRsp") ; } + + struct Data { + quint8 mMajor = 0; /*!< FP Versions Major value of type quint8 extracted out */ + quint8 mMinor = 0; /*!< FP Versions Minor value of type quint8 extracted out */ + quint8 mMicro = 0; /*!< FP Versions Micro value of type quint8 extracted out */ + quint16 mBuild = 0; /*!< FP Versions Build value of type quint16 extracted out */ + quint8 mFPGAId = 0; /*!< FP Versions FPGA ID value of type quint8 extracted out */ + quint8 mFPGAMajor = 0; /*!< FP Versions FPGA Major value of type quint8 extracted out */ + quint8 mFPGAMinor = 0; /*!< FP Versions FPGA Minor value of type quint8 extracted out */ + quint8 mFPGALab = 0; /*!< FP Versions FPGA Lab value of type quint8 extracted out */ + quint32 mCompatibilityRev = 0; /*!< FP Compatibility Revision */ + }; + + MAdjustVersionsFPResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustVersionsFPResponse::Data AdjustVersionsFPResponseData; Index: sources/model/fp/data/MFPBoostPumpData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPBoostPumpData.cpp (revision 0) +++ sources/model/fp/data/MFPBoostPumpData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,70 @@ +/*! + * + * Copyright (c) 2020-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 MFPBoostPumpData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPBoostPumpData.h" + +using namespace Model; + +QVariantList MFPBoostPump::parameters() const { + return { + _data.mP40PumpState .value, + _data.mP40PumpDutyCycle .value, + _data.mP40PumpFBDutyCycle .value, + _data.mP40PumpSpeed .value, + _data.mP40TargetPressure .value, + _data.mP40TargetFlow .value, + _data.mP40TargetDutyCycle .value, + _data.mP40PumpDutyCyclePct .value, + _data.mP40PumpFBDutyCyclePct .value, + }; +} + +bool MFPBoostPump::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mP40PumpState )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40PumpDutyCycle )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40PumpFBDutyCycle )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40PumpSpeed )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40TargetPressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40TargetFlow )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40TargetDutyCycle )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40PumpDutyCyclePct )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP40PumpFBDutyCyclePct )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPBoostPump::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPBoostPump::Data MFPBoostPump::data() const { + Data data; + data.mP40PumpState = _data.mP40PumpState .value; + data.mP40PumpDutyCycle = _data.mP40PumpDutyCycle .value; + data.mP40PumpFBDutyCycle = _data.mP40PumpFBDutyCycle .value; + data.mP40PumpSpeed = _data.mP40PumpSpeed .value; + data.mP40TargetPressure = _data.mP40TargetPressure .value; + data.mP40TargetFlow = _data.mP40TargetFlow .value; + data.mP40TargetDutyCycle = _data.mP40TargetDutyCycle .value; + data.mP40PumpDutyCyclePct = _data.mP40PumpDutyCyclePct .value; + data.mP40PumpFBDutyCyclePct = _data.mP40PumpFBDutyCyclePct .value; + return data; +} Index: sources/model/fp/data/MFPBoostPumpData.h =================================================================== diff -u --- sources/model/fp/data/MFPBoostPumpData.h (revision 0) +++ sources/model/fp/data/MFPBoostPumpData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,103 @@ +/*! + * + * Copyright (c) 2020-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 MFPBoostPumpData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// PBoostject +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPBoostPump class + * \details The FP BoostPump data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x5000| 0x102 | 8 | 1 Hz | N | FP | All | FP BoostPump Data | + * + * | Payload || + * | || + * | #01:(U32) | \ref Data::mP40PumpState | + * | #02:(U32) | \ref Data::mP40PumpDutyCycle | + * | #03:(U32) | \ref Data::mP40PumpFBDutyCycle | + * | #04:(F32) | \ref Data::mP40PumpSpeed | + * | #05:(F32) | \ref Data::mP40TargetPressure | + * | #06:(F32) | \ref Data::mP40TargetFlow | + * | #07:(F32) | \ref Data::mP40TargetDutyCycle | + * | #08:(F32) | \ref Data::mP40PumpDutyCyclePct | + * | #09:(F32) | \ref Data::mP40PumpFBDutyCyclePct | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | BoostPump | + * + */ +class MFPBoostPump : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mP40PumpState ; ///< Boost pump current state. + Types::U32 mP40PumpDutyCycle ; ///< Boost pump duty cycle at driver level. + Types::U32 mP40PumpFBDutyCycle ; ///< Boost pump feedback duty cycle. + Types::F32 mP40PumpSpeed ; ///< Boost pump speed (RPM). + Types::F32 mP40TargetPressure ; ///< Boost pump target pressure for contBoostl. + Types::F32 mP40TargetFlow ; ///< Boost pump target flow ( in mL/min ) for contBoostl. + Types::F32 mP40TargetDutyCycle ; ///< Boost pump target duty cycle for open loop contBoostl + Types::F32 mP40PumpDutyCyclePct ; ///< Boost pump duty cycle as a percentage. + Types::F32 mP40PumpFBDutyCyclePct ; ///< Boost pump feedback duty cycle as a percentage. + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("BoostPump") ; } + + struct Data { + quint32 mP40PumpState = 0; ///< Boost pump current state. + quint32 mP40PumpDutyCycle = 0; ///< Boost pump duty cycle at driver level. + quint32 mP40PumpFBDutyCycle = 0; ///< Boost pump feedback duty cycle. + float mP40PumpSpeed = 0; ///< Boost pump speed (RPM). + float mP40TargetPressure = 0; ///< Boost pump target pressure for contBoostl. + float mP40TargetFlow = 0; ///< Boost pump target flow ( in mL/min ) for contBoostl. + float mP40TargetDutyCycle = 0; ///< Boost pump target duty cycle for open loop contBoostl + float mP40PumpDutyCyclePct = 0; ///< Boost pump duty cycle as a percentage. + float mP40PumpFBDutyCyclePct = 0; ///< Boost pump feedback duty cycle as a percentage. + }; + + MFPBoostPump () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPBoostPump::Data FPBoostPumpData; Index: sources/model/fp/data/MFPConductivityData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPConductivityData.cpp (revision 0) +++ sources/model/fp/data/MFPConductivityData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,49 @@ +/*! + * + * Copyright (c) 2020-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 MFPConductivityData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPConductivityData.h" + +using namespace Model; + +QVariantList MFPConductivity::parameters() const { + return { + _data.mP9Conductivity .value, + _data.mP18Conductivity .value, + }; +} + +bool MFPConductivity::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mP9Conductivity )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP18Conductivity )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPConductivity::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPConductivity::Data MFPConductivity::data() const { + Data data; + data.mP9Conductivity = _data.mP9Conductivity .value; + data.mP18Conductivity = _data.mP18Conductivity .value; + return data; +} Index: sources/model/fp/data/MFPConductivityData.h =================================================================== diff -u --- sources/model/fp/data/MFPConductivityData.h (revision 0) +++ sources/model/fp/data/MFPConductivityData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,82 @@ +/*! + * + * Copyright (c) 2020-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 MFPConductivityData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPConductivity class + * \details The FP Conductivity data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3700| 0x102 | 8 | 1 Hz | N | FP | All | FP Conductivity Data | + * + * | Payload || + * | || + * | #01:(F32) | \ref Data:: mP9Conductivity | + * | #02:(F32) | \ref Data:: mP18Conductivity | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | Conductivity | + * + */ +class MFPConductivity : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::F32 mP9Conductivity ; ///< (P9) conductivity sensor value + Types::F32 mP18Conductivity ; ///< (P9) conductivity sensor value + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("Conductivity") ; } + + struct Data { + float mP9Conductivity = 0; ///< (P9) conductivity sensor value + float mP18Conductivity = 0; ///< (P18) conductivity sensor value + }; + + MFPConductivity () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPConductivity::Data FPConductivityData; Index: sources/model/fp/data/MFPFlowData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPFlowData.cpp (revision 0) +++ sources/model/fp/data/MFPFlowData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,55 @@ +/*! + * + * Copyright (c) 2020-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 MFPFlowData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPFlowData.h" + +using namespace Model; + +QVariantList MFPFlow::parameters() const { + return { + _data.mP7Flow .value, + _data.mP16Flow .value, + _data.mP7Temp .value, + _data.mP16Temp .value, + }; +} + +bool MFPFlow::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mP7Flow )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP16Flow )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP7Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP16Temp )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPFlow::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPFlow::Data MFPFlow::data() const { + Data data; + data.mWaterInletFlow = _data.mP7Flow .value; + data.mROFilterOutletFlow = _data.mP16Flow .value; + data.mWaterInletTemp = _data.mP7Temp .value; + data.mROFilterOutletTemp = _data.mP16Temp .value; + return data; +} Index: sources/model/fp/data/MFPFlowData.h =================================================================== diff -u --- sources/model/fp/data/MFPFlowData.h (revision 0) +++ sources/model/fp/data/MFPFlowData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,88 @@ +/*! + * + * Copyright (c) 2020-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 MFPFlowData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPFlow class + * \details The FP Flow data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3600| 0x102 | 8 | 1 Hz | N | FP | All | FP Flow Data | + * + * | Payload || + * | || + * | #01:(F32) | \ref Data::mP7Flow | + * | #02:(F32) | \ref Data::mP16Flow | + * | #03:(F32) | \ref Data::mP7Temp | + * | #04:(F32) | \ref Data::mP16Temp | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | Flow | + * + */ +class MFPFlow : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::F32 mP7Flow ; ///< P7 flow rate at water inlet. + Types::F32 mP16Flow ; ///< P16 flow rate at RO filter outlet. + Types::F32 mP7Temp ; ///< P7 temperature from inlet flow sensor. + Types::F32 mP16Temp ; ///< P16 temperature from outlet flow sensor. + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("Flow") ; } + + struct Data { + float mWaterInletFlow = 0; ///< P7 flow rate at water inlet. + float mROFilterOutletFlow = 0; ///< P16 flow rate at RO filter outlet. + float mWaterInletTemp = 0; ///< P7 temperature from inlet flow sensor. + float mROFilterOutletTemp = 0; ///< P16 temperature from outlet flow sensor. + }; + + MFPFlow () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPFlow::Data FPFlowData; Index: sources/model/fp/data/MFPLevelData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPLevelData.cpp (revision 0) +++ sources/model/fp/data/MFPLevelData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,46 @@ +/*! + * + * Copyright (c) 2020-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 MFPLevelData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPLevelData.h" + +using namespace Model; + +QVariantList MFPLevel::parameters() const { + return { + _data.mP25FloaterLevel .value, + }; +} + +bool MFPLevel::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mP25FloaterLevel )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPLevel::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPLevel::Data MFPLevel::data() const { + Data data; + data.mP25FloaterLevel = _data.mP25FloaterLevel .value; + return data; +} Index: sources/model/fp/data/MFPLevelData.h =================================================================== diff -u --- sources/model/fp/data/MFPLevelData.h (revision 0) +++ sources/model/fp/data/MFPLevelData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,79 @@ +/*! + * + * Copyright (c) 2020-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 MFPLevelData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPLevel class + * \details The FP Level data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3500| 0x102 | 8 | 1 Hz | N | FP | All | FP Level Data | + * + * | Payload || + * | || + * | #01:(U32) | \ref Data::mP25FloaterLevel | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | Level | + * + */ +class MFPLevel : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mP25FloaterLevel ; ///< P25 level from floater sensor. + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("Level") ; } + + struct Data { + quint32 mP25FloaterLevel = 0; ///< P25 level from floater sensor. + }; + + MFPLevel () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPLevel::Data FPLevelData; Index: sources/model/fp/data/MFPPressuresData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPPressuresData.cpp (revision 0) +++ sources/model/fp/data/MFPPressuresData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,70 @@ +/*! + * + * Copyright (c) 2020-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 MFPPressuresData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPPressuresData.h" + +using namespace Model; + +QVariantList MFPPressures::parameters() const { + return { + _data.m1Pressure .value, + _data.m3Pressure .value, + _data.p8Pressure .value, + _data.p13Pressure .value, + _data.p17Pressure .value, + _data.x1Pressure .value, + _data.x2Pressure .value, + _data.x3Pressure .value, + _data.x4Pressure .value, + }; +} + +bool MFPPressures::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.m1Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.m3Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.p8Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.p13Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.p17Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.x1Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.x2Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.x3Pressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.x4Pressure )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPPressures::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPPressures::Data MFPPressures::data() const { + Data data; + data.mBeforePresureRegulator = _data.m1Pressure .value; + data.mAfterPressureRegulator = _data.m3Pressure .value; + data.mBeforeInletConductivity = _data.p8Pressure .value; + data.mBeforeROFilter = _data.p13Pressure .value; + data.mAfterROFilter = _data.p17Pressure .value; + data.mBeforeROPump = _data.x1Pressure .value; + data.mROConcentrate = _data.x2Pressure .value; + data.mROConcentrateDrop = _data.x3Pressure .value; + data.mDrainDrop = _data.x4Pressure .value; + return data; +} Index: sources/model/fp/data/MFPPressuresData.h =================================================================== diff -u --- sources/model/fp/data/MFPPressuresData.h (revision 0) +++ sources/model/fp/data/MFPPressuresData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,103 @@ +/*! + * + * Copyright (c) 2020-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 MFPPressuresData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPPressures class + * \details The FP pressures data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3400| 0x102 | 8 | 1 Hz | N | FP | All | FP Pressures Data | + * + * | Payload || + * | || + * | #01:(F32) | \ref Data::mBeforePresureRegulator | + * | #02:(F32) | \ref Data::mAfterPressureRegulator | + * | #03:(F32) | \ref Data::mBeforeInletConductivity | + * | #04:(F32) | \ref Data::mBeforeROFilter | + * | #05:(F32) | \ref Data::mAfterROFilter | + * | #06:(F32) | \ref Data::mBeforeROPump | + * | #07:(F32) | \ref Data::mROConcentrate | + * | #08:(F32) | \ref Data::mROConcentrateDrop | + * | #09:(F32) | \ref Data::mDrainDrop | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | Pressures | + * + */ +class MFPPressures : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::F32 m1Pressure ; ///< Pressure before pressure regulator (M1) + Types::F32 m3Pressure ; ///< Pressure after pressure regulator (M3) + Types::F32 p8Pressure ; ///< Pressure before inlet conductivity sensor (P8) + Types::F32 p13Pressure ; ///< Pressure before RO filter (P13) + Types::F32 p17Pressure ; ///< Pressure after RO filter (P17) + Types::F32 x1Pressure ; ///< Pressure before RO pump (X1) + Types::F32 x2Pressure ; ///< Pressure RO Concentrate + Types::F32 x3Pressure ; ///< Pressure RO Concentrate drop + Types::F32 x4Pressure ; ///< Pressure drain drop + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("Pressures"); } + + struct Data { + float mBeforePresureRegulator = 0; ///< Pressure before pressure regulator (M1) + float mAfterPressureRegulator = 0; ///< Pressure after pressure regulator (M3) + float mBeforeInletConductivity = 0; ///< Pressure before inlet conductivity sensor (P8) + float mBeforeROFilter = 0; ///< Pressure before RO filter (P13) + float mAfterROFilter = 0; ///< Pressure after RO filter (P17) + float mBeforeROPump = 0; ///< Pressure before RO pump (X1) + float mROConcentrate = 0; ///< Pressure RO Concentrate + float mROConcentrateDrop = 0; ///< Pressure RO Concentrate drop + float mDrainDrop = 0; ///< Pressure drain drop + }; + + MFPPressures () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPPressures::Data FPPressuresData; Index: sources/model/fp/data/MFPROPumpData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPROPumpData.cpp (revision 0) +++ sources/model/fp/data/MFPROPumpData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,70 @@ +/*! + * + * Copyright (c) 2020-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 MFPROPumpData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPROPumpData.h" + +using namespace Model; + +QVariantList MFPROPump::parameters() const { + return { + _data.mP12PumpState .value, + _data.mP12PumpDutyCycle .value, + _data.mP12PumpFBDutyCycle .value, + _data.mP12PumpSpeed .value, + _data.mP12TargetPressure .value, + _data.mP12TargetFlow .value, + _data.mP12TargetDutyCycle .value, + _data.mP12PumpDutyCyclePct .value, + _data.mP12PumpFBDutyCyclePct .value, + }; +} + +bool MFPROPump::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mP12PumpState )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12PumpDutyCycle )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12PumpFBDutyCycle )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12PumpSpeed )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12TargetPressure )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12TargetFlow )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12TargetDutyCycle )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12PumpDutyCyclePct )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP12PumpFBDutyCyclePct )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPROPump::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPROPump::Data MFPROPump::data() const { + Data data; + data.mP12PumpState = _data.mP12PumpState .value; + data.mP12PumpDutyCycle = _data.mP12PumpDutyCycle .value; + data.mP12PumpFBDutyCycle = _data.mP12PumpFBDutyCycle .value; + data.mP12PumpSpeed = _data.mP12PumpSpeed .value; + data.mP12TargetPressure = _data.mP12TargetPressure .value; + data.mP12TargetFlow = _data.mP12TargetFlow .value; + data.mP12TargetDutyCycle = _data.mP12TargetDutyCycle .value; + data.mP12PumpDutyCyclePct = _data.mP12PumpDutyCyclePct .value; + data.mP12PumpFBDutyCyclePct = _data.mP12PumpFBDutyCyclePct .value; + return data; +} Index: sources/model/fp/data/MFPROPumpData.h =================================================================== diff -u --- sources/model/fp/data/MFPROPumpData.h (revision 0) +++ sources/model/fp/data/MFPROPumpData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,103 @@ +/*! + * + * Copyright (c) 2020-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 MFPROPumpData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPROPump class + * \details The FP ROPump data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3200| 0x102 | 8 | 1 Hz | N | FP | All | FP ROPump Data | + * + * | Payload || + * | || + * | #01:(U32) | \ref Data::mP12PumpState | + * | #02:(U32) | \ref Data::mP12PumpDutyCycle | + * | #03:(U32) | \ref Data::mP12PumpFBDutyCycle | + * | #04:(F32) | \ref Data::mP12PumpSpeed | + * | #05:(F32) | \ref Data::mP12TargetPressure | + * | #06:(F32) | \ref Data::mP12TargetFlow | + * | #07:(F32) | \ref Data::mP12TargetDutyCycle | + * | #08:(F32) | \ref Data::mP12PumpDutyCyclePct | + * | #09:(F32) | \ref Data::mP12PumpFBDutyCyclePct | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | ROPump | + * + */ +class MFPROPump : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mP12PumpState ; ///< RO pump current state. + Types::U32 mP12PumpDutyCycle ; ///< RO pump duty cycle at driver level. + Types::U32 mP12PumpFBDutyCycle ; ///< RO pump feedback duty cycle. + Types::F32 mP12PumpSpeed ; ///< RO pump speed (RPM). + Types::F32 mP12TargetPressure ; ///< RO pump target pressure for control. + Types::F32 mP12TargetFlow ; ///< RO pump target flow ( in mL/min ) for control. + Types::F32 mP12TargetDutyCycle ; ///< RO pump target duty cycle for open loop control + Types::F32 mP12PumpDutyCyclePct ; ///< RO pump duty cycle as a percentage. + Types::F32 mP12PumpFBDutyCyclePct ; ///< RO pump feedback duty cycle as a percentage. + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("ROPump") ; } + + struct Data { + quint32 mP12PumpState = 0; ///< RO pump current state. + quint32 mP12PumpDutyCycle = 0; ///< RO pump duty cycle at driver level. + quint32 mP12PumpFBDutyCycle = 0; ///< RO pump feedback duty cycle. + float mP12PumpSpeed = 0; ///< RO pump speed (RPM). + float mP12TargetPressure = 0; ///< RO pump target pressure for control. + float mP12TargetFlow = 0; ///< RO pump target flow ( in mL/min ) for control. + float mP12TargetDutyCycle = 0; ///< RO pump target duty cycle for open loop control + float mP12PumpDutyCyclePct = 0; ///< RO pump duty cycle as a percentage. + float mP12PumpFBDutyCyclePct = 0; ///< RO pump feedback duty cycle as a percentage. + }; + + MFPROPump () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPROPump::Data FPROPumpData; Index: sources/model/fp/data/MFPTemperatureData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPTemperatureData.cpp (revision 0) +++ sources/model/fp/data/MFPTemperatureData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,82 @@ +/*! + * + * Copyright (c) 2020-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 MFPTemperatureData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPTemperatureData.h" + +using namespace Model; + +QVariantList MFPTemperature::parameters() const { + return { + _data.mP10Temp .value, + _data.mP19Temp .value, + _data.mM1Temp .value, + _data.mM3Temp .value, + _data.mP8Temp .value, + _data.mP13Temp .value, + _data.mP17Temp .value, + _data.mX1Temp .value, + _data.mX2Temp .value, + _data.mX3Temp .value, + _data.mX4Temp .value, + _data.mP7Temp .value, + _data.mP16Temp .value, + }; +} + +bool MFPTemperature::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mP10Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP19Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mM1Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mM3Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP8Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP13Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP17Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mX1Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mX2Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mX3Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mX4Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP7Temp )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mP16Temp )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPTemperature::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPTemperature::Data MFPTemperature::data() const { + Data data; + data.mInletConductivityTemp = _data.mP10Temp .value; + data.mOutletConductivityTemp = _data.mP19Temp .value; + data.mBeforePressureRegulatorTemp = _data.mM1Temp .value; + data.mAfterPressureRegulatorTemp = _data.mM3Temp .value; + data.mBeforeInletConductivityTemp = _data.mP8Temp .value; + data.mBeforeROFilterTemp = _data.mP13Temp .value; + data.mAfterROFilterTemp = _data.mP17Temp .value; + data.mBeforeROPumpTemp = _data.mX1Temp .value; + data.mROConcentrateTemp = _data.mX2Temp .value; + data.mROConcentratePumpTemp = _data.mX3Temp .value; + data.mDrainDropTemp = _data.mX4Temp .value; + data.mROInletTemp = _data.mP7Temp .value; + data.mROOutletTemp = _data.mP16Temp .value; + return data; +} Index: sources/model/fp/data/MFPTemperatureData.h =================================================================== diff -u --- sources/model/fp/data/MFPTemperatureData.h (revision 0) +++ sources/model/fp/data/MFPTemperatureData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,115 @@ +/*! + * + * Copyright (c) 2020-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 MFPTemperatureData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// PBoostject +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPTemperature class + * \details The FP Temperature data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3900| 0x102 | 8 | 1 Hz | N | FP | All | FP Temperature Data | + * + * | Payload || + * | || + * | #01:(U32) | \ref Data::mInletConductivityTemp | + * | #02:(U32) | \ref Data::mOutletConductivityTemp | + * | #03:(U32) | \ref Data::mBeforePressureRegulatorTemp | + * | #04:(F32) | \ref Data::mAfterPressureRegulatorTemp | + * | #05:(F32) | \ref Data::mBeforeInletConductivityTemp | + * | #06:(F32) | \ref Data::mBeforeROFilterTemp | + * | #07:(F32) | \ref Data::mAfterROFilterTemp | + * | #08:(F32) | \ref Data::mBeforeROPumpTemp | + * | #09:(F32) | \ref Data::mROConcentrateTemp | + * | #11:(F32) | \ref Data::mROConcentratePumpTemp | + * | #12:(F32) | \ref Data::mDrainDropTemp | + * | #13:(F32) | \ref Data::mROInletTemp | + * | #14:(F32) | \ref Data::mROOutletTemp | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | Temperature | + * + */ +class MFPTemperature : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::F32 mP10Temp ; ///< P10 temperature from inlet conductivity sensor. + Types::F32 mP19Temp ; ///< P19 temperature from outlet conductivity sensor. + Types::F32 mM1Temp ; ///< Temperature before pressure regulator (M1) + Types::F32 mM3Temp ; ///< Temperature after pressure regulator (M3) + Types::F32 mP8Temp ; ///< Temperature before inlet conductivity sensor (P8) + Types::F32 mP13Temp ; ///< Temperature before RO filter (P13) + Types::F32 mP17Temp ; ///< Temperature after RO filter (P17) + Types::F32 mX1Temp ; ///< Temperature before RO pump (X1) + Types::F32 mX2Temp ; ///< Temperature RO Concentrate + Types::F32 mX3Temp ; ///< Temperature RO Concentrate drop + Types::F32 mX4Temp ; ///< Temperature drain drop + Types::F32 mP7Temp ; ///< Temperature RO inlet + Types::F32 mP16Temp ; ///< Temperature RO outlet + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("Temperature") ; } + + struct Data { + float mInletConductivityTemp = 0; ///< P10 temperature from inlet conductivity sensor. + float mOutletConductivityTemp = 0; ///< P19 temperature from outlet conductivity sensor. + float mBeforePressureRegulatorTemp = 0; ///< Temperature before pressure regulator (M1) + float mAfterPressureRegulatorTemp = 0; ///< Temperature after pressure regulator (M3) + float mBeforeInletConductivityTemp = 0; ///< Temperature before inlet conductivity sensor (P8) + float mBeforeROFilterTemp = 0; ///< Temperature before RO filter (P13) + float mAfterROFilterTemp = 0; ///< Temperature after RO filter (P17) + float mBeforeROPumpTemp = 0; ///< Temperature before RO pump (X1) + float mROConcentrateTemp = 0; ///< Temperature RO Concentrate + float mROConcentratePumpTemp = 0; ///< Temperature RO Concentrate drop + float mDrainDropTemp = 0; ///< Temperature drain drop + float mROInletTemp = 0; ///< Temperature RO inlet + float mROOutletTemp = 0; ///< Temperature RO outlet + }; + + MFPTemperature () {} + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPTemperature::Data FPTemperatureData; Index: sources/model/fp/data/MFPValvesStatesData.cpp =================================================================== diff -u --- sources/model/fp/data/MFPValvesStatesData.cpp (revision 0) +++ sources/model/fp/data/MFPValvesStatesData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,78 @@ +/*! + * + * Copyright (c) 2020-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 MFPValvesStatesData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 28-Mar-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "MFPValvesStatesData.h" + +using namespace Model; + +QVariantList MFPValvesStates::parameters() const { + return { + _data.mValvesCmdStates .toString("") , + _data.mValvesSensedState1 .value , + _data.mValvesSensedState2 .value , + _data.mValvesSensedState3 .value , + _data.mValvesSensedState4 .value , + _data.mValvesSensedState5 .value , + _data.mValvesSensedState6 .value , + _data.mValvesSensedState7 .value , + _data.mValvesSensedState8 .value , + _data.mValvesSensedState9 .value , + _data.mValvesSensedState10 .value , + }; +} + + +bool MFPValvesStates::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetBits (vByteArray, index, _data.mValvesCmdStates , GuiFPValves::FP_NUM_OF_VALVES )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState1 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState2 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState3 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState4 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState5 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState6 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState7 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState8 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState9 )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mValvesSensedState10 )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MFPValvesStates::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +MFPValvesStates::Data MFPValvesStates::data() const { + Data data; + data.mValvesCmdStates = _data.mValvesCmdStates ; + data.mValvesSensedState1 = _data.mValvesSensedState1 .value; + data.mValvesSensedState2 = _data.mValvesSensedState2 .value; + data.mValvesSensedState3 = _data.mValvesSensedState3 .value; + data.mValvesSensedState4 = _data.mValvesSensedState4 .value; + data.mValvesSensedState5 = _data.mValvesSensedState5 .value; + data.mValvesSensedState6 = _data.mValvesSensedState6 .value; + data.mValvesSensedState7 = _data.mValvesSensedState7 .value; + data.mValvesSensedState8 = _data.mValvesSensedState8 .value; + data.mValvesSensedState9 = _data.mValvesSensedState9 .value; + data.mValvesSensedState10 = _data.mValvesSensedState10 .value; + return data; +} + Index: sources/model/fp/data/MFPValvesStatesData.h =================================================================== diff -u --- sources/model/fp/data/MFPValvesStatesData.h (revision 0) +++ sources/model/fp/data/MFPValvesStatesData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,107 @@ +/*! + * + * Copyright (c) 2020-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 MFPValvesStatesData.h + * \author (last) Behrouz NematiPour + * \date (last) 28-Mar-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MFPValvesStates class + * \details The FP valves states data model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x3100| 0x102 | 8 | 2 Hz | N | FP | All | FP Valves States Data | + * + * | Payload || + * | || + * | #01:(U16) | \ref Data::mValvesCmdStates | + * | #02:(U08) | \ref Data::mValvesSensedState1 | + * | #..:(U08) | \ref Data::mValvesSensedState.. | + * | #11:(U08) | \ref Data::mValvesSensedState10 | + * + * + * \sa Data + * \sa Flag + * + *

Logging info

+ * | || + * | || + * | typeText | Datum | + * | unitText | FP | + * | infoText | ValvesStates | + * + */ + +class MFPValvesStates : public MAbstract { + + // friends + friend class ::tst_models; + +private: + QVariantList parameters() const override; + + struct { + Types::Flags mValvesCmdStates ; // 16 bit Hydrolic Valves + Types::U08 mValvesSensedState1 ; + Types::U08 mValvesSensedState2 ; + Types::U08 mValvesSensedState3 ; + Types::U08 mValvesSensedState4 ; + Types::U08 mValvesSensedState5 ; + Types::U08 mValvesSensedState6 ; + Types::U08 mValvesSensedState7 ; + Types::U08 mValvesSensedState8 ; + Types::U08 mValvesSensedState9 ; + Types::U08 mValvesSensedState10 ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eDatum ; } + Unit_Enum unitText () const override { return Unit_Enum::eFP ; } + QString infoText () const override { return QString("ValvesStates"); } + + struct Data { + QBitArray mValvesCmdStates ; + quint8 mValvesSensedState1 = 0 ; + quint8 mValvesSensedState2 = 0 ; + quint8 mValvesSensedState3 = 0 ; + quint8 mValvesSensedState4 = 0 ; + quint8 mValvesSensedState5 = 0 ; + quint8 mValvesSensedState6 = 0 ; + quint8 mValvesSensedState7 = 0 ; + quint8 mValvesSensedState8 = 0 ; + quint8 mValvesSensedState9 = 0 ; + quint8 mValvesSensedState10 = 0 ; + }; + + MFPValvesStates () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MFPValvesStates::Data FPValvesStatesData; + Index: sources/view/VView.h =================================================================== diff -u -r3c07dc803109f716937b692cb4a67a5324bb9ca3 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/view/VView.h (.../VView.h) (revision 3c07dc803109f716937b692cb4a67a5324bb9ca3) +++ sources/view/VView.h (.../VView.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -179,7 +179,7 @@ REGISTER_TYPE( VTDSwitches ) \ REGISTER_TYPE( VTDEjector ) \ REGISTER_TYPE( VTDTemperature ) \ - /* DG - Data */ \ + /* DD - Data */ \ REGISTER_TYPE( VDGDrainPump ) \ REGISTER_TYPE( VDDHeaters ) \ REGISTER_TYPE( VDGLoadCellReadings ) \ @@ -196,6 +196,15 @@ REGISTER_TYPE( VDDGenDialysate ) \ REGISTER_TYPE( VDDLevel ) \ REGISTER_TYPE( VDDBloodLeak ) \ + /* FP - Data */ \ + REGISTER_TYPE( VFPValvesStates ) \ + REGISTER_TYPE( VFPROPump ) \ + REGISTER_TYPE( VFPPressures ) \ + REGISTER_TYPE( VFPLevel ) \ + REGISTER_TYPE( VFPFlow ) \ + REGISTER_TYPE( VFPConductivity ) \ + REGISTER_TYPE( VFPTemperature ) \ + REGISTER_TYPE( VFPBoostPump ) \ /* Pre-Treatment */ \ REGISTER_TYPE( VPreTreatmentAdjustmentInitTreatment ) \ REGISTER_TYPE( VDGFilterFlush ) \ Index: sources/view/fp/data/VFPBoostPumpData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPBoostPumpData.cpp (revision 0) +++ sources/view/fp/data/VFPBoostPumpData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,33 @@ +/*! + * + * Copyright (c) 2020-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 VFPBoostPumpData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPBoostPumpData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPBoostPump, FPBoostPumpData) + +void VFPBoostPump::onActionReceive(const FPBoostPumpData &vData) +{ + pumpState ( vData.mP40PumpState ); + pumpDutyCycle ( vData.mP40PumpDutyCycle ); + pumpFBDutyCycle ( vData.mP40PumpFBDutyCycle ); + pumpSpeed ( vData.mP40PumpSpeed ); + targetPressure ( vData.mP40TargetPressure ); + targetFlow ( vData.mP40TargetFlow ); + targetDutyCycle ( vData.mP40TargetDutyCycle ); + pumpDutyCyclePct ( vData.mP40PumpDutyCyclePct ); + pumpFBDutyCyclePct ( vData.mP40PumpFBDutyCyclePct ); +} Index: sources/view/fp/data/VFPBoostPumpData.h =================================================================== diff -u --- sources/view/fp/data/VFPBoostPumpData.h (revision 0) +++ sources/view/fp/data/VFPBoostPumpData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,51 @@ +/*! + * + * Copyright (c) 2020-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 VFPBoostPumpData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPBoostPumpData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPBoostPump class + * \details View for Model's Data representation. + * + * \sa Model::MFPBoostPump + * + */ +class VFPBoostPump : public QObject +{ + Q_OBJECT + + PROPERTY( quint32 , pumpState , 0) + PROPERTY( quint32 , pumpDutyCycle , 0) + PROPERTY( quint32 , pumpFBDutyCycle , 0) + PROPERTY( float , pumpSpeed , 0) + PROPERTY( float , targetPressure , 0) + PROPERTY( float , targetFlow , 0) + PROPERTY( float , targetDutyCycle , 0) + PROPERTY( float , pumpDutyCyclePct , 0) + PROPERTY( float , pumpFBDutyCyclePct , 0) + + VIEW_DEC(VFPBoostPump, FPBoostPumpData) +}; +} Index: sources/view/fp/data/VFPConductivityData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPConductivityData.cpp (revision 0) +++ sources/view/fp/data/VFPConductivityData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,26 @@ +/*! + * + * Copyright (c) 2020-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 VFPConductivityData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPConductivityData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPConductivity, FPConductivityData) + +void VFPConductivity::onActionReceive(const FPConductivityData &vData) +{ + P9Conductivity ( vData.mP9Conductivity ); + P18Conductivity ( vData.mP18Conductivity ); +} Index: sources/view/fp/data/VFPConductivityData.h =================================================================== diff -u --- sources/view/fp/data/VFPConductivityData.h (revision 0) +++ sources/view/fp/data/VFPConductivityData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,44 @@ +/*! + * + * Copyright (c) 2020-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 VFPConductivityData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPConductivityData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPConductivity class + * \details View for Model's Data representation. + * + * \sa Model::MFPConductivity + * + */ +class VFPConductivity : public QObject +{ + Q_OBJECT + + PROPERTY( float , P9Conductivity , 0) + PROPERTY( float , P18Conductivity , 0) + + VIEW_DEC(VFPConductivity, FPConductivityData) +}; +} Index: sources/view/fp/data/VFPFlowData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPFlowData.cpp (revision 0) +++ sources/view/fp/data/VFPFlowData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,28 @@ +/*! + * + * Copyright (c) 2020-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 VFPFlowData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPFlowData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPFlow, FPFlowData) + +void VFPFlow::onActionReceive(const FPFlowData &vData) +{ + waterInletFlow ( vData.mWaterInletFlow ); + rOFilterOutletFlow ( vData.mROFilterOutletFlow ); + waterInletTemp ( vData.mWaterInletTemp ); + rOFilterOutletTemp ( vData.mROFilterOutletTemp ); +} Index: sources/view/fp/data/VFPFlowData.h =================================================================== diff -u --- sources/view/fp/data/VFPFlowData.h (revision 0) +++ sources/view/fp/data/VFPFlowData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,46 @@ +/*! + * + * Copyright (c) 2020-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 VFPFlowData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPFlowData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPFlow class + * \details View for Model's Data representation. + * + * \sa Model::MFPFlow + * + */ +class VFPFlow : public QObject +{ + Q_OBJECT + + PROPERTY( float , waterInletFlow , 0) + PROPERTY( float , rOFilterOutletFlow , 0) + PROPERTY( float , waterInletTemp , 0) + PROPERTY( float , rOFilterOutletTemp , 0) + + VIEW_DEC(VFPFlow, FPFlowData) +}; +} Index: sources/view/fp/data/VFPLevelData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPLevelData.cpp (revision 0) +++ sources/view/fp/data/VFPLevelData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,25 @@ +/*! + * + * Copyright (c) 2020-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 VFPLevelData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPLevelData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPLevel, FPLevelData) + +void VFPLevel::onActionReceive(const FPLevelData &vData) +{ + P25FloaterLevel ( vData.mP25FloaterLevel ); +} Index: sources/view/fp/data/VFPLevelData.h =================================================================== diff -u --- sources/view/fp/data/VFPLevelData.h (revision 0) +++ sources/view/fp/data/VFPLevelData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,43 @@ +/*! + * + * Copyright (c) 2020-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 VFPLevelData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPLevelData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPLevel class + * \details View for Model's Data representation. + * + * \sa Model::MFPLevel + * + */ +class VFPLevel : public QObject +{ + Q_OBJECT + + PROPERTY( quint32 , P25FloaterLevel , 0) + + VIEW_DEC(VFPLevel, FPLevelData) +}; +} Index: sources/view/fp/data/VFPPressuresData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPPressuresData.cpp (revision 0) +++ sources/view/fp/data/VFPPressuresData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,33 @@ +/*! + * + * Copyright (c) 2020-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 VFPPressuresData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPPressuresData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPPressures, FPPressuresData) + +void VFPPressures::onActionReceive(const FPPressuresData &vData) +{ + beforePresureRegulator ( vData.mBeforePresureRegulator ); + afterPressureRegulator ( vData.mAfterPressureRegulator ); + beforeInletConductivity ( vData.mBeforeInletConductivity ); + beforeROFilter ( vData.mBeforeROFilter ); + afterROFilter ( vData.mAfterROFilter ); + beforeROPump ( vData.mBeforeROPump ); + ROConcentrate ( vData.mROConcentrate ); + ROConcentrateDrop ( vData.mROConcentrateDrop ); + drainDrop ( vData.mDrainDrop ); +} Index: sources/view/fp/data/VFPPressuresData.h =================================================================== diff -u --- sources/view/fp/data/VFPPressuresData.h (revision 0) +++ sources/view/fp/data/VFPPressuresData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,51 @@ +/*! + * + * Copyright (c) 2020-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 VFPPressuresData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPPressuresData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPPressures class + * \details View for Model's Data representation. + * + * \sa Model::MFPPressures + * + */ +class VFPPressures : public QObject +{ + Q_OBJECT + + PROPERTY( float , beforePresureRegulator , 0) + PROPERTY( float , afterPressureRegulator , 0) + PROPERTY( float , beforeInletConductivity , 0) + PROPERTY( float , beforeROFilter , 0) + PROPERTY( float , afterROFilter , 0) + PROPERTY( float , beforeROPump , 0) + PROPERTY( float , ROConcentrate , 0) + PROPERTY( float , ROConcentrateDrop , 0) + PROPERTY( float , drainDrop , 0) + + VIEW_DEC(VFPPressures, FPPressuresData) +}; +} Index: sources/view/fp/data/VFPROPumpData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPROPumpData.cpp (revision 0) +++ sources/view/fp/data/VFPROPumpData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,33 @@ +/*! + * + * Copyright (c) 2020-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 VFPROPumpData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPROPumpData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPROPump, FPROPumpData) + +void VFPROPump::onActionReceive(const FPROPumpData &vData) +{ + pumpState ( vData.mP12PumpState ); + pumpDutyCycle ( vData.mP12PumpDutyCycle ); + pumpFBDutyCycle ( vData.mP12PumpFBDutyCycle ); + pumpSpeed ( vData.mP12PumpSpeed ); + targetPressure ( vData.mP12TargetPressure ); + targetFlow ( vData.mP12TargetFlow ); + targetDutyCycle ( vData.mP12TargetDutyCycle ); + pumpDutyCyclePct ( vData.mP12PumpDutyCyclePct ); + pumpFBDutyCyclePct ( vData.mP12PumpFBDutyCyclePct ); +} Index: sources/view/fp/data/VFPROPumpData.h =================================================================== diff -u --- sources/view/fp/data/VFPROPumpData.h (revision 0) +++ sources/view/fp/data/VFPROPumpData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,51 @@ +/*! + * + * Copyright (c) 2020-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 VFPROPumpData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPROPumpData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPROPump class + * \details View for Model's Data representation. + * + * \sa Model::MFPROPump + * + */ +class VFPROPump : public QObject +{ + Q_OBJECT + + PROPERTY( quint32 , pumpState , 0) + PROPERTY( quint32 , pumpDutyCycle , 0) + PROPERTY( quint32 , pumpFBDutyCycle , 0) + PROPERTY( float , pumpSpeed , 0) + PROPERTY( float , targetPressure , 0) + PROPERTY( float , targetFlow , 0) + PROPERTY( float , targetDutyCycle , 0) + PROPERTY( float , pumpDutyCyclePct , 0) + PROPERTY( float , pumpFBDutyCyclePct , 0) + + VIEW_DEC(VFPROPump, FPROPumpData) +}; +} Index: sources/view/fp/data/VFPTemperatureData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPTemperatureData.cpp (revision 0) +++ sources/view/fp/data/VFPTemperatureData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,37 @@ +/*! + * + * Copyright (c) 2020-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 VFPTemperatureData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPTemperatureData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPTemperature, FPTemperatureData) + +void VFPTemperature::onActionReceive(const FPTemperatureData &vData) +{ + inletConductivityTemp ( vData.mInletConductivityTemp ); + outletConductivityTemp ( vData.mOutletConductivityTemp ); + beforePressureRegulatorTemp ( vData.mBeforePressureRegulatorTemp ); + afterPressureRegulatorTemp ( vData.mAfterPressureRegulatorTemp ); + beforeInletConductivityTemp ( vData.mBeforeInletConductivityTemp ); + beforeROFilterTemp ( vData.mBeforeROFilterTemp ); + afterROFilterTemp ( vData.mAfterROFilterTemp ); + beforeROPumpTemp ( vData.mBeforeROPumpTemp ); + ROConcentrateTemp ( vData.mROConcentrateTemp ); + ROConcentratePumpTemp ( vData.mROConcentratePumpTemp ); + drainDropTemp ( vData.mDrainDropTemp ); + ROInletTemp ( vData.mROInletTemp ); + ROOutletTemp ( vData.mROOutletTemp ); +} Index: sources/view/fp/data/VFPTemperatureData.h =================================================================== diff -u --- sources/view/fp/data/VFPTemperatureData.h (revision 0) +++ sources/view/fp/data/VFPTemperatureData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,55 @@ +/*! + * + * Copyright (c) 2020-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 VFPTemperatureData.h + * \author (last) Behrouz NematiPour + * \date (last) 10-Feb-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPTemperatureData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPTemperature class + * \details View for Model's Data representation. + * + * \sa Model::MFPTemperature + * + */ +class VFPTemperature : public QObject +{ + Q_OBJECT + + PROPERTY( float , inletConductivityTemp , 0) + PROPERTY( float , outletConductivityTemp , 0) + PROPERTY( float , beforePressureRegulatorTemp , 0) + PROPERTY( float , afterPressureRegulatorTemp , 0) + PROPERTY( float , beforeInletConductivityTemp , 0) + PROPERTY( float , beforeROFilterTemp , 0) + PROPERTY( float , afterROFilterTemp , 0) + PROPERTY( float , beforeROPumpTemp , 0) + PROPERTY( float , ROConcentrateTemp , 0) + PROPERTY( float , ROConcentratePumpTemp , 0) + PROPERTY( float , drainDropTemp , 0) + PROPERTY( float , ROInletTemp , 0) + PROPERTY( float , ROOutletTemp , 0) + + VIEW_DEC(VFPTemperature, FPTemperatureData) +}; +} Index: sources/view/fp/data/VFPValvesStatesData.cpp =================================================================== diff -u --- sources/view/fp/data/VFPValvesStatesData.cpp (revision 0) +++ sources/view/fp/data/VFPValvesStatesData.cpp (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,49 @@ +/*! + * + * Copyright (c) 2020-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 VFPValvesStatesData.cpp + * \author (last) Behrouz NematiPour + * \date (last) 28-Mar-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#include "VFPValvesStatesData.h" + +// Project +#include "GuiController.h" + +VIEW_DEF(VFPValvesStates, FPValvesStatesData) + +void VFPValvesStates::onActionReceive(const FPValvesStatesData &vData) +{ + M4Valve ( vData.mValvesCmdStates.at( GuiFPValves::M4_VALV )); // Start of Hydraulics valve group + P39Valve ( vData.mValvesCmdStates.at( GuiFPValves::P39_VALV )); + P6Valve ( vData.mValvesCmdStates.at( GuiFPValves::P6_VALV )); + P11Valve ( vData.mValvesCmdStates.at( GuiFPValves::P11_VALV )); + P33Valve ( vData.mValvesCmdStates.at( GuiFPValves::P33_VALV )); + P34Valve ( vData.mValvesCmdStates.at( GuiFPValves::P34_VALV )); + P37Valve ( vData.mValvesCmdStates.at( GuiFPValves::P37_VALV )); + M7Valve ( vData.mValvesCmdStates.at( GuiFPValves::M7_VALV )); + P20Valve ( vData.mValvesCmdStates.at( GuiFPValves::P20_VALV )); + P43Valve ( vData.mValvesCmdStates.at( GuiFPValves::P43_VALV )); + // 6 empty flags are here... // + + valvesSensedState1 ( vData.mValvesSensedState1 ); + valvesSensedState2 ( vData.mValvesSensedState2 ); + valvesSensedState3 ( vData.mValvesSensedState3 ); + valvesSensedState4 ( vData.mValvesSensedState4 ); + valvesSensedState5 ( vData.mValvesSensedState5 ); + valvesSensedState6 ( vData.mValvesSensedState6 ); + valvesSensedState7 ( vData.mValvesSensedState7 ); + valvesSensedState8 ( vData.mValvesSensedState8 ); + valvesSensedState9 ( vData.mValvesSensedState9 ); + valvesSensedState10 ( vData.mValvesSensedState10 ); + + // Trigger should be the last + refresh(true); +} Index: sources/view/fp/data/VFPValvesStatesData.h =================================================================== diff -u --- sources/view/fp/data/VFPValvesStatesData.h (revision 0) +++ sources/view/fp/data/VFPValvesStatesData.h (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -0,0 +1,67 @@ +/*! + * + * Copyright (c) 2020-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 VFPValvesStatesData.h + * \author (last) Behrouz NematiPour + * \date (last) 28-Mar-2023 + * \author (original) Behrouz NemaiPour + * \date (original) 02-Jul-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VView.h" +#include "MFPValvesStatesData.h" + +// namespace +namespace View { + +/*! + * \brief The VFPValvesStates class + * \details View for Model's Data representation. + * + * \sa Model::MFPValvesStates + * + */ +class VFPValvesStates : public QObject +{ + Q_OBJECT + + TRIGGER ( bool , refresh , false) + + PROPERTY( bool , M4Valve , 0 ) + PROPERTY( bool , P39Valve , 0 ) + PROPERTY( bool , P6Valve , 0 ) + PROPERTY( bool , P11Valve , 0 ) + PROPERTY( bool , P33Valve , 0 ) + PROPERTY( bool , P34Valve , 0 ) + PROPERTY( bool , P37Valve , 0 ) + PROPERTY( bool , M7Valve , 0 ) + PROPERTY( bool , P20Valve , 0 ) + PROPERTY( bool , P43Valve , 0 ) + + PROPERTY( quint8 , valvesSensedState1 , 0 ) + PROPERTY( quint8 , valvesSensedState2 , 0 ) + PROPERTY( quint8 , valvesSensedState3 , 0 ) + PROPERTY( quint8 , valvesSensedState4 , 0 ) + PROPERTY( quint8 , valvesSensedState5 , 0 ) + PROPERTY( quint8 , valvesSensedState6 , 0 ) + PROPERTY( quint8 , valvesSensedState7 , 0 ) + PROPERTY( quint8 , valvesSensedState8 , 0 ) + PROPERTY( quint8 , valvesSensedState9 , 0 ) + PROPERTY( quint8 , valvesSensedState10 , 0 ) + + VIEW_DEC(VFPValvesStates, FPValvesStatesData) +}; +} + + Index: sources/view/settings/VAdjustmentVersions.cpp =================================================================== diff -u -r8a8e17d51f3dc3f83ab7b284a4da1c9cabce59d2 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/view/settings/VAdjustmentVersions.cpp (.../VAdjustmentVersions.cpp) (revision 8a8e17d51f3dc3f83ab7b284a4da1c9cabce59d2) +++ sources/view/settings/VAdjustmentVersions.cpp (.../VAdjustmentVersions.cpp) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -27,6 +27,7 @@ ACTION_VIEW_CONNECTION( AdjustVersionsTDRequestData); ACTION_VIEW_CONNECTION(AdjustVersionsTDResponseData); ACTION_VIEW_CONNECTION(AdjustVersionsDDResponseData); + ACTION_VIEW_CONNECTION(AdjustVersionsFPResponseData); ACTION_VIEW_CONNECTION(AdjustSerialNumberTDResponseData); ACTION_VIEW_CONNECTION(AdjustSerialNumberDDResponseData); } @@ -101,6 +102,32 @@ adjustmentDD(true); // set here only because adjustment parent needs it, but TD Versions does not } +void VAdjustmentVersions::onActionReceive(const AdjustVersionsFPResponseData &vData) +{ + // FP versions data + fpVerMajor ( vData.mMajor ); + fpVerMinor ( vData.mMinor ); + fpVerMicro ( vData.mMicro ); + fpVerBuild ( vData.mBuild ); + fpVerFPGAId ( vData.mFPGAId ); + fpVerFPGAMajor ( vData.mFPGAMajor ); + fpVerFPGAMinor ( vData.mFPGAMinor ); + fpVerFPGALab ( vData.mFPGALab ); + fpVerCompatibilityRev ( vData.mCompatibilityRev ); + + fpVerDevice ( + _fpVerDeviceFormat + .arg ( vData.mMajor ) + .arg ( vData.mMinor ) + .arg ( vData.mMicro ) + .arg ( vData.mBuild ) + .arg ( vData.mCompatibilityRev )); + + // *** 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. *** + adjustmentFP(true); // set here only because adjustment parent needs it, but TD Versions does not +} + void VAdjustmentVersions::onActionReceive(const AdjustSerialNumberTDResponseData &vData) { tdSerial( vData.mSerialNumber ); Index: sources/view/settings/VAdjustmentVersions.h =================================================================== diff -u -r8a8e17d51f3dc3f83ab7b284a4da1c9cabce59d2 -rb80f8f84f21f86ad4c962a2c690447c572498e0b --- sources/view/settings/VAdjustmentVersions.h (.../VAdjustmentVersions.h) (revision 8a8e17d51f3dc3f83ab7b284a4da1c9cabce59d2) +++ sources/view/settings/VAdjustmentVersions.h (.../VAdjustmentVersions.h) (revision b80f8f84f21f86ad4c962a2c690447c572498e0b) @@ -22,6 +22,7 @@ #include "MAdjustTDVersionsRequest.h" #include "MAdjustTDVersionsResponse.h" #include "MAdjustDDVersionsResponse.h" +#include "MAdjustFPVersionsResponse.h" #include "MAdjustTDSerialNumberResponse.h" #include "MAdjustDDSerialNumberResponse.h" @@ -46,11 +47,14 @@ const QString _tdVerFPGAFormat = "%1.%2.%3.%4"; const QString _ddVerDeviceFormat = "%1.%2.%3.%4.%5"; const QString _ddVerFPGAFormat = "%1.%2.%3.%4"; + const QString _fpVerDeviceFormat = "%1.%2.%3.%4.%5"; + const QString _fpVerFPGAFormat = "%1.%2.%3.%4"; // 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 , adjustmentTD , 0) TRIGGER( bool , adjustmentDD , 0) + TRIGGER( bool , adjustmentFP , 0) // TD Versions data PROPERTY( quint8 , tdVerMajor , 0) @@ -74,17 +78,31 @@ PROPERTY( quint8 , ddVerFPGALab , 0) PROPERTY( quint32 , ddVerCompatibilityRev , 0) + // FP Versions data + PROPERTY( quint8 , fpVerMajor , 0) + PROPERTY( quint8 , fpVerMinor , 0) + PROPERTY( quint8 , fpVerMicro , 0) + PROPERTY( quint16 , fpVerBuild , 0) + PROPERTY( quint8 , fpVerFPGAId , 0) + PROPERTY( quint8 , fpVerFPGAMajor , 0) + PROPERTY( quint8 , fpVerFPGAMinor , 0) + PROPERTY( quint8 , fpVerFPGALab , 0) + PROPERTY( quint32 , fpVerCompatibilityRev , 0) + PROPERTY( QString , tdVerDevice ,"") PROPERTY( QString , tdVerFPGA ,"") PROPERTY( QString , tdSerial ,"") PROPERTY( QString , ddVerDevice ,"") PROPERTY( QString , ddVerFPGA ,"") PROPERTY( QString , ddSerial ,"") + PROPERTY( QString , fpVerDevice ,"") + PROPERTY( QString , fpVerFPGA ,"") VIEW_DEC_CLASS(VAdjustmentVersions) VIEW_DEC_SLOT ( AdjustVersionsTDRequestData) VIEW_DEC_SLOT (AdjustVersionsTDResponseData) VIEW_DEC_SLOT (AdjustVersionsDDResponseData) + VIEW_DEC_SLOT (AdjustVersionsFPResponseData) VIEW_DEC_SLOT (AdjustSerialNumberTDResponseData) VIEW_DEC_SLOT (AdjustSerialNumberDDResponseData)