/*! * * 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 */ { Unknown = 0x0000, PowerOff = 0x0100, KeepAlive = 0x0700, BloodFlow = 0x0500, DialysateInletFlow = 0x0800, DialysateOutletFlow = 0x0B00, TreatmentTime = 0x0D00, PowerOffBroadcast = 0x0E00, AlarmStatus = 0x0200, AlarmTriggered = 0x0300, AlarmCleared = 0x0400, PressureOcclusion = 0x0900, AdjustBloodDialysateReq = 0x1700, // 23 AdjustBloodDialysateRsp = 0x1800, // 24 AdjustUltrafiltrationReq= 0x1100, // 17 AdjustUltrafiltrationRsp= 0x1300, // 19 AdjustUltrafiltrationConfirmReq = 0x1500, // 21 AdjustUltrafiltrationConfirmRsp = 0x2E00, // 46 AdjustDurationReq = 0x1600, // 22 AdjustDurationRsp = 0x1B00, // 27 TreatmentRanges = 0x1A00, // 26 TreatmentState = 0x0F00, // 15 UltrafiltrationState = 0x1000, // 16 String = 0xFFFE, Acknow = 0xFFFF, AcknowGeneric = 0x0000, //< Generic Acknowledgment is not a unique message ID and inherits its Id from the actual message. Zero is a placeholder }; 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) }; // 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; void registerTypes(); void registerQmlTypes(); bool startGui(); }