/*! * * 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 MAlarmStatusData.h * \author (last) Behrouz NemaiPour * \date (last) 06-Aug-2020 * \author (original) Behrouz NemaiPour * \date (original) 02-Jul-2020 * */ #pragma once // Qt #include // Project #include "types.h" #include "guiglobals.h" // forward declarations class tst_models; namespace Model { class MAlarmStatus { // friends friend class ::tst_models; public: enum Flag { eFlag_systemFault = 0 , eFlag_stop , eFlag_noClear , eFlag_noResume , eFlag_noRinseback , eFlag_noEndTreatment , eFlag_noNewTreatment , eFlag_bypassDialyzer , eFlag_alarmsToEscalate , eFlag_alarmsSilenced , eFlag_Bits_Length = 16, }; QString stringPrefix = "Alarm Status"; struct Data { quint32 mState = 0; /*!< State - Alarm Priority value of type unsigned int as 4 bytes extracted out */ quint32 mTop = 0; /*!< Top - Top value of type unsigned int as 4 bytes extracted out */ quint32 mEscalatesIn = 0; /*!< EscalatesIn - EscalatesIn value of type unsigned int as 4 bytes extracted out */ quint32 mMuteTimeout = 0; /*!< MuteTimeout - MuteTimeout value of type unsigned int as 4 bytes extracted out */ QBitArray mFlags ; /*!< Flags - Flags value of type unsigned int as 1 byte extracted out */ }; private: struct { Types::U32 mState ; Types::U32 mTop ; Types::U32 mEscalatesIn ; Types::U32 mMuteTimeout ; Types::Flags mFlags ; } _data; public: MAlarmStatus(); QString toString ( ) const ; void toVariantList ( QVariantList &vData ) const ; bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); static QString toText ( Gui::GuiAlarmID vAlarmID); Data data() const ; }; } typedef Model::MAlarmStatus::Data AlarmStatusData; typedef Model::MAlarmStatus::Flag AlarmStatusFlag;