Index: sources/gui/guiglobals.h =================================================================== diff -u -rc71deaab48699cffdf9db816dfac2778d79c2238 -radf89000bad1a50ec33114ea76d65621a1d351d5 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision c71deaab48699cffdf9db816dfac2778d79c2238) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision adf89000bad1a50ec33114ea76d65621a1d351d5) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file guiglobals.h - * \author (last) Peter Lucia - * \date (last) 25-Jun-2020 + * \author (last) Behrouz NematiPour + * \date (last) 25-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 28-Oct-2019 * @@ -20,7 +20,19 @@ // Project namespace Gui { - extern QQuickView *_viewer; + class MainView : public QQuickView { + Q_OBJECT + + bool event(QEvent* vEvent) override + { + emit eventSpy(vEvent); + return QQuickView::event(vEvent); + } + signals: + void eventSpy(QEvent* vEvent); + }; + extern MainView *_viewer; + class GuiActions { Q_GADGET @@ -35,64 +47,83 @@ * *** So it has to be converted, each time it is referenced. ***\n * *** Since an enum is a constant value, ***\n * *** There is no point in calculating it on each reference. ***\n - * *** Therefore it is preffered to keep them as constant values ***\n + * *** Therefore it is preferred to keep them as constant values ***\n * *** Exactly as it is going to be shown/used in denali messages ***\n * *** then it can be compared exactly the way it is with no conversion.***\n */ - enum GuiActionsType_Enum /*: quint16 QML doesn't support enum types */ { - // necessary to add CreateTreatment here? We're saving to filesystem, but what might we need to tell the HD - // when a new treatment is created? - Unknown = 0x0000, - PowerOff = 0x0100, - KeepAlive = 0x0700, - BloodFlow = 0x0500, - DialysateInletFlow = 0x0800, - DialysateOutletFlow = 0x0B00, - TreatmentTime = 0x0D00, - PowerOffBroadcast = 0x0E00, + enum GuiActionsType_Enum /* : quint16 QML doesn't support enum types */ { + ID_Unknown = 0x0000, + ID_CANBusFaultCount = 0x9909, - AlarmStatus = 0x0200, - AlarmTriggered = 0x0300, - AlarmCleared = 0x0400, - AlarmSilenceReq = 0x2F00, // 47 - Not implemented yet on FW side - AlarmSilenceRsp = 0x3000, // 48 - TODO: As per conversation with Sean this can be deleted. + ID_RawData = 0xFFFE, - CreateTreatmentReq = 0x3500, // 53 - Not implemented yet on FW side - CreateTreatmentRsp = 0x3600, // 54 - Not implemented yet on FW side + ID_Acknow = 0xFFFF, + ID_AcknowGeneric = 0x0000, //< Generic Acknowledgment is not a unique message ID and inherits its Id from the actual message. Zero is a placeholder - LoadCellReadings = 0x0C00, + ID_HDDebugText = 0xF1FF, + ID_DGDebugText = 0xF2FF, - PressureOcclusion = 0x0900, + ID_DGCheckIn = 0x0600, + ID_KeepAlive = 0x0700, - TemperatureSensors = 0x2D00, // 45 + ID_PowerOff = 0x0100, + ID_ShuttingDown = 0x0E00, + ID_TreatmentTime = 0x0D00, + ID_BloodFlow = 0x0500, + ID_DialysateInletFlow = 0x0800, + ID_DialysateOutletFlow = 0x0B00, + ID_TreatmentRanges = 0x1A00, // 26 + ID_PressureOcclusion = 0x0900, + ID_TreatmentStates = 0x0F00, // 15 + ID_Saline = 0x2F00, // 47 - AdjustBloodDialysateReq = 0x1700, // 23 - AdjustBloodDialysateRsp = 0x1800, // 24 + ID_AlarmStatus = 0x0200, + ID_AlarmTriggered = 0x0300, + ID_AlarmCleared = 0x0400, + ID_AlarmUserAckReq = 0x3F00, // 63 + ID_AlarmSilenceReq = 0x3200, // 50 - AdjustUltrafiltrationStateReq = 0x1000, // 16 - // AcknowGeneric : the response is the AcknowGeneric with the same msgID + ID_CreateTreatmentReq = 0x3500, // 53 + ID_CreateTreatmentRsp = 0x3600, // 54 + ID_StartTreatmentReq = 0x3800, // 56 + ID_StartTreatmentRsp = 0x3900, // 57 + ID_ConfirmTreatmentReq = 0x3A00, // 58 + ID_EndTreatmentReq = 0x3B00, // 59 + ID_EndTreatmentRsp = 0x3C00, // 60 - AdjustUltrafiltrationEditReq = 0x1100, // 17 - AdjustUltrafiltrationEditRsp = 0x1300, // 19 + ID_PrimingData = 0x3700, // 55 - AdjustUltrafiltrationConfirmReq = 0x1500, // 21 - AdjustUltrafiltrationConfirmRsp = 0x2E00, // 46 + ID_HDOperationModeData = 0x2500, // 37 - AdjustDurationReq = 0x1600, // 22 - AdjustDurationRsp = 0x1B00, // 27 + ID_DGROPumpData = 0x1F00, // 31 + ID_DGPressuresData = 0x2000, // 32 + ID_DGDrainPumpData = 0x2400, // 36 + ID_DGOperationModeData = 0x2700, // 39 + ID_DGReservoirData = 0x2800, // 40 + ID_DGValvesStatesData = 0x2A00, // 42 + ID_DGHeatersData = 0x2C00, // 44 + ID_DGLoadCellReadingsData = 0x0C00, // 12 + ID_DGTemperaturesData = 0x2D00, // 45 - TreatmentRanges = 0x1A00, // 26 + ID_AdjustBloodDialysateReq = 0x1700, // 23 + ID_AdjustBloodDialysateRsp = 0x1800, // 24 - TreatmentState = 0x0F00, // 15 + ID_AdjustUltrafiltrationStateReq = 0x1000, // 16 + // idAcknowGeneric : the response is the AcknowGeneric with the same msgID - CanBUSFaultCount = 0x9909, + ID_AdjustUltrafiltrationEditReq = 0x1100, // 17 + ID_AdjustUltrafiltrationEditRsp = 0x1300, // 19 - String = 0xFFFE, + ID_AdjustUltrafiltrationConfirmReq = 0x1500, // 21 + ID_AdjustUltrafiltrationConfirmRsp = 0x2E00, // 46 - Acknow = 0xFFFF, - AcknowGeneric = 0x0000, //< Generic Acknowledgment is not a unique message ID and inherits its Id from the actual message. Zero is a placeholder + ID_AdjustDurationReq = 0x1600, // 22 + ID_AdjustDurationRsp = 0x1B00, // 27 + ID_AdjustSalineReq = 0x1200, // 18 + ID_AdjustSalineRsp = 0x1400, // 20 + }; enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { @@ -109,6 +140,12 @@ Timeout = 0x01, }; + enum Saline_States { // FW currently doesn't have enum for Saline Bolus when provided better to be replaced. + SALINE_STOP_STATE = 0, ///< Saline is not delivered + SALINE_START_STATE , ///< Saline being Delivered + SALINE_DISABLE_STATE , ///< Saline cumulative volume delivery has reached the maximum + }; + Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) @@ -118,6 +155,16 @@ #include "MsgDefs.h" Q_ENUM(Request_Reject_Reasons) + + #include "HDDefs.h" + Q_ENUM(HD_Op_Modes) + Q_ENUM(UF_Adjustments) + Q_ENUM(Treatment_States) + Q_ENUM(UF_States) + Q_ENUM(Saline_States) + + #include "DGDefs.h" + Q_ENUM(DG_Op_Modes) }; // to be able to use the enum as signal/slot parameter @@ -129,6 +176,14 @@ typedef GuiActions::Request_Reject_Reasons GuiRequestReasons; + typedef GuiActions::HD_Op_Modes GuiHDOpModes; + typedef GuiActions::DG_Op_Modes GuiDGOpModes; + + typedef GuiActions::UF_Adjustments GuiUFAdjustment; + typedef GuiActions::Treatment_States GuiTreatment_States; + typedef GuiActions::UF_States GuiUFStates; + typedef GuiActions::Saline_States GuiSalineStates; + void registerTypes(); void registerQmlTypes();