/*! * * 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 GuiGlobals.h * \author (last) Dara Navaei * \date (last) 06-May-2024 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * */ #pragma once // Qt #include // Project namespace Gui { /*! * \brief The MainView class * \details A QQuickView inherited child. * Main entry of the QML. * It's not usual to inherit from QQuickView and most of the time the class QQuickView, itself, is used. * It's been inherited to grab all the events which is send/received to/from QML. * \sa VEventSpy */ 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 explicit GuiActions(); public: /*! * \brief The GuiActionsType_Enum enum * \details * *** This enum could use the Msg_IDs enum in MsgDefs.h, ***\n * *** But that enum has values in Normal (BigEndian) ***\n * *** 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 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 does not support enum types */ { ID_Unknown = 0x0000, ID_CANBusFaultCount = 0x9909, ID_RawData = 0xFFFE, 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 ID_TDDebugText = 0xF1FF, ID_DDDebugText = 0xF2FF, ID_HDGeneralEvent = 0xA400, ID_DGGeneralEvent = 0xA500, ID_TDCheckIn = 0x1000, // 16 //// ----- @LEAHIZED // Generic Confirmation ID_DuetConfirmHDi = 0xBA00, // 186 ID_DuetConfirmUIr = 0xBB00, // 187 // POST ID_HDPostSingleResultData = 0x8E00, // 142 ID_HDPostFinalResultData = 0x8F00, // 143 ID_DGPostSingleResultData = 0x9000, // 144 ID_DGPostFinalResultData = 0x9100, // 145 ID_UIPostFinalResultData = 0x9200, // 146 // ID_UIFinalResultTxr - UI Final Result response/Data transmit ID_UIPostFinalResultHDReq = 0xB200, // 178 // ID_HDFinalResultRxq - HD Final Result request received // ----- Settings // Service Mode ID_AdjustServiceModeReq = 0xB000, // 176 ID_AdjustServiceModeRsp = 0xB100, // 177 // Version ID_AdjustVersionsUIReq = 0x0D00, // 13 //// ----- @LEAHIZED ID_AdjustVersionsUIRsp = 0x1600, // 22 // ID_UIVersionsTxr - UI Version response transmit //// ----- @LEAHIZED 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 // Service Information ID_AdjustServiceDatesReq = 0x8900, // 137 ID_AdjustServiceDatesHDRsp = 0x8A00, // 138 ID_AdjustServiceDatesDGRsp = 0x8C00, // 140 // HD/DG Usage Counter ID_HDUsageInfoReq = 0xA000, // 160 ID_HDUsageInfoRsp = 0x8B00, // 139 // RTC ID_AdjustHDDateTimeReq = 0x6D00, // 109 ID_AdjustHDDateTimeRsp = 0x6E00, // 110 ID_AdjustDGDateTimeReq = 0x6F00, // 111 ID_AdjustDGDateTimeRsp = 0x7000, // 112 ID_HDRTCEpochData = 0x0A0F, // 10 //// ----- @CRAPIZED // State Messages ID_TDOpModeData = 0x1200, // 18 //// ----- @LEAHIZED ID_PreTreatmentStates = 0x5C00, // 92 ID_TreatmentStates = 0x3C00, // 60 //// ----- @LEAHIZED ID_PostTreatmentStates = 0x7700, // 119 // ----- ID_PowerOff = 0x010F, // 010F //// ----- @CRAPIZED ID_ShuttingDown = 0x0E0F, // 35 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentTime = 0x3B00, // 59 //// ----- @LEAHIZED ID_BloodFlow = 0x1100, // 17 //// ----- @LEAHIZED ID_DialysateInletFlow = 0x0800, ID_DialysateOutletFlow = 0x0B00, ID_PressureOcclusion = 0x2400, // 36 //// ----- @LEAHIZED ID_Saline = 0x3D00, // 61 //// ----- @LEAHIZED ID_Ultrafiltration = 0x3E00, // 62 //// ----- @LEAHIZED ID_Heparin = 0x4D00, // 77 ID_Rinseback = 0x5600, // 86 ID_Recirculate = 0x5A00, // 90 ID_BloodPrime = 0x5900, // 89 ID_TreatmentStop = 0x4900, // 73 ID_Vitals = 0x6500, // 101 // Alarm Messages ID_AlarmStatus = 0x0100, // 01 //// ----- @LEAHIZED ID_AlarmTriggered = 0x0200, // 02 //// ----- @LEAHIZED ID_AlarmCleared = 0x0300, // 03 //// ----- @LEAHIZED ID_AlarmSilenceReq = 0x0500, // 05 //// ----- @LEAHIZED ID_AlarmUserActionReq = 0x0600, // 06 //// ----- @LEAHIZED ID_AlarmActiveListReq = 0x0900, // 09 //// ----- @LEAHIZED ID_AlarmActiveListRsp = 0x0A00, // 10 //// ----- @LEAHIZED ID_AlarmVolumeSetReq = 0x0B00, // 11 //// ----- @LEAHIZED ID_AlarmVolumeSetRsp = 0x0C00, // 12 //// ----- @LEAHIZED // Create Rx ID_AdjustInitTreatmentReq = 0x4500, // 69 //// ----- @LEAHIZED ID_AdjustInitTreatmentRsp = 0x4600, // 70 //// ----- @LEAHIZED ID_AdjustParametersValidationReq = 0x3F00, // 63 //// ----- @LEAHIZED ID_AdjustParametersValidationRsp = 0x4000, // 64 //// ----- @LEAHIZED ID_AdjustParametersConfirmReq = 0x4400, // 68 //// ----- @LEAHIZED ID_TreatmentRanges = 0x4300, // 67 //// ----- @LEAHIZED // Pre-Treatment Water Sample ID_DGFilterFlushData = 0x600F, // ?? //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustWaterSampleReq = 0x5D00, // 93 ID_AdjustWaterSampleRsp = 0x5E00, // 94 ID_AdjustWaterSampleResultReq = 0x5F0F, // 95 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Consumables Installation Confirm ID_AdjustConsumablesConfirmReq = 0x6800, // 104 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment SelfTest NoCartridge Progress Data ID_SelfTestNoCartridgeData = 0x6100, // 97 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment Disposables Installation Confirm ID_AdjustDisposablesConfirmReq = 0x6200, // 98 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response ID_AdjustDisposablesConfirmRsp = 0xAD00, // 173 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response // Pre-Treatment SelfTest Dry Progress Data ID_SelfTestDryData = 0x630F, // 99 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Disposable Priming ID_AdjustDisposablesPrimeReq = 0x3C0F, // 60 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustDisposablesPrimeRsp = 0x3D0F, // 61 //// ----- @CRAPIZED: had to change to avoid duplication ID_DisposablesPrimeData = 0x43FF, // ?? //// ----- @CRAPIZED - FFed // Pre-Treatment Patient Connection Begin ID_AdjustPatientConnectionBeginReq = 0x640F, // 100 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustPatientConnectionBeginRsp = 0x650F, // 101 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Ultrafiltration initial volume ID_AdjustUltrafiltrationInitReq = 0x4F0F, // 79 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustUltrafiltrationInitRsp = 0x5000, // 80 // Pre-Treatment Patient Connection Confirm ID_AdjustPatientConnectionConfirmReq = 0x660F, // 102 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustPatientConnectionConfirmRsp = 0x670F, // 103 //// ----- @CRAPIZED: had to change to avoid duplication // Pre-Treatment Start Treatment ID_AdjustStartTreatmentReq = 0x7100, // 113 ID_AdjustStartTreatmentRsp = 0x7200, // 114 // DG Data Messages ID_DGROPumpData = 0x1F0F, // 31 //// ----- @CRAPIZED: had to change to avoid duplication ID_DGDrainPumpData = 0x240F, // ?? //// ----- @CRAPIZED: had to change to avoid duplication ID_DGOperationModeData = 0x270F, // ?? //// ----- @CRAPIZED: had to change to avoid duplication ID_DGReservoirData = 0x280F, // ?? //// ----- @CRAPIZED: had to change to avoid duplication ID_DGLoadCellReadingsData = 0x0C00, // 12 ID_DGAccelerometerData = 0x3400, // 52 ID_DDValvesStatesData = 0x1B00, // 27 //// ----- @LEAHIZED ID_DDPressuresData = 0x1C00, // 28 //// ----- @LEAHIZED ID_DDConductivityData = 0x1F00, // 31 //// ----- @LEAHIZED ID_DDConcentratePumpData = 0x2500, // 37 //// ----- @LEAHIZED ID_DDTemperaturesData = 0x2600, // 38 //// ----- @LEAHIZED ID_DDDialysatePumpData = 0x2700, // 39 //// ----- @LEAHIZED ID_DDHeatersData = 0x2800, // 40 //// ----- @LEAHIZED ID_DDLevelData = 0x2900, // 41 //// ----- @LEAHIZED 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 ID_HDBloodLeakData = 0x6C00, // 108 ID_TDAirBubbleData = 0x1E00, // 30 //// ----- @LEAHIZED ID_TDAirPumpData = 0x2000, // 32 //// ----- @LEAHIZED ID_TDAirTrapData = 0x2A00, // 42 //// ----- @LEAHIZED ID_TDVoltageData = 0x1D00, // 29 //// ----- @LEAHIZED ID_TDValvesData = 0x2B00, // 43 //// ----- @LEAHIZED ID_TDBatteryData = 0x5400, // 84 //// ----- TODO: Payload subject to change given FW implementation ID_TDSwitchesData = 0x2100, // 33 //// ----- @LEAHIZED ID_TDEjectorData = 0x4E00, // 78 //// ----- @LEAHIZED ID_TDTemperatureData = 0x5300, // 83 //// ----- TODO: Payload subject to change given FW implementation ID_TreatmentParametersSetPointData = 0x4F00, // 79 //// ----- @LEAHIZED // In-Treatment Adjustables ID_AdjustDurationReq = 0x160F, // 22 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustDurationRsp = 0x1B00, // 27 ID_AdjustBloodDialysateReq = 0x1700, // 23 ID_AdjustBloodDialysateRsp = 0x1800, // 24 ID_AdjustPressuresLimitsReq = 0x470F, // 70 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustPressuresLimitsRsp = 0x480F, // 71 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustSalineReq = 0x5F00, // 95 ID_AdjustSalineRsp = 0x6000, // 96 ID_AdjustVitalsReq = 0x6300, // 99 ID_AdjustVitalsRsp = 0x6400, // 100 ID_AdjustHeparinReq = 0x4B00, // 75 ID_AdjustHeparinRsp = 0x4C00, // 76 // Ultrafiltration ID_AdjustUltrafiltrationStateReq = 0x4700, // 71 //// ----- @LEAHIZED ID_AdjustUltrafiltrationStateRsp = 0x4800, // 72 //// ----- @LEAHIZED ID_AdjustUltrafiltrationEditReq = 0x4100, // 65 //// ----- @LEAHIZED ID_AdjustUltrafiltrationEditRsp = 0x4200, // 66 //// ----- @LEAHIZED ID_AdjustUltrafiltrationConfirmReq = 0x6600, // 102 //// ----- @LEAHIZED ID_AdjustUltrafiltrationConfirmRsp = 0x6700, // 103 //// ----- @LEAHIZED // End-Treatment // Rinseback ID_AdjustRinsebackReq = 0x520F, // 82 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustRinsebackRsp = 0x530F, // 83 //// ----- @CRAPIZED: had to change to avoid duplication // Recirculate ID_AdjustRecirculateReq = 0x540F, // 84 //// ----- @CRAPIZED: had to change to avoid duplication ID_AdjustRecirculateRsp = 0x5500, // 85 // Treatment End ID_AdjustTreatmentEndReq = 0x5700, // 87 ID_AdjustTreatmentEndRsp = 0x5800, // 88 // Post-Treatment // Patient Disconnect ID_AdjustPatientDisconnectNotifyReq = 0x4A00, // 74 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response ID_AdjustPatientDisconnectConfirmReq = 0x060F, // 060f //// ----- @CRAPIZED ID_AdjustPatientDisconnectConfirmRsp = 0x7E00, // 126 // Disposables Removal ID_AdjustDisposablesRemovalConfirmReq = 0x7300, // 115 ID_AdjustDisposablesRemovalConfirmRsp = 0x7400, // 116 // Treatment Log Adjs ID_AdjustTreatmentLogReq = 0x7500, // 117 ID_AdjustTreatmentLogRsp = 0x7600, // 118 // Treatment Log Data ID_TreatmentLogAvrgeData = 0x940F, // 148 //// ----- @CRAPIZED: had to change to avoid duplication ID_TreatmentLogAlarmData = 0x6A00, // 106 //// ----- @LEAHIZED ID_TreatmentLogEventData = 0x6B00, // 107 //// ----- @LEAHIZED // Disinfect ID_AdjustDisinfectModeReq = 0x9A00, // 154 ID_AdjustDisinfectModeRsp = 0x9B00, // 155 ID_AdjustDisinfectStartReq = 0x7F00, // 127 ID_AdjustDisinfectStartRsp = 0x8000, // 128 ID_AdjustDGCleaningUsageReq = 0xB800, // 184 ID_AdjustDGCleaningUsageRsp = 0x8D00, // 141 // RO Water Input Mode ID_DuetRoWaterStatDGq = 0xC300, // 195 DG -> UI // DG initiates Status query ID_DuetRoWaterModeUIi = 0xBC00, // 188 UI -> DG // UI initiates Mode Set || responses to status query ID_DuetRoWaterModeDGr = 0xC400, // 196 UI <- DG // DG responses Mode Set // Institutional record request and response ID_AdjustInstitutionalRecordReq = 0xCF00, // 207 UI -> HD request institutional record ID_AdjustInstitutionalRecordRsp = 0xD000, // 208 HD -> UI response institutional record // HD reset request in service mode ID_ResetHDInServiceModeReq = 0xB900, // 185 UI -> HD reset in service mode }; enum class GuiActionsData_Enum /*: quint8 QML does not support*/ { NoData = 0x00, Command = 0x00, // HD=>UI : should be handled in receive Request = 0x00, // UI=>HD : should be handled in transmit // UI=>HD : should be handled in transmit Accepted = 0x01, Rejected = 0x02, // Power-Off Data // HD=>UI : should be handled in receive Timeout = 0x01, }; Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) #include "AlarmDefs.h" Q_ENUM(Alarm_Priorities) Q_ENUM(Alarm_List ) Q_ENUM(Alarm_State_Flag_Bit_Positions) Q_ENUM(Alarm_User_Actions) Q_ENUM(Alarm_Data_Types) #include "MsgDefs.h" Q_ENUM(Request_Reject_Reasons) #include "TDDefs.h" // Confirm Q_ENUM(Generic_Confirm_Id) Q_ENUM(Generic_Confirm_Command) // Q_ENUM(TD_POST_States) Q_ENUM(TD_Op_Modes) Q_ENUM(TD_Standby_States) // Treatment Q_ENUM(Treatment_States) // Dialysis Q_ENUM(Dialysis_States) // Ultrafiltration Q_ENUM(UF_Adjustments) Q_ENUM(UF_Commands) // Saline Q_ENUM(Saline_Bolus_States) Q_ENUM(Saline_Commands) // Heparin Q_ENUM(Heparin_States) Q_ENUM(Heparin_Commands) // Rinseback Q_ENUM(Rinseback_States) Q_ENUM(Requested_Rinseback_User_Actions) // Recirculate Q_ENUM(Treatment_Recirc_States) Q_ENUM(Requested_Treatment_Recirc_User_Actions) // Blood Prime Q_ENUM(Blood_Prime_States) // Treatment End Q_ENUM(Treatment_End_States) Q_ENUM(Requested_Treatment_End_User_Actions) // Treatment Stop Q_ENUM(Treatment_Paused_States) // Pre-Treatment SubMode Q_ENUM(TD_Pre_Treatment_Mode_States) // Pre-Treatment Water Sample Q_ENUM(TD_Pre_Treatment_Sample_Water_States) Q_ENUM(Requested_Sample_Water_User_Actions) // Pre-Treatment Self Test Consumable Q_ENUM(TD_Pre_Treatment_Consumable_Self_Test_States) // Pre-Treatment Self Test No Cartridge Q_ENUM(TD_Pre_Treatment_No_Cart_Self_Tests_States) // Pre-Treatment Self Test Dry Q_ENUM(TD_Pre_Treatment_Dry_Self_Tests_States) // Pre-Treatment Prime Q_ENUM(TD_Pre_Treatment_Prime_States) // Pre-Treatment Recirculate Q_ENUM(TD_Pre_Treatment_Recirc_States) // Post-Treatment SubMode Q_ENUM(TD_Post_Treatment_Mode_States) // Disinfection #include "DDDefs.h" Q_ENUM(DD_Op_Modes) 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 typedef GuiActions::GuiActionsType_Enum GuiActionType; typedef GuiActions::GuiActionsData_Enum GuiActionData; typedef GuiActions::Alarm_Priorities GuiAlarmPriority; typedef GuiActions::Alarm_List GuiAlarmID; typedef GuiActions::Alarm_State_Flag_Bit_Positions GuiAlarmFlags; typedef GuiActions::Alarm_User_Actions GuiAlarmUserActions; typedef GuiActions::Alarm_Data_Types GuiAlarmDataTypes; typedef GuiActions::Request_Reject_Reasons GuiRequestReasons; // confirm typedef GuiActions::Generic_Confirm_Id GuiConfirmId; typedef GuiActions::Generic_Confirm_Command GuiConfirmCommand; // POST typedef GuiActions::TD_POST_States GuiTDPOSTStates; typedef GuiActions::DD_POST_States GuiDDPOSTStates; // operation mode typedef GuiActions::TD_Op_Modes GuiTDOpModes; typedef GuiActions::DD_Op_Modes GuiDDOpModes; typedef GuiActions::TD_Standby_States GuiTDStandbyStates; // Treatment States typedef GuiActions::Treatment_States GuiTreatmentStates; // Dialysis typedef GuiActions::Dialysis_States GuiDialysisState; // Ultrafiltration typedef GuiActions::UF_Commands GuiUFCommands; typedef GuiActions::UF_Adjustments GuiUFAdjustment; // Saline typedef GuiActions::Saline_Bolus_States GuiSalineStates; typedef GuiActions::Saline_Commands GuiSalineCommands; // Heparin typedef GuiActions::Heparin_States GuiHeparinStates; typedef GuiActions::Heparin_Commands GuiHeparinCommands; // Rinseback typedef GuiActions::Rinseback_States GuiRinsebackStates; typedef GuiActions::Requested_Rinseback_User_Actions GuiRinsebackCommands; // Recirculate typedef GuiActions::Treatment_Recirc_States GuiRecirculateStates; typedef GuiActions::Requested_Treatment_Recirc_User_Actions GuiRecirculateCommands; // Blood Prime typedef GuiActions::Blood_Prime_States GuiBloodPrimeStates; // Treatment End typedef GuiActions::Treatment_End_States GuiTreatmentEndStates; typedef GuiActions::Requested_Treatment_End_User_Actions GuiTreatmentEndCommands; // Treatment Stop typedef GuiActions::Treatment_Paused_States GuiTreatmentPausedStates; // Pre-Treatment SubMode typedef GuiActions::TD_Pre_Treatment_Mode_States GuiPreTreatmentStates; // Pre-Treatment Water Sample typedef GuiActions::TD_Pre_Treatment_Sample_Water_States GuiPreTreatmentWaterSampleStates; typedef GuiActions::Requested_Sample_Water_User_Actions GuiPreTreatmentWaterSampleCommands; // Pre-Treatment Self Test Consumable typedef GuiActions::TD_Pre_Treatment_Consumable_Self_Test_States GuiPreTreatmentSelfTestConsumablesStates; // Pre-Treatment Self Test No Cartridge typedef GuiActions::TD_Pre_Treatment_No_Cart_Self_Tests_States GuiPreTreatmentSelfTestNoCartridgeStates; // Pre-Treatment Self Test Dry typedef GuiActions::TD_Pre_Treatment_Dry_Self_Tests_States GuiPreTreatmentSelfTestDryStates; // Pre-Treatment Prime typedef GuiActions::TD_Pre_Treatment_Prime_States GuiPreTreatmentPrimeStates; // Pre-Treatment Recirculate typedef GuiActions::TD_Pre_Treatment_Recirc_States GuiPreTreatmentRecirculateStates; // Post-Treatment SubMode typedef GuiActions::TD_Post_Treatment_Mode_States GuiPostTreatmentStates; // Disinfection Heat States typedef GuiActions::DD_Disinfect_States GuiDisinfectDGStates; typedef GuiActions::DD_Heat_UI_States GuiDisinfectDGHeatStates; // DD Valves typedef GuiActions::DD_Valves GuiDDValves; // FP Valves typedef GuiActions::FP_Valves GuiFPValves; typedef QMap GuiStringIndexMap; typedef QPair GuiStringIndexMapItem; typedef QMapIterator GuiStringIndexMapIterator; typedef QMap GuiUint08IndexMap; typedef QPair GuiUint08IndexMapItem; typedef QMapIterator GuiUint08IndexMapIterator; /*! * \brief enumString * \details converts the enum index to it's code defined text * \note the enum has to be defined in the Qt metadata by Q_ENUM * \note the passed vEnum has to be in the type of enum and if not has to be cast by static_cast< ENUM >( VALUE ) * \param vEnum - the enum to get the name of it * \param vUndefined - the string format to be used to return if enum is undefined and the number itself is going to be returned. * \return name of the enum as string or a formatted text by vUndefined containing the enum index number. */ template QString enumString(const T_ENUM &vEnum, const char *vUndefined = nullptr) { const QMetaObject *mo = qt_getEnumMetaObject(vEnum); int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum)); const char *key = mo->enumerator(enumIdx).valueToKey(vEnum); if (key) { return qPrintable(key); } else { QString undefined; if ( vUndefined ) { undefined = vUndefined; if (undefined.trimmed().isEmpty()) undefined = "UNDEFINED [%1]"; } return undefined.arg(vEnum); } } void registerTypes(); void registerQmlTypes(); bool startGui(); }