Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r93b6bd48e2aec1fca4f2b5b79dcefffa49e9ce16 -r94fc1cd187816ecbf176df26f9dc5601bf379f13 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 93b6bd48e2aec1fca4f2b5b79dcefffa49e9ce16) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 94fc1cd187816ecbf176df26f9dc5601bf379f13) @@ -76,15 +76,17 @@ ID_KeepAlive = 0x0700, // HD Data Messages + ID_HDOperationModeData = 0x2500, // 37 + ID_PreTreatmentStates = 0x5C00, // 92 + ID_TreatmentStates = 0x0F00, // 15 + ID_PowerOff = 0x0100, ID_ShuttingDown = 0x0E00, ID_TreatmentTime = 0x0D00, ID_BloodFlow = 0x0500, ID_DialysateInletFlow = 0x0800, ID_DialysateOutletFlow = 0x0B00, ID_TreatmentRanges = 0x1A00, // 26 - ID_TreatmentStates = 0x0F00, // 15 - ID_HDOperationModeData = 0x2500, // 37 ID_PressureOcclusion = 0x0900, ID_Saline = 0x2F00, // 47 ID_Heparin = 0x4D00, // 77 @@ -102,13 +104,43 @@ ID_AlarmSilenceReq = 0x3200, // 50 ID_AlarmUserActionReq = 0x4000, // 64 // there is no response since it is kind of the response to the ID_AlarmStatus from UI to HD - // Pre-Treatment Parameters - ID_CreateTreatmentReq = 0x3500, // 53 - ID_CreateTreatmentRsp = 0x3600, // 54 - ID_StartTreatmentReq = 0x3800, // 56 - ID_StartTreatmentRsp = 0x3900, // 57 - ID_ConfirmTreatmentReq = 0x3B00, // 59 - ID_PrimingData = 0x4300, // 67 + // Pre-Treatment + // Pre-Treatment Initiate Treatment + ID_AdjustInitTreatmentReq = 0x3800, // 56 + ID_AdjustInitTreatmentRsp = 0x3900, // 57 + // Pre-Treatment Parameters Validation/Confirm + ID_AdjustParametersValidationReq = 0x3500, // 53 + ID_AdjustParametersValidationRsp = 0x3600, // 54 + ID_AdjustParametersConfirmReq = 0x3B00, // 59 + // Pre-Treatment Water Sample + ID_DGFilterFlushData = 0x6000, // 96 + ID_AdjustWaterSampleReq = 0x5D00, // 93 + ID_AdjustWaterSampleRsp = 0x5E00, // 94 + ID_AdjustWaterSampleResultReq = 0x5F00, // 95 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + // Pre-Treatment Consumables Installation Confirm + ID_AdjustConsumablesConfirmReq = 0x6800, // 104 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + // Pre-Treatment SelfTest NoCartridge Progress Data + ID_SelfTestNoCartridgeData = 0x6100, // 97 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + // Pre-Treatment Disposables Installation Confirm + ID_AdjustDisposablesConfirmReq = 0x6200, // 98 // there is no specific response message for this request and changing of the state in Pre_Treatment_States is used as the response + // Pre-Treatment SelfTest Dry Progress Data + ID_SelfTestDryData = 0x6300, // 99 + // Pre-Treatment Disposable Priming + ID_AdjustDisposablesPrimeReq = 0x3C00, // 60 + ID_AdjustDisposablesPrimeRsp = 0x3D00, // 61 + ID_DisposablesPrimeData = 0x4300, // 67 + // Pre-Treatment Patient Connection Begin + ID_AdjustPatientConnectionBeginReq = 0x6400, // 100 + ID_AdjustPatientConnectionBeginRsp = 0x6500, // 101 + // Pre-Treatment Ultrafiltration initial volume + ID_AdjustUltrafiltrationInitReq = 0x4F00, // 79 + ID_AdjustUltrafiltrationInitRsp = 0x5000, // 80 + // Pre-Treatment Patient Connection Confirm + ID_AdjustPatientConnectionConfirmReq= 0x6600, // 102 + ID_AdjustPatientConnectionConfirmRsp= 0x6700, // 103 + // Pre-Treatment Start Treatment + ID_AdjustStartTreatmentReq = 0x7100, // 113 + ID_AdjustStartTreatmentRsp = 0x7200, // 114 // DG Data Messages ID_DGROPumpData = 0x1F00, // 31 @@ -138,10 +170,7 @@ ID_AdjustHeparinReq = 0x4B00, // 75 ID_AdjustHeparinRsp = 0x4C00, // 76 - // Ultrafiltration: has also In-Treatment Adjustables but kept together - ID_AdjustUltrafiltrationInitReq = 0x4F00, // 79 - ID_AdjustUltrafiltrationInitRsp = 0x5000, // 80 - + // Ultrafiltration ID_AdjustUltrafiltrationStateReq = 0x1000, // 16 ID_AdjustUltrafiltrationStateRsp = 0x4100, // 65 @@ -221,9 +250,22 @@ // Treatment End Q_ENUM(Treatment_End_States) Q_ENUM(Requested_Treatment_End_User_Actions) + // Pre-Treatment SubMode + Q_ENUM(HD_Pre_Treatment_Mode_States) + // Pre-Treatment Water Sample + Q_ENUM(HD_Pre_Treatment_Sample_Water_States) + Q_ENUM(Requested_Sample_Water_User_Actions) + // Pre-Treatment Self Test Consumable + Q_ENUM(HD_Pre_Treatment_Consumable_Self_Test_States) + // Pre-Treatment Self Test No Cartridge + Q_ENUM(HD_Pre_Treatment_No_Cart_Self_Tests_States) + // Pre-Treatment Self Test Dry + Q_ENUM(HD_Pre_Treatment_Dry_Self_Tests_States) + // Pre-Treatment Prime + Q_ENUM(HD_Pre_Treatment_Prime_States) + // Pre-Treatment Recirculate + Q_ENUM(HD_Pre_Treatment_Recirc_States) - // Treatment Stop - #include "DGDefs.h" Q_ENUM(DG_Op_Modes) }; @@ -269,7 +311,50 @@ typedef GuiActions::Treatment_Stop_States GuiTreatmentStopStates; // typedef GuiActions::Requested_Treatment_Stop_User_Actions GuiTreatmentStopCommands; // No user Action defined + // Pre-Treatment SubMode + typedef GuiActions::HD_Pre_Treatment_Mode_States GuiPreTreatmentStates; + // Pre-Treatment Water Sample + typedef GuiActions::HD_Pre_Treatment_Sample_Water_States GuiPreTreatmentWaterSampleStates; + typedef GuiActions::Requested_Sample_Water_User_Actions GuiPreTreatmentWaterSampleCommands; + // Pre-Treatment Self Test Consumable + typedef GuiActions::HD_Pre_Treatment_Consumable_Self_Test_States GuiPreTreatmentSelfTestConsumablesStates; + // Pre-Treatment Self Test No Cartridge + typedef GuiActions::HD_Pre_Treatment_No_Cart_Self_Tests_States GuiPreTreatmentSelfTestNoCartridgeStates; + // Pre-Treatment Self Test Dry + typedef GuiActions::HD_Pre_Treatment_Dry_Self_Tests_States GuiPreTreatmentSelfTestDryStates; + // Pre-Treatment Prime + typedef GuiActions::HD_Pre_Treatment_Prime_States GuiPreTreatmentPrimeStates; + // Pre-Treatment Recirculate + typedef GuiActions::HD_Pre_Treatment_Recirc_States GuiPreTreatmentRecirculateStates; + /*! + * \brief enumString + * \details converts the enum index to it's code defined text + * \note the enum has to be defined in the Qt metadata by Q_ENUM + * \note the passed vEnum has to be in the type of enum and if not has to be cast by static_cast< ENUM >( VALUE ) + * \param vEnum - the enum to get the name of it + * \param vUndefined - the string format to be used to return if enum is undefined and the number itself is going to be returned. + * \return name of the enum as string or a formatted text by vUndefined containing the enum index number. + */ + template + QString enumString(const T_ENUM &vEnum, const char *vUndefined = nullptr) { + const QMetaObject *mo = qt_getEnumMetaObject(vEnum); + int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum)); + const char *key = mo->enumerator(enumIdx).valueToKey(vEnum); + if (key) { + return qPrintable(key); + } + else { + QString undefined; + if ( vUndefined ) { + undefined = vUndefined; + if (undefined.trimmed().isEmpty()) undefined = "UNDEFINED [%1]"; + } + return undefined.arg(vEnum); + } + } + + void registerTypes(); void registerQmlTypes();