Index: sources/canbus/messageglobals.h =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -radf89000bad1a50ec33114ea76d65621a1d351d5 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision adf89000bad1a50ec33114ea76d65621a1d351d5) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file messageglobals.h - * \author (last) Peter Lucia - * \date (last) 25-Jun-2020 + * \author (last) Behrouz NematiPour + * \date (last) 20-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 06-Dec-2019 * @@ -44,54 +44,87 @@ */ const QHash payloadLen { // ---- - {Gui::GuiActionType::PowerOff , 1 }, - {Gui::GuiActionType::PowerOffBroadcast , 0 }, - {Gui::GuiActionType::KeepAlive , 255 }, // 0 => 255 to be able to run a multi-frame test. - {Gui::GuiActionType::BloodFlow , 7 * 4 }, // 7 parameters each 4bytes - {Gui::GuiActionType::DialysateInletFlow , 7 * 4 }, // 7 parameters each 4bytes - {Gui::GuiActionType::DialysateOutletFlow , 7 * 4 }, // 7 parameters each 4bytes - {Gui::GuiActionType::TreatmentTime , 3 * 4 }, // 3 parameters each 4bytes - {Gui::GuiActionType::PressureOcclusion , 5 * 4 }, // 5 parameters each 4bytes - {Gui::GuiActionType::AlarmSilenceReq , 5 * 4 }, // 5 parameters each 4bytes - {Gui::GuiActionType::AlarmSilenceRsp , 5 * 4 }, // 5 parameters each 4bytes - {Gui::GuiActionType::LoadCellReadings , 4 * 4 }, // 4 parameters each 4bytes - {Gui::GuiActionType::TemperatureSensors , 12 * 4 }, // 12 parameters each 4bytes + {Gui::GuiActionType::ID_PowerOff , 1 }, + {Gui::GuiActionType::ID_ShuttingDown , 0 }, + {Gui::GuiActionType::ID_KeepAlive , 255 }, // 0 => 255 to be able to run a multi-frame test. + // ----- + {Gui::GuiActionType::ID_TreatmentTime , 3 * 4 }, // 3 parameters each 4bytes + {Gui::GuiActionType::ID_BloodFlow , 7 * 4 }, // 7 parameters each 4bytes + {Gui::GuiActionType::ID_DialysateInletFlow , 7 * 4 }, // 7 parameters each 4bytes + {Gui::GuiActionType::ID_DialysateOutletFlow , 7 * 4 }, // 7 parameters each 4bytes + {Gui::GuiActionType::ID_PressureOcclusion , 5 * 4 }, // 5 parameters each 4bytes + {Gui::GuiActionType::ID_Saline , 3 * 4 }, // 3 parameters each 4bytes + // ---- - {Gui::GuiActionType::AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes + {Gui::GuiActionType::ID_HDOperationModeData , 1 * 4 }, // 1 parameter each 4bytes // ---- - {Gui::GuiActionType::TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes + {Gui::GuiActionType::ID_DGROPumpData , 3 * 4 }, // 3 parameters each 4bytes + {Gui::GuiActionType::ID_DGPressuresData , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_DGDrainPumpData , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_DGOperationModeData , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_DGReservoirData , 3 * 4 }, // 3 parameters each 4bytes + {Gui::GuiActionType::ID_DGValvesStatesData , 1 * 2 }, // 1 parameters each 2bytes + {Gui::GuiActionType::ID_DGHeatersData , 3 * 4 }, // 3 parameters each 4bytes + {Gui::GuiActionType::ID_DGLoadCellReadingsData , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_DGTemperaturesData , 12 * 4 }, // 12 parameters each 4bytes // ---- - {Gui::GuiActionType::AdjustBloodDialysateReq , 2 * 4 }, // 2 parameters each 4bytes - {Gui::GuiActionType::AdjustBloodDialysateRsp , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes + {Gui::GuiActionType::ID_AlarmTriggered , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AlarmCleared , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AlarmSilenceReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AlarmUserAckReq , 1 * 4 }, // 1 parameter each 4bytes // ---- - {Gui::GuiActionType::AdjustDurationReq , 1 * 4 }, // 1 parameters each 4bytes - {Gui::GuiActionType::AdjustDurationRsp , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::ID_StartTreatmentReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_StartTreatmentRsp , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_ConfirmTreatmentReq , 0 }, + {Gui::GuiActionType::ID_EndTreatmentReq , 0 }, // ---- - {Gui::GuiActionType::AdjustUltrafiltrationStateReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::ID_TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes + {Gui::GuiActionType::ID_TreatmentStates , 3 * 4 }, // 3 parameters each 4bytes // ---- - {Gui::GuiActionType::AdjustUltrafiltrationEditReq , 1 * 4 }, // 1 parameters each 4bytes - {Gui::GuiActionType::AdjustUltrafiltrationEditRsp , 8 * 4 }, // 8 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustBloodDialysateReq , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustBloodDialysateRsp , 4 * 4 }, // 4 parameters each 4bytes // ---- - {Gui::GuiActionType::AdjustUltrafiltrationConfirmReq , 2 * 4 }, // 2 parameters each 4bytes - {Gui::GuiActionType::AdjustUltrafiltrationConfirmRsp , 5 * 4 }, + {Gui::GuiActionType::ID_AdjustDurationReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustDurationRsp , 4 * 4 }, // 4 parameters each 4bytes + // ---- + {Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq , 1 * 4 }, // 1 parameter each 4bytes + + // ---- + {Gui::GuiActionType::ID_AdjustUltrafiltrationEditReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp , 8 * 4 }, // 8 parameters each 4bytes + // --- - {Gui::GuiActionType::CreateTreatmentReq , 17 * 4 }, // 17 parameters, each 4 bytes - {Gui::GuiActionType::CreateTreatmentRsp , 18 * 4 }, // 18 parameters, each 4 bytes + {Gui::GuiActionType::ID_CreateTreatmentReq , 17 * 4 }, // 17 parameters, each 4 bytes + {Gui::GuiActionType::ID_CreateTreatmentRsp , 18 * 4 }, // 18 parameters, each 4 bytes // ---- - {Gui::GuiActionType::CanBUSFaultCount , 1 }, - {Gui::GuiActionType::String , 255 }, - {Gui::GuiActionType::Acknow , 0 }, - {Gui::GuiActionType::AcknowGeneric , 1 }, + {Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmReq , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp , 5 * 4 }, + // ---- + {Gui::GuiActionType::ID_PrimingData , 3 * 4 }, // 3 parameters each 4bytes + // ---- + {Gui::GuiActionType::ID_AdjustSalineReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustSalineRsp , 3 * 4 }, // 3 parameters each 4bytes + + // ---- + {Gui::GuiActionType::ID_CANBusFaultCount , 1 }, + {Gui::GuiActionType::ID_RawData , 255 }, + {Gui::GuiActionType::ID_Acknow , 0 }, + {Gui::GuiActionType::ID_AcknowGeneric , 1 }, + + {Gui::GuiActionType::ID_HDDebugText , 40 + 1 }, // ASCII text - 40 bytes + null term + {Gui::GuiActionType::ID_DGDebugText , 40 + 1 }, // ASCII text - 40 bytes + null term + }; /*! @@ -151,7 +184,7 @@ eChlid_UI_HD = 0x100, ///< UI => HD [Out] // UI lessens occasionally - eChlid_DG_UI = eChlid_DG_Alarm, ///< No direct channel has been defined between DG&UI, May be required for logging + eChlid_DG_UI = 0x070, ///< DG => UI eChlid_UI_DG = eChlid_UI_Sync , ///< No direct channel has been defined between DG&UI, May be required for logging }; @@ -162,7 +195,7 @@ struct Message { // TODO : Should be converted to MessageModel class // no time left for now !!! Can_Id can_id; Sequence sequence = 0; // seq 0 is invalid - Gui::GuiActionType actionId = Gui::GuiActionType::Unknown; + Gui::GuiActionType actionId = Gui::GuiActionType::ID_Unknown; int length = 0; QByteArray head; QByteArray data; @@ -172,22 +205,21 @@ // coco begin validated:Has been validated manually. // Since the crc is part of the data and there is no message without crc // initialized flag and data.length() == 0 became the same. - // I preffer too keep it as it is so the initialization would be independent of the data. + // It's been preferred too keep it as it is so the initialization would be independent of the data. return !initialized || !data.length(); // coco end } bool isComplete() { // coco begin validated:Has been validated manually. // Since the crc is part of the data and there is no message without crc // then a message would never be empty. - // I preffer too keep it as it is so the initialization would be independent of the data. + // I prefer too keep it as it is so the initialization would be independent of the data. return !isEmpty() && data.length() == length; // coco end } }; typedef QList MessageList; typedef QList FrameList; - }