Index: sources/gui/guiglobals.h =================================================================== diff -u -rd2035a8728794afeefaa244bf8d1597926d945f5 -r7edcaf054062754370e0abd165f17ca9941b7d07 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision d2035a8728794afeefaa244bf8d1597926d945f5) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) @@ -1,16 +1,16 @@ /*! - * + * * 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 - * \author (last) Peter Lucia - * \date (last) 25-Jun-2020 + * \author (last) Behrouz NematiPour + * \date (last) 25-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 28-Oct-2019 - * + * */ #pragma once @@ -20,7 +20,19 @@ // Project namespace Gui { - extern QQuickView *_viewer; + 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 @@ -35,13 +47,13 @@ * *** 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 + * *** 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 doesn't support enum types */ { ID_Unknown = 0x0000, - ID_CANBusFaultCount = 0x9909, ID_RawData = 0xFFFE, @@ -64,13 +76,17 @@ ID_TreatmentRanges = 0x1A00, // 26 ID_PressureOcclusion = 0x0900, ID_TreatmentStates = 0x0F00, // 15 + ID_Saline = 0x2F00, // 47 ID_AlarmStatus = 0x0200, ID_AlarmTriggered = 0x0300, ID_AlarmCleared = 0x0400, - ID_AlarmSilenceReq = 0x2F00, // 47 - Not implemented yet on FW side - ID_AlarmSilenceRsp = 0x3000, // 48 - Not implemented yet on FW side + ID_CreateTreatmentReq = 0x3500, // 53 - Not implemented yet on FW side + ID_CreateTreatmentRsp = 0x3600, // 54 - Not implemented yet on FW side + ID_AlarmSilenceReq = 0x3200, // 50 - Not implemented yet on FW side + ID_AlarmSilenceRsp = 0x0000, // Needs to be removed. + ID_HDOperationModeData = 0x2500, // 37 ID_DGROPumpData = 0x1F00, // 31 @@ -97,6 +113,10 @@ ID_AdjustDurationReq = 0x1600, // 22 ID_AdjustDurationRsp = 0x1B00, // 27 + + ID_AdjustSalineReq = 0x1200, // 18 + ID_AdjustSalineRsp = 0x1400, // 20 + }; enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { @@ -113,6 +133,12 @@ Timeout = 0x01, }; + enum Saline_States { // FW currently doesn't have enum for Saline Bolus when provided better to be replaced. + SALINE_STOP_STATE = 0, ///< Saline is not delivered + SALINE_START_STATE , ///< Saline being Delivered + SALINE_DISABLE_STATE , ///< Saline cumulative volume delivery has reached the maximum + }; + Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) @@ -126,6 +152,9 @@ #include "HDDefs.h" Q_ENUM(HD_Op_Modes) Q_ENUM(UF_Adjustments) + Q_ENUM(Treatment_States) + Q_ENUM(UF_States) + Q_ENUM(Saline_States) #include "DGDefs.h" Q_ENUM(DG_Op_Modes) @@ -144,8 +173,10 @@ typedef GuiActions::DG_Op_Modes GuiDGOpModes; typedef GuiActions::UF_Adjustments GuiUFAdjustment; + typedef GuiActions::Treatment_States GuiTreatment_States; + typedef GuiActions::UF_States GuiUFStates; + typedef GuiActions::Saline_States GuiSalineStates; - void registerTypes(); void registerQmlTypes();