/*! * * Copyright (c) 2019-2019 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 namespace Gui { extern QQuickView *_viewer; class GuiActions { Q_GADGET explicit GuiActions(); public: enum /*class*/ GuiActionsType_Enum /*: quint16 QML doesn't support*/ { Unknown = 0x0000, PowerOff = 0x0100, KeepAlive = 0x0700, BloodFlow = 0x0500, AlarmStatus = 0x0200, AlarmTriggered = 0x0300, AlarmCleared = 0x0400, String = 0xFFFF, }; enum class GuiActionsIndx_Enum { PowerOff_ShowHide = 0, PowerOff_Response = 0, BloodFlow_FlowSetPoint = 0, BloodFlow_MeasuredFlow , BloodFlow_RotorSpeed , BloodFlow_MotorSpeed , BloodFlow_MotorCtlSpeed , BloodFlow_MotorCtlCurrent , BloodFlow_PWMDtCycle , }; 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, }; Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) Q_ENUM(GuiActionsIndx_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; void registerTypes(); void registerQmlTypes(); void startGui(); }