Index: sources/gui/guiglobals.h =================================================================== diff -u -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d -rd07ec81c7002ed2ac60c1dfc3101fb820e88211c --- sources/gui/guiglobals.h (.../guiglobals.h) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision d07ec81c7002ed2ac60c1dfc3101fb820e88211c) @@ -20,6 +20,8 @@ // Qt #include +// Project + namespace Gui { extern QQuickView *_viewer; class GuiActions @@ -28,8 +30,21 @@ explicit GuiActions(); public: - enum /*class*/ GuiActionsType_Enum /*: quint16 QML doesn't support enum types */ { + /*! + * \brief The GuiActionsType_Enum enum + * \details + * *** This enum could use the Msg_IDs enum in MsgDefs.h, ***\n + * *** But that enum has values in BigEndian ***\n + * *** So it has to be converted each time it is refferenced. ***\n + * *** Since an enum is a constant value, ***\n + * *** I don't see any point in calculating it on each reference. ***\n + * *** Therefore I preffered to keep them as constant values ***\n + * *** Exactly as it is goint to be shown 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 */ { Unknown = 0x0000, + PowerOff = 0x0100, KeepAlive = 0x0700, BloodFlow = 0x0500, @@ -42,7 +57,7 @@ AlarmTriggered = 0x0300, AlarmCleared = 0x0400, - PressureOcclusion = 0x0900, // message 9 + PressureOcclusion = 0x0900, AdjustBloodDialysateReq = 0x1700, // 23 AdjustBloodDialysateRsp = 0x1800, // 24 @@ -54,12 +69,6 @@ Acknow = 0xFFFF, }; - enum class GuiActionsIndx_Enum { - // ---- PowerOff - PowerOff_ShowHide = 0 , - PowerOff_Response = 0 , - }; - enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { NoData = 0x00, @@ -74,91 +83,25 @@ Timeout = 0x01, }; - enum GuiAlarmPriority_Enum { // TODO : this code has to be in common repository soon. - ALARM_PRIORITY_NONE = 0, - ALARM_PRIORITY_LOW, - ALARM_PRIORITY_MEDIUM, - ALARM_PRIORITY_HIGH, - NUM_OF_ALARM_PRIORITIES - }; - - enum GuiAlarmID_Enum { // TODO : this code has to be in common repository soon. - ALARM_ID_NO_ALARM = 0, - ALARM_ID_SOFTWARE_FAULT, - ALARM_ID_STUCK_BUTTON_TEST_FAILED, - ALARM_ID_FPGA_POST_TEST_FAILED, - ALARM_ID_WATCHDOG_POST_TEST_FAILED, - ALARM_ID_UI_COMM_POST_FAILED, // 5 - ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK, - ALARM_ID_BLOOD_PUMP_MC_SPEED_CHECK, - ALARM_ID_BLOOD_PUMP_MC_DIRECTION_CHECK, - ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_CHECK, - ALARM_ID_DIAL_IN_PUMP_MC_CURRENT_CHECK, // 10 - ALARM_ID_DIAL_IN_PUMP_MC_SPEED_CHECK, - ALARM_ID_DIAL_IN_PUMP_MC_DIRECTION_CHECK, - ALARM_ID_DIAL_IN_PUMP_ROTOR_SPEED_CHECK, - ALARM_ID_DIAL_OUT_PUMP_MC_CURRENT_CHECK, - ALARM_ID_DIAL_OUT_PUMP_MC_SPEED_CHECK, // 15 - ALARM_ID_DIAL_OUT_PUMP_MC_DIRECTION_CHECK, - ALARM_ID_DIAL_OUT_PUMP_ROTOR_SPEED_CHECK, - ALARM_ID_WATCHDOG_EXPIRED, - ALARM_ID_RTC_COMM_ERROR, - ALARM_ID_RTC_CONFIG_ERROR, // 20 - ALARM_ID_DG_COMM_TIMEOUT, - ALARM_ID_UI_COMM_TIMEOUT, - ALARM_ID_COMM_TOO_MANY_BAD_CRCS, - ALARM_ID_TREATMENT_STOPPED_BY_USER, - ALARM_ID_BLOOD_SITTING_WARNING, // 25 - ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RESUME, - ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RINSEBACK, - ALARM_ID_CAN_MESSAGE_NOT_ACKED, - ALARM_ID_OCCLUSION_BLOOD_PUMP, - ALARM_ID_OCCLUSION_DIAL_IN_PUMP, // 30 - ALARM_ID_OCCLUSION_DIAL_OUT_PUMP, - ALARM_ID_ARTERIAL_PRESSURE_LOW, - ALARM_ID_ARTERIAL_PRESSURE_HIGH, - ALARM_ID_VENOUS_PRESSURE_LOW, - ALARM_ID_VENOUS_PRESSURE_HIGH, // 35 - NUM_OF_ALARM_IDS - }; - - enum GuiRequestReasons_Enum - { - REASON_NONE = 0, ///< No reason. - REASON_NOT_ALLOWED_IN_CURRENT_MODE, ///< Request is not allowed in the current operating mode. - REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM, ///< Validated request was not confirmed by user in reasonable time. - REASON_NOT_IN_TREATMENT_MODE, ///< Request is not allowed if not in treatment mode. - REASON_INVALID_TREATMENT_STATE, ///< Request is not allowed in current treatment state. - REASON_TREATMENT_TOO_CLOSE_TO_FINISHED, ///< Request is not allowed so near end of treatment. - REASON_TREATMENT_TIME_OUT_OF_RANGE, ///< Treatment duration is out of range. - REASON_TREATMENT_TIME_LESS_THAN_CURRENT, ///< Treatment time change is less than currently elapsed treatment time. - REASON_BLOOD_FLOW_OUT_OF_RANGE, ///< Blood flow is out of range. - REASON_DIAL_FLOW_OUT_OF_RANGE, ///< Dialysate flow is out of range. - REASON_DIAL_VOLUME_OUT_OF_RANGE, ///< Dialysate flow rate or treatment duration causes dialysate volume to exceed limit. - REASON_UF_VOLUME_OUT_OF_RANGE, ///< Ultrafiltration volume is out of range. - REASON_UF_RATE_OUT_OF_RANGE, ///< Ultrafiltration rate is out of range. - NUM_OF_REQUEST_REJECT_REASONS ///< Number of settings change reject codes. - }; - Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) - Q_ENUM(GuiActionsIndx_Enum) - Q_ENUM(GuiAlarmPriority_Enum) - Q_ENUM(GuiAlarmID_Enum) + #include "AlarmDefs.h" + Q_ENUM(Alarm_Priorities) + Q_ENUM(Alarm_List ) - Q_ENUM(GuiRequestReasons_Enum) + #include "MsgDefs.h" + Q_ENUM(Request_Reject_Reasons) }; // 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; + typedef GuiActions::Alarm_Priorities GuiAlarmPriority; + typedef GuiActions::Alarm_List GuiAlarmID; - typedef GuiActions::GuiRequestReasons_Enum GuiRequestReasons; + typedef GuiActions::Request_Reject_Reasons GuiRequestReasons; void registerTypes(); void registerQmlTypes();