/*! * * Copyright (c) 2019-2020 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 * \date 10/27/2019 * \author Behrouz NematiPour * */ #pragma once // Qt #include // Project namespace Gui { extern QQuickView *_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 preffered 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 */ { idUnknown = 0x0000, idCANBusFaultCount = 0x9909, idRawData = 0xFFFE, idAcknow = 0xFFFF, idAcknowGeneric = 0x0000, //< Generic Acknowledgment is not a unique message ID and inherits its Id from the actual message. Zero is a placeholder idDGCheckIn = 0x0600, idKeepAlive = 0x0700, idPowerOff = 0x0100, idPowerOffBroadcast = 0x0E00, idTreatmentTime = 0x0D00, idBloodFlow = 0x0500, idDialysateInletFlow = 0x0800, idDialysateOutletFlow = 0x0B00, idTreatmentRanges = 0x1A00, // 26 idPressureOcclusion = 0x0900, idTreatmentState = 0x0F00, // 15 idAlarmStatus = 0x0200, idAlarmTriggered = 0x0300, idAlarmCleared = 0x0400, idDGROPumpData = 0x1F00, // 31 idDGPressuresData = 0x2000, // 32 idDGDrainPumpData = 0x2400, // 36 idDGOperationModeData = 0x2700, // 39 idDGReservoirData = 0x2800, // 40 idDGValvesStatesData = 0x2A00, // 42 idDGHeatersData = 0x2C00, // 44 idDGLoadCellReadingsData = 0x0C00, // 12 idDGTemperaturesData = 0x2D00, // 45 idAdjustBloodDialysateReq = 0x1700, // 23 idAdjustBloodDialysateRsp = 0x1800, // 24 idAdjustUltrafiltrationStateReq = 0x1000, // 16 // idAcknowGeneric : the response is the AcknowGeneric with the same msgID idAdjustUltrafiltrationEditReq = 0x1100, // 17 idAdjustUltrafiltrationEditRsp = 0x1300, // 19 idAdjustUltrafiltrationConfirmReq = 0x1500, // 21 idAdjustUltrafiltrationConfirmRsp = 0x2E00, // 46 idAdjustDurationReq = 0x1600, // 22 idAdjustDurationRsp = 0x1B00, // 27 }; 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 // 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 ) #include "MsgDefs.h" Q_ENUM(Request_Reject_Reasons) #include "DGDefs.h" Q_ENUM(DG_Op_Modes) }; // 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::Request_Reject_Reasons GuiRequestReasons; typedef GuiActions::DG_Op_Modes GuiDGOpModes; void registerTypes(); void registerQmlTypes(); bool startGui(); }