Index: sources/gui/guiglobals.h =================================================================== diff -u -rf623529d6ec25b555f3ac2248d71fc2b5e7063d6 -rfeb3423b373dc2a2c4267ef9fcb4d924d738423d --- sources/gui/guiglobals.h (.../guiglobals.h) (revision f623529d6ec25b555f3ac2248d71fc2b5e7063d6) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision feb3423b373dc2a2c4267ef9fcb4d924d738423d) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. * copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, @@ -22,7 +22,129 @@ namespace Gui { extern QQuickView *_viewer; + class GuiActions + { + Q_GADGET + explicit GuiActions(); + + public: + enum /*class*/ GuiActionsType_Enum /*: quint16 QML doesn't support enum types */ { + Unknown = 0x0000, + PowerOff = 0x0100, + KeepAlive = 0x0700, + BloodFlow = 0x0500, + DialysateFlow = 0x0800, + + AlarmStatus = 0x0200, + AlarmTriggered = 0x0300, + AlarmCleared = 0x0400, + + String = 0xFFFF, + }; + + enum class GuiActionsIndx_Enum { + // ---- PowerOff + PowerOff_ShowHide = 0 , + PowerOff_Response = 0 , + + // ---- BloodFlow + BloodFlow_FlowSetPoint = 0 , + BloodFlow_MeasuredFlow , + BloodFlow_RotorSpeed , + BloodFlow_MotorSpeed , + BloodFlow_MotorCtlSpeed , + BloodFlow_MotorCtlCurrent , + BloodFlow_PWMDtCycle , + + // ---- DialysateFlow + DialysateFlow_FlowSetPoint = 0 , + DialysateFlow_MeasuredFlow , + DialysateFlow_RotorSpeed , + DialysateFlow_MotorSpeed , + DialysateFlow_MotorCtlSpeed , + DialysateFlow_MotorCtlCurrent , + DialysateFlow_PWMDtCycle , + + // ---- AlarmStatus + AlarmStatus_Priority = 0 , + AlarmStatus_AlarmID , + AlarmStatus_EscalateIn , + AlarmStatus_MuteTimeout , + AlarmStatus_Flag_systemFault , + AlarmStatus_Flag_stop , + AlarmStatus_Flag_noClear , + AlarmStatus_Flag_noResume , + AlarmStatus_Flag_noRinseback , + AlarmStatus_Flag_noEndTreatment , + AlarmStatus_Flag_noNewTreatment , + AlarmStatus_Flag_bypassDialyzer , + AlarmStatus_Flag_alarmsToEscalate , + AlarmStatus_Flag_alarmsSilenced , + }; + + enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { + NoData = 0x00, + + Command = 0x00, // HD=>UI : should be handled in receive + Request = 0x00, // UI=>HD : should be handled in transmit + + // Power-Off Data // UI=>HD : should be handled in transmit + Accepted = 0x01, + Rejected = 0x02, + + // Power-Off Data // HD=>UI : should be handled in receive + Timeout = 0x01, + }; + + enum GuiAlarmPriority_Enum { + AlarmPriority_None = 0 , + AlarmPriority_Low , + AlarmPriority_Medium , + AlarmPriority_High , + }; + + enum GuiAlarmID_Enum { + No_Alarm = 0 , + Software_Fault , + Stuck_Button_Test_Failed , + FPGA_Post_Test_Failed , + Watchdog_Post_Test_Failed , + UI_Comm_Post_Failed , // 5 + Blood_pump_Mc_Current_Check , + Blood_Pump_Mc_Speed_Check , + Blood_Pump_Mc_Direction_Check , + Blood_Pump_Rotor_Speed_Check , + Dial_In_pump_Mc_Current_Check , // 10 + Dial_In_pump_Mc_Speed_Check , + Dial_In_pump_Mc_Direction_Check , + Dial_In_pump_Rotor_Speed_Check , + Dial_Out_Pump_Mc_Current_Check , + Dial_Out_Pump_Mc_Speed_Check , // 15 + Dial_Out_Pump_Mc_Direction_Check , + Dial_Out_Pump_Rotor_Speed_Check , + Watchdog_Expired , + Num_Of_Alarm_IDs , + }; + + + Q_ENUM(GuiActionsType_Enum) + Q_ENUM(GuiActionsData_Enum) + Q_ENUM(GuiActionsIndx_Enum) + + Q_ENUM(GuiAlarmPriority_Enum) + Q_ENUM(GuiAlarmID_Enum) + }; + + // to be able to use the enum as signal/slot parameter + typedef GuiActions::GuiActionsType_Enum GuiActionType; + typedef GuiActions::GuiActionsData_Enum GuiActionData; + typedef GuiActions::GuiActionsIndx_Enum GuiActionIndx; + + typedef GuiActions::GuiAlarmPriority_Enum GuiAlarmPriority; + typedef GuiActions::GuiAlarmID_Enum GuiAlarmID; + void registerTypes(); void registerQmlTypes(); + void startGui(); }