Index: denali.pro =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- denali.pro (.../denali.pro) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ denali.pro (.../denali.pro) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -97,8 +97,9 @@ sources/AlarmGenerator.h \ sources/ApplicationPost.h \ \ # Controllers - sources/storage/Settings.h \ sources/ApplicationController.h \ + sources/storage/Settings.h \ + sources/storage/TreatmentLog.h \ \ # ---------- Models ---------- sources/model/MModel.h \ sources/model/MAbstract.h \ @@ -309,14 +310,16 @@ sources/AlarmGenerator.cpp \ sources/ApplicationPost.cpp \ \ # Controllers - sources/storage/Settings.cpp \ sources/ApplicationController.cpp \ + sources/storage/Settings.cpp \ + sources/storage/TreatmentLog.cpp \ \ # ---------- Models ---------- sources/model/MAbstract.cpp \ \ # ---------- Models - settings sources/model/settings/MSettings.cpp \ \ # ---------- Models - Alarm sources/model/hd/alarm/MAlarmStatusData.cpp \ + sources/model/hd/alarm/MAlarmMapping.cpp \ sources/model/hd/alarm/MAlarmTriggered.cpp \ sources/model/hd/alarm/MAlarmCleared.cpp \ sources/model/hd/alarm/MAlarmClearedCondition.cpp \ Index: denali.pro.user =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- denali.pro.user (.../denali.pro.user) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ denali.pro.user (.../denali.pro.user) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -raad2e406efd1fc2589a19004eb86ca6277f41aea -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- en_US.udic (.../en_US.udic) (revision aad2e406efd1fc2589a19004eb86ca6277f41aea) +++ en_US.udic (.../en_US.udic) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -88,3 +88,11 @@ USBDrive SDCard Pre +HCO +Tx +Gui +SRSUI +Gui +accessor +init +Trtmt Index: resources/license =================================================================== diff -u --- resources/license (revision 0) +++ resources/license (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,14 @@ +/*! + * + * 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 %FILENAME% + * \\author (last) %USER% + * \\date (last) %DATE% + * \\author (original) %USER% + * \\date (original) %DATE% + * + */ Index: resources/settings/Instructions/1.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/3.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/Instructions.conf =================================================================== diff -u --- resources/settings/Instructions/Instructions.conf (revision 0) +++ resources/settings/Instructions/Instructions.conf (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,8 @@ +[Disposables^Cartridge Installation] +Unlock pump track, Lock pump track =1.png +Insert cartridge using alignment pins =2.png +HD machine door open / HD machine door closed =3.png + +[Disposables^Cartridge Connection] +Connect dialyzer v1 = slide2_filter-connect_v1.png + Index: resources/settings/Instructions/slide1_filter_v2.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/slide1_filter_v2b.png =================================================================== diff -u Binary files differ Index: resources/settings/Instructions/slide2_filter-connect_v1.png =================================================================== diff -u Binary files differ Index: resources/settings/TreatmentParameters/DataList.conf =================================================================== diff -u --- resources/settings/TreatmentParameters/DataList.conf (revision 0) +++ resources/settings/TreatmentParameters/DataList.conf (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,22 @@ +[Acid Concentrate] +Fresenius Naturalyte Acid Concentrate +08-1251-1 +08-2251-0 +08-3251-9 + +[Bicarbonate Concentrate] +Fresenius Centrisol Liquid Bicarbonate + +[Dialyzer Type] +BBraun Diacap Pro 13H +BBraun Diacap Pro 16H +BBraun Diacap Pro 19H +Fresenius Optiflux F160NRe +Fresenius Optiflux F180NRe + +[Heparin Type] +Unfractionated 1,000 IU/mL + +[Water Sample Result] +Pass +Fail Index: resources/settings/TreatmentParameters/Formats.conf =================================================================== diff -u --- resources/settings/TreatmentParameters/Formats.conf (revision 0) +++ resources/settings/TreatmentParameters/Formats.conf (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,4 @@ +[DateTime] +Time=HH:mm +Date="yyyy/MM/dd" + Index: resources/settings/instructions/1.png =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e Binary files differ Index: resources/settings/instructions/2.png =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e Binary files differ Index: resources/settings/instructions/3.png =================================================================== diff -u -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e Binary files differ Fisheye: Tag 2216ac6ac7f77437a7c29ac8b4043be01bc4609e refers to a dead (removed) revision in file `resources/settings/instructions/instructions.conf'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 2216ac6ac7f77437a7c29ac8b4043be01bc4609e refers to a dead (removed) revision in file `resources/settings/instructions/readme.md'. Fisheye: No comparison available. Pass `N' to diff? Index: resources/settings/instructions/slide1_filter_v2.png =================================================================== diff -u -r4b7b2f3079f81ff442fcbbde5d5e5465f5937417 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e Binary files differ Index: resources/settings/instructions/slide1_filter_v2b.png =================================================================== diff -u -r4b7b2f3079f81ff442fcbbde5d5e5465f5937417 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e Binary files differ Index: resources/settings/instructions/slide2_filter-connect_v1.png =================================================================== diff -u -r4b7b2f3079f81ff442fcbbde5d5e5465f5937417 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e Binary files differ Index: resources/settings/readme.md =================================================================== diff -u --- resources/settings/readme.md (revision 0) +++ resources/settings/readme.md (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,25 @@ +This folder contains the files required for the screens in the application which are instruction-based. +It has to be in the .config folder of the home directory, for application to be able to read it when running on the device. +When running on the VM, it has to be in the application project under the resources. + +To meet the instruction requirement, application needs to have a configuration file named: + - instructions.conf +which is the file that has the mapping of the image:description set for each instruction-based screen. +Each instruction-based screen in the map file shall have a section with the format of: + + - [^] + +and then for each instruction image and description a line with the format of: + + - <Description>=<image file name> + +Note that the current instruction design will not allow for more than one line of Description. +The naming and formats show that the instruction cannot have '^' in the title or category and can not have '=' in the description. + +Example: + +[Disposables^Cartridge Installation] +. Unlock pump track . Lock pump track =1.png +Insert cartridge using alignment pins =2.png +HD machine door open / HD machine door closed =3.png + Index: sources/ApplicationController.cpp =================================================================== diff -u -re159592e3a99658e661ab83fffef43322dc075f3 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision e159592e3a99658e661ab83fffef43322dc075f3) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -475,7 +475,7 @@ { // That is enough to call to the I function here to create the object in the thread that Settings is leaving in, // which currently is Application_Thread, since the Settings is created in that thread. - _SettingModel; + _Settings; QFuture<void> mFuture = QtConcurrent::run(this, &ApplicationController::settingsInit); _settingsWatcher.setFuture(mFuture); Index: sources/gui/GuiView.cpp =================================================================== diff -u -re159592e3a99658e661ab83fffef43322dc075f3 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/GuiView.cpp (.../GuiView.cpp) (revision e159592e3a99658e661ab83fffef43322dc075f3) +++ sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -132,6 +132,8 @@ { // coco begin validated: This needs user interaction to plug-in USB device // has been tested manually + usbReady (true ); + usbRemoved (false); emit didUSBDriveMount (); } // coco end @@ -145,6 +147,8 @@ { // coco begin validated: This needs user interaction to plug-in USB device // has been tested manually + usbReady (false); + usbRemoved (false); emit didUSBDriveUmount(); } // coco end @@ -158,6 +162,8 @@ { // coco begin validated: This needs user interaction to plug-in USB device // has been tested manually + usbReady (false); + usbRemoved (true ); emit didUSBDriveRemove(); } // coco end Index: sources/gui/GuiView.h =================================================================== diff -u -re159592e3a99658e661ab83fffef43322dc075f3 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/GuiView.h (.../GuiView.h) (revision e159592e3a99658e661ab83fffef43322dc075f3) +++ sources/gui/GuiView.h (.../GuiView.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -52,9 +52,13 @@ PROPERTY(quint8 , sdIsLow , false ) // this property will be set if the sd-card space gets lower than required amount in percent that has been defined in DriveWatcher. - PROPERTY(qint8, sdTooLowPecent, -1) // -1 means the event never happened + PROPERTY(qint8 , sdTooLowPecent, -1) // -1 means the event never happened // coco end + + PROPERTY(bool , usbReady , false) + PROPERTY(bool , usbRemoved , true ) + public: explicit GuiView(QObject *parent = nullptr); Index: sources/gui/qml/SDItem.qml =================================================================== diff -u -raad2e406efd1fc2589a19004eb86ca6277f41aea -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/SDItem.qml (.../SDItem.qml) (revision aad2e406efd1fc2589a19004eb86ca6277f41aea) +++ sources/gui/qml/SDItem.qml (.../SDItem.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -53,7 +53,6 @@ minimum : 0 maximum : _GuiView.sdTotal / 1000000 // convert to MB since the value in byte is too big for ProgressCircle. value : _GuiView.sdAvail / 1000000 // convert to MB since the value in byte is too big for ProgressCircle. - thickness: 1 color : ! _GuiView.sdIsReady ? "red" : _GuiView.sdIsReadOnly ? "gray" : _GuiView.sdIsLow ? Colors.red : "green" } Index: sources/gui/qml/components/Circle.qml =================================================================== diff -u -rdb2238dcf17941be6a3c587b55a3ef06b94cee96 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/components/Circle.qml (.../Circle.qml) (revision db2238dcf17941be6a3c587b55a3ef06b94cee96) +++ sources/gui/qml/components/Circle.qml (.../Circle.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -47,9 +47,9 @@ width : _root.width height : _root.height radius : _root.width - color : "Transparent" + color : Colors.transparent border.width: _root.thickness + shadowEdge * 2 - border.color: "Transparent" + border.color: Colors.transparent antialiasing: true Shape { id: _shape width: parent.width @@ -58,7 +58,7 @@ layer.smooth: true layer.textureSize: Qt.size(_shape.width * 2, _shape.height * 2) ShapePath { id: _path - fillColor: "Transparent" + fillColor: Colors.transparent strokeColor: Colors.borderButton strokeWidth: 1 capStyle: ShapePath.RoundCap Index: sources/gui/qml/components/ExportButton.qml =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/components/ExportButton.qml (.../ExportButton.qml) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/gui/qml/components/ExportButton.qml (.../ExportButton.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -24,7 +24,7 @@ width : 155 height : 50 - property bool exportTreatment: false + property var exportFunction : null anchors.margins: 35 @@ -33,11 +33,11 @@ font.pixelSize: Fonts.fontPixelButton * 0.75 } onClicked: { - if ( exportTreatment ) - _GuiView.doExportTreatment() - else + if ( exportFunction instanceof Function ) { + exportFunction() + } else { _GuiView.doExportLog() - + } } Connections { target: _GuiView Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -r5e3b27057e9c7dedf9c46e3881609b7e96c3fb71 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 5e3b27057e9c7dedf9c46e3881609b7e96c3fb71) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -36,6 +36,8 @@ property bool selectable : false property bool selected : false + property bool fading : false + readonly property alias isPressed : _mouseArea.pressed property color textColor : Colors.textButton @@ -79,6 +81,22 @@ color : _private.color() border.color: _private.borderColor() + + Rectangle { id: _rectAnim + visible : _root.fading + radius : width + color : Colors.transparent + anchors.fill: parent + SequentialAnimation { id: _clickAnimation + loops : Animation.Infinite + running : _rectAnim.visible + onStopped : _rectAnim.color = Colors.transparent + onFinished : _rectAnim.color = Colors.transparent + ColorAnimation { target: _rectAnim; property: "color"; to: Colors.transparent; duration: 2000; } + ColorAnimation { target: _rectAnim; property: "color"; to: _root.border.color; duration: 2000; } + } + } + property int touchExpanding : 0 signal pressed Index: sources/gui/qml/components/USBButton.qml =================================================================== diff -u -r73091a6f5717c0fc88e236c06c618ad361f30a3c -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/components/USBButton.qml (.../USBButton.qml) (revision 73091a6f5717c0fc88e236c06c618ad361f30a3c) +++ sources/gui/qml/components/USBButton.qml (.../USBButton.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -26,10 +26,12 @@ x: width - 10 text.text: qsTr("USB") text.font.pixelSize: Fonts.fontPixelButton * 0.75 - onPressed: { + onPressed : { _GuiView.doUSBDriveUmount() } + fading: ! _GuiView.usbReady && ! _GuiView.usbRemoved + Connections { target: _GuiView onDidUSBDriveRemove : _root.enabled = false onDidUSBDriveMount : _root.enabled = true Index: sources/gui/qml/pages/disinfect/DisinfectBase.qml =================================================================== diff -u -r2c3846821eda0903c34bb5fcf2aebcbde2d0343a -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/pages/disinfect/DisinfectBase.qml (.../DisinfectBase.qml) (revision 2c3846821eda0903c34bb5fcf2aebcbde2d0343a) +++ sources/gui/qml/pages/disinfect/DisinfectBase.qml (.../DisinfectBase.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -155,11 +155,12 @@ onSettingsChanged : { if ( instructionBased ) { var group = vSettings.groupFormat.arg(header.stepNames[stackStepIndex]).arg(title.text) - // DEBUG : console.debug(" 00000 ", group) - if ( vSettings.settings[group] !== undefined ) { - _root.instructionlocation = vSettings.settings[group].location - _root.instructionStepNames = vSettings.settings[group].keys - _root.instructionStepImages = vSettings.settings[group].values + var settingsGroup = vSettings.settings[group] + // DEBUG : console.debug(" 22222 ", group) + if ( settingsGroup !== undefined ) { + _root.instructionlocation = settingsGroup.location + _root.instructionStepNames = settingsGroup.keys + _root.instructionStepImages = settingsGroup.values } } } Index: sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml =================================================================== diff -u -r4afc91856c00e01dfb5d84bc54d2d92faefec0db -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml (.../PostTreatmentBase.qml) (revision 4afc91856c00e01dfb5d84bc54d2d92faefec0db) +++ sources/gui/qml/pages/posttreatment/PostTreatmentBase.qml (.../PostTreatmentBase.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -160,11 +160,12 @@ onSettingsChanged : { if ( instructionBased ) { var group = vSettings.groupFormat.arg(header.stepNames[stackStepIndex]).arg(title.text) - // DEBUG : console.debug(" 00000 ", group) - if ( vSettings.settings[group] !== undefined ) { - _root.instructionlocation = vSettings.settings[group].location - _root.instructionStepNames = vSettings.settings[group].keys - _root.instructionStepImages = vSettings.settings[group].values + var settingsGroup = vSettings.settings[group] + // DEBUG : console.debug(" 11111 ", group, settingsGroup) + if ( settingsGroup !== undefined ) { + _root.instructionlocation = settingsGroup.location + _root.instructionStepNames = settingsGroup.keys + _root.instructionStepImages = settingsGroup.values } } } Index: sources/gui/qml/pages/posttreatment/PostTreatmentReview.qml =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/pages/posttreatment/PostTreatmentReview.qml (.../PostTreatmentReview.qml) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ sources/gui/qml/pages/posttreatment/PostTreatmentReview.qml (.../PostTreatmentReview.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -34,10 +34,13 @@ readonly property alias itemsValue: _parametersGrid.itemsValue readonly property alias itemsUnit : _parametersGrid.itemsUnit + header.confirmText.text: qsTr("NEXT") + ExportButton { anchors.top : parent.top anchors.left : parent.left - exportTreatment : true + exportFunction : vPostTreatmentAdjustmentTreatmentLog.doExport + enabled : vPostTreatmentAdjustmentTreatmentLog.isIdle && _GuiView.usbReady } Rectangle { id: _backgroud @@ -77,79 +80,11 @@ rowSpacing : 0 columnSpacing : 50 lineColor : Colors.backgroundMain + itemsText : vPostTreatmentAdjustmentTreatmentLog.parametersTitle itemsValue : vPostTreatmentAdjustmentTreatmentLog.parametersText - itemsText : [ - qsTr("Blood Flow Rate" ), - qsTr("Dialysate Flow Rate" ), - qsTr("Treatment Duration" ), - qsTr("Actual Treatment Duration" ), - qsTr("Acid ConcentrateType" ), - qsTr("Bicarbonate Concentrate Type" ), - qsTr("Potassium Concentration" ), - qsTr("Calcium Concentration" ), - qsTr("Bicarbonate Concentration" ), - qsTr("Sodium Concentration" ), - qsTr("Dialysate Temperature" ), - qsTr("Dialyzer Type" ), - qsTr("Treatment DateTime" ), - qsTr("Average Blood Flow" ), - qsTr("Average Dialysate Flow" ), - qsTr("Dialysate Volume Used" ), - qsTr("Average Dialysate Temp" ), - qsTr("Target UF Volume" ), - qsTr("Actual UF Volume" ), - qsTr("Target UF Rate" ), - qsTr("Actual UF Rate" ), - qsTr("Saline Bolus Volume" ), - qsTr("Heparin Type" ), - qsTr("Heparin Concentration" ), - qsTr("Heparin Bolus Volume" ), - qsTr("Heparin Dispense Rate" ), - qsTr("Heparin Pre-Stop" ), - qsTr("Heparin Delivered Volume" ), - qsTr("Average Arterial Pressure" ), - qsTr("Average Venous Pressure" ), - qsTr("End Treatment Early Alarm" ), - qsTr("Device ID" ), - qsTr("Water Sample Test Result" ), - ] - itemsUnit : [ - Variables.unitTextFlowRate , - Variables.unitTextFlowRate , - Variables.unitTextDuration , - Variables.unitTextDuration , - "" , - "" , - Variables.unitTextConcentration , - Variables.unitTextConcentration , - Variables.unitTextConcentration , - Variables.unitTextConcentration , - Variables.unitTextTemperature , - "" , - "" , - Variables.unitTextFlowRate , - Variables.unitTextFlowRate , - Variables.unitTextVolume , - Variables.unitTextTemperature , - Variables.unitTextVolume , - Variables.unitTextVolume , - Variables.unitTextFlowRate , - Variables.unitTextFlowRate , - Variables.unitTextFluid , - "" , - Variables.unitTextHeparinConcentration , - Variables.unitTextFluid , - Variables.unitTextDispencingRate , - Variables.unitTextDuration , - Variables.unitTextFluid , - Variables.unitTextBloodPressure , - Variables.unitTextBloodPressure , - "" , - "" , - "" - ] - itemsValueLeftMargin : 350 - itemsUnitLeftMargin : 495 + itemsUnit : vPostTreatmentAdjustmentTreatmentLog.parametersUnit + itemsValueLeftMargin : 350 // if decreased maybe covered by title + itemsUnitLeftMargin : 470 // if increased will be covered by chevron if touchable itemsTouchable : [ 0,0,0,0,1,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0, Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -35,12 +35,6 @@ signal disposablesRemovalConfirm () signal disposablesRemovalBack () - PostTreatmentBase { id: _detialTest - onBackClicked: pop() - header.backVisible: true - header.confirmVisible: false - } - PostTreatmentBase { id: _patientDisconnectionConfirm property int stackStepIndex : 0 header.confirmVisible : true @@ -56,11 +50,18 @@ instructionBased : false onConfirmClicked : _root.treatmentReviewConfirm() onItemClicked : { - _detialTest.title.text = itemsText[vIndex] - push(_detialTest) + _detailTest.title.text = itemsText[vIndex] + push(_detailTest) } } + PostTreatmentBase { id: _detailTest + property int stackStepIndex : 1 + onBackClicked: pop() + header.backVisible: true + header.confirmVisible: false + } + PostTreatmentBase { id: _disposablesRemovalConfirm property int stackStepIndex : 2 header. backVisible : true Index: sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml =================================================================== diff -u -r4afc91856c00e01dfb5d84bc54d2d92faefec0db -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision 4afc91856c00e01dfb5d84bc54d2d92faefec0db) +++ sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -164,11 +164,13 @@ onSettingsChanged : { if ( instructionBased ) { var group = vSettings.groupFormat.arg(header.stepNames[stackStepIndex]).arg(title.text) - // DEBUG : console.debug(" 00000 ", group) - if ( vSettings.settings[group] !== undefined ) { - _root.instructionlocation = vSettings.settings[group].location - _root.instructionStepNames = vSettings.settings[group].keys - _root.instructionStepImages = vSettings.settings[group].values + var settingsGroup = vSettings.settings[group] + // DEBUG : var settingsCategory = vSettings.category["Instructions/Instructions"] + if ( settingsGroup !== undefined ) { + // DEBUG : console.debug(" 00000 ", group, settingsGroup, settingsCategory.groups) + _root.instructionlocation = settingsGroup.location + _root.instructionStepNames = settingsGroup.keys + _root.instructionStepImages = settingsGroup.values } } } Index: sources/main.h =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/main.h (.../main.h) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/main.h (.../main.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -49,6 +49,7 @@ static vCLASS _instance; \ return _instance; \ } \ +private: //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// extern int gFakeInterval; @@ -174,7 +175,39 @@ return vDEFVALUE ; \ } //--------------------------------------------------------------------------------// +#define NOTIFIER( vVARIABLE ) \ + Q_SIGNALS: \ + /*! \brief Property notify signal + \details The property notify signal (...Changed) + which will be emitted by property setter + - if only the value has been changed \n + - or it's the first time property is set. \n + \return current value + */\ + void vVARIABLE##Notified( const bool & v##vVARIABLE ); \ + private: \ + bool _##vVARIABLE = false; \ + protected: \ + /*! \brief Property getter + \details The property getter which reads the private variable + \return current value + */\ + bool vVARIABLE () const { \ + return _##vVARIABLE ; \ + } \ + /*! \brief Notifier setter + \details The notifier setter which update the private variable \n + emits the notifier (is...) signal on update. \n + the notify signal (is...) passes the new value as its parameter. \n + \param new value + */\ + void vVARIABLE ( const bool & v##vVARIABLE ) { \ + DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Notified( _##vVARIABLE ); \ + } //--------------------------------------------------------------------------------// +//--------------------------------------------------------------------------------// #define ACTION_VIEW_CONNECTION(vTYPE) \ connect(&_GuiController, SIGNAL(didActionReceive(const vTYPE &)), \ this, SLOT( onActionReceive(const vTYPE &))); Index: sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.cpp (.../MPostTreatmentAdjustTreatmentLogResponse.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.cpp (.../MPostTreatmentAdjustTreatmentLogResponse.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -46,7 +46,7 @@ _data.mHeparinConcentration .value, _data.mHeparinBolusVolume .value, _data.mHeparinDispenseRate .value, - _data.mHeparinPreStop .value, + _data.mHeparinStop .value, _data.mHeparinDeliveredVolume .value, _data.mAverageArterialPressure .value, _data.mAverageVenousPressure .value, @@ -58,77 +58,77 @@ bool MAdjustTreatmentLogResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position - if (GetValue(vByteArray, index, _data.mAccepted )) { - if (GetValue(vByteArray, index, _data.mReason )) { - if (GetValue(vByteArray, index, _data.mBloodFlowRate )) { - if (GetValue(vByteArray, index, _data.mDialysateFlowRate )) { - if (GetValue(vByteArray, index, _data.mTreatmentDuration )) { - if (GetValue(vByteArray, index, _data.mActualTreatmentDuration )) { - if (GetValue(vByteArray, index, _data.mAcidConcentrateType )) { - if (GetValue(vByteArray, index, _data.mBicarbonateConcentrateType )) { - if (GetValue(vByteArray, index, _data.mPotassiumConcentration )) { - if (GetValue(vByteArray, index, _data.mCalciumConcentration )) { - if (GetValue(vByteArray, index, _data.mBicarbonateConcentration )) { - if (GetValue(vByteArray, index, _data.mSodiumConcentration )) { - if (GetValue(vByteArray, index, _data.mDialysateTemperature )) { - if (GetValue(vByteArray, index, _data.mDialyzerType )) { - if (GetValue(vByteArray, index, _data.mTreatmentDateTime )) { - if (GetValue(vByteArray, index, _data.mAverageBloodFlow )) { - if (GetValue(vByteArray, index, _data.mAverageDialysateFlow )) { - if (GetValue(vByteArray, index, _data.mDialysateVolumeUsed )) { - if (GetValue(vByteArray, index, _data.mAverageDialysateTemp )) { - if (GetValue(vByteArray, index, _data.mTargetUFVolume )) { - if (GetValue(vByteArray, index, _data.mActualUFVolume )) { - if (GetValue(vByteArray, index, _data.mTargetUFRate )) { - if (GetValue(vByteArray, index, _data.mActualUFRate )) { - if (GetValue(vByteArray, index, _data.mSalineBolusVolume )) { - if (GetValue(vByteArray, index, _data.mHeparinType )) { - if (GetValue(vByteArray, index, _data.mHeparinConcentration )) { - if (GetValue(vByteArray, index, _data.mHeparinBolusVolume )) { - if (GetValue(vByteArray, index, _data.mHeparinDispenseRate )) { - if (GetValue(vByteArray, index, _data.mHeparinPreStop )) { - if (GetValue(vByteArray, index, _data.mHeparinDeliveredVolume )) { - if (GetValue(vByteArray, index, _data.mAverageArterialPressure )) { - if (GetValue(vByteArray, index, _data.mAverageVenousPressure )) { - if (GetValue(vByteArray, index, _data.mEndTreatmentEarlyAlarm )) { - if (GetValue(vByteArray, index, _data.mDeviceID )) { - if (GetValue(vByteArray, index, _data.mWaterSampleTestResult )) { + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + if (GetValue(vByteArray, index, _data.mBloodFlowRate )) + if (GetValue(vByteArray, index, _data.mDialysateFlowRate )) + if (GetValue(vByteArray, index, _data.mTreatmentDuration )) + if (GetValue(vByteArray, index, _data.mActualTreatmentDuration )) + if (GetValue(vByteArray, index, _data.mAcidConcentrateType )) + if (GetValue(vByteArray, index, _data.mBicarbonateConcentrateType )) + if (GetValue(vByteArray, index, _data.mPotassiumConcentration )) + if (GetValue(vByteArray, index, _data.mCalciumConcentration )) + if (GetValue(vByteArray, index, _data.mBicarbonateConcentration )) + if (GetValue(vByteArray, index, _data.mSodiumConcentration )) + if (GetValue(vByteArray, index, _data.mDialysateTemperature )) + if (GetValue(vByteArray, index, _data.mDialyzerType )) + if (GetValue(vByteArray, index, _data.mTreatmentDateTime )) + if (GetValue(vByteArray, index, _data.mAverageBloodFlow )) + if (GetValue(vByteArray, index, _data.mAverageDialysateFlow )) + if (GetValue(vByteArray, index, _data.mDialysateVolumeUsed )) + if (GetValue(vByteArray, index, _data.mAverageDialysateTemp )) + if (GetValue(vByteArray, index, _data.mTargetUFVolume )) + if (GetValue(vByteArray, index, _data.mActualUFVolume )) + if (GetValue(vByteArray, index, _data.mTargetUFRate )) + if (GetValue(vByteArray, index, _data.mActualUFRate )) + if (GetValue(vByteArray, index, _data.mSalineBolusVolume )) + if (GetValue(vByteArray, index, _data.mHeparinType )) + if (GetValue(vByteArray, index, _data.mHeparinConcentration )) + if (GetValue(vByteArray, index, _data.mHeparinBolusVolume )) + if (GetValue(vByteArray, index, _data.mHeparinDispenseRate )) + if (GetValue(vByteArray, index, _data.mHeparinStop )) + if (GetValue(vByteArray, index, _data.mHeparinDeliveredVolume )) + if (GetValue(vByteArray, index, _data.mAverageArterialPressure )) + if (GetValue(vByteArray, index, _data.mAverageVenousPressure )) + if (GetValue(vByteArray, index, _data.mEndTreatmentEarlyAlarm )) + if (GetValue(vByteArray, index, _data.mDeviceID )) + if (GetValue(vByteArray, index, _data.mWaterSampleTestResult )) return true ; - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } - } else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } } /*! @@ -166,7 +166,7 @@ data.mHeparinConcentration = _data.mHeparinConcentration .value; data.mHeparinBolusVolume = _data.mHeparinBolusVolume .value; data.mHeparinDispenseRate = _data.mHeparinDispenseRate .value; - data.mHeparinPreStop = _data.mHeparinPreStop .value; + data.mHeparinStop = _data.mHeparinStop .value; data.mHeparinDeliveredVolume = _data.mHeparinDeliveredVolume .value; data.mAverageArterialPressure = _data.mAverageArterialPressure .value; data.mAverageVenousPressure = _data.mAverageVenousPressure .value; Index: sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h =================================================================== diff -u -r98581b325c24eb5ef0ce0ce475ad15320d659140 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h (.../MPostTreatmentAdjustTreatmentLogResponse.h) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) +++ sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h (.../MPostTreatmentAdjustTreatmentLogResponse.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -64,7 +64,7 @@ * | #26:(U32) | \ref Data::mHeparinConcentration | (IU/mL) | * | #27:(F32) | \ref Data::mHeparinBolusVolume | (mL) | * | #28:(F32) | \ref Data::mHeparinDispenseRate | (mL/hr) | - * | #29:(U32) | \ref Data::mHeparinPreStop | (min) | + * | #29:(U32) | \ref Data::mHeparinStop | (min) | * | #30:(F32) | \ref Data::mHeparinDeliveredVolume | (mL) | * | #31:(F32) | \ref Data::mAverageArterialPressure | (mmHg) | * | #32:(F32) | \ref Data::mAverageVenousPressure | (mmHg) | @@ -119,7 +119,7 @@ Types::U32 mHeparinConcentration ; Types::F32 mHeparinBolusVolume ; Types::F32 mHeparinDispenseRate ; - Types::U32 mHeparinPreStop ; + Types::U32 mHeparinStop ; Types::F32 mHeparinDeliveredVolume ; Types::F32 mAverageArterialPressure ; Types::F32 mAverageVenousPressure ; @@ -163,7 +163,7 @@ quint32 mHeparinConcentration = 0; /*!< Heparin Concentration (IU/mL) */ float mHeparinBolusVolume = 0; /*!< Heparin Bolus Volume (mL) */ float mHeparinDispenseRate = 0; /*!< Heparin Dispense Rate (mL/hr) */ - quint32 mHeparinPreStop = 0; /*!< Heparin Pre-Stop (min) */ + quint32 mHeparinStop = 0; /*!< Heparin Stop (min) */ float mHeparinDeliveredVolume = 0; /*!< Heparin Delivered Volume (mL) */ float mAverageArterialPressure = 0; /*!< Average Arterial Pressure (mmHg) */ float mAverageVenousPressure = 0; /*!< Average Venous Pressure (mmHg) */ Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u --- sources/model/hd/alarm/MAlarmMapping.cpp (revision 0) +++ sources/model/hd/alarm/MAlarmMapping.cpp (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,232 @@ +/*! + * + * 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 MAlarmMapping.cpp + * \author (last) Behrouz NematiPour + * \date (last) 03-May-2021 + * \author (original) Behrouz NematiPour + * \date (original) 03-May-2021 + * + */ +#include "MAlarmStatusData.h" + +using namespace Model; +using namespace Gui; + +/*! + * \brief MAlarmStatus::toText + * \details Looks up the alarm description using the alarm enum + * \param vAlarmID - Alarm Id + * \return The alarm description + */ +QString MAlarmStatus::toText(GuiAlarmID vAlarmID) { + QString result; + if ( vAlarmID == 0 ) return result; + switch (vAlarmID) { + case GuiAlarmID::ALARM_ID_NO_ALARM : { result = QObject::tr("Indication for when no alarms is a possible situation." ); break; } + case GuiAlarmID::ALARM_ID_HD_SOFTWARE_FAULT : { result = QObject::tr("HD Software fault.\nSoftware found itself in an unexpected state." ); break; } + case GuiAlarmID::ALARM_ID_STUCK_BUTTON_TEST_FAILED : { result = QObject::tr("Stuck button POST failure.\nStop or Off button detected to be pressed for at least 1 second during test shortly after power up." ); break; } + case GuiAlarmID::ALARM_ID_FPGA_POST_TEST_FAILED : { result = QObject::tr("FPGA POST failure." ); break; } + case GuiAlarmID::ALARM_ID_WATCHDOG_POST_TEST_FAILED : { result = QObject::tr("Watchdog POST failure." ); break; } + case GuiAlarmID::ALARM_ID_UI_COMM_POST_FAILED : { result = QObject::tr("UI communication POST failure.\nUI failed to communicate within a reasonable time after power up." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Blood pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_OFF_CHECK : { result = QObject::tr("Blood pump failed motor off check.\nMeasured speed while commanded off." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MC_DIRECTION_CHECK : { result = QObject::tr("Blood pump failed motor direction check.\nMeasured vs commanded." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed rotor speed check.\nMismatch with rotor and motor speeds." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Dialysis inlet pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_OFF_CHECK : { result = QObject::tr("Dialysis inlet pump failed motor off check.\nMeasured speed while commanded off." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_MC_DIRECTION_CHECK : { result = QObject::tr("Dialysis inlet pump failed motor direction check.\nMeasured vs commanded." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_ROTOR_SPEED_CHECK : { result = QObject::tr("Dialysis inlet pump failed rotor speed check.\nMismatch with rotor and motor speeds." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Dialysis outlet pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_OFF_CHECK : { result = QObject::tr("Dialysis outlet pump failed motor off check.\nMeasured speed while commanded off." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_MC_DIRECTION_CHECK : { result = QObject::tr("Dialysis outlet pump failed motor direction check.\nMeasured vs commanded." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_ROTOR_SPEED_CHECK : { result = QObject::tr("Dialysis outlet pump failed rotor speed check.\nMismatch with rotor and motor speeds." ); break; } + case GuiAlarmID::ALARM_ID_WATCHDOG_EXPIRED : { result = QObject::tr("Watchdog expired error.\nWatchdog was not \"pet\" within the appropriate time." ); break; } + case GuiAlarmID::ALARM_ID_RTC_COMM_ERROR : { result = QObject::tr("Real-time clock communication error." ); break; } + case GuiAlarmID::ALARM_ID_RTC_CONFIG_ERROR : { result = QObject::tr("Real-time clock configuration error." ); break; } + case GuiAlarmID::ALARM_ID_DG_COMM_TIMEOUT : { result = QObject::tr("Dialysate generator communication timeout." ); break; } + case GuiAlarmID::ALARM_ID_UI_COMM_TIMEOUT : { result = QObject::tr("User interface communication timeout." ); break; } + case GuiAlarmID::ALARM_ID_COMM_TOO_MANY_BAD_CRCS : { result = QObject::tr("Too many bad CRCs detected on received system messages." ); break; } + case GuiAlarmID::ALARM_ID_TREATMENT_STOPPED_BY_USER : { result = QObject::tr("Treatment stopped by user action - pressed stop button." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_SITTING_WARNING : { result = QObject::tr("Blood sitting too long warning (>4 min)." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RESUME : { result = QObject::tr("Blood sitting too long alarm (>5 min)." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RINSEBACK : { result = QObject::tr("Blood sitting too long alarm (>10 min)." ); break; } + case GuiAlarmID::ALARM_ID_CAN_MESSAGE_NOT_ACKED : { result = QObject::tr("System message that required acknowledgment was not acknowledged." ); break; } + case GuiAlarmID::ALARM_ID_OCCLUSION_BLOOD_PUMP : { result = QObject::tr("Blood pump occlusion detected." ); break; } + case GuiAlarmID::ALARM_ID_OCCLUSION_DIAL_IN_PUMP : { result = QObject::tr("Dialysate inlet pump occlusion detected." ); break; } + case GuiAlarmID::ALARM_ID_OCCLUSION_DIAL_OUT_PUMP : { result = QObject::tr("Dialysate outlet pump occlusion detected." ); break; } + case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_LOW : { result = QObject::tr("Arterial pressure too low during treatment." ); break; } + case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_HIGH : { result = QObject::tr("Arterial pressure too high during treatment." ); break; } + case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_LOW : { result = QObject::tr("Venous pressure too low during treatment." ); break; } + case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_HIGH : { result = QObject::tr("Venous pressure too high during treatment." ); break; } + case GuiAlarmID::ALARM_ID_UF_RATE_TOO_HIGH_ERROR : { result = QObject::tr("Ultrafiltration rate is too high error during treatment." ); break; } + case GuiAlarmID::ALARM_ID_UF_VOLUME_ACCURACY_ERROR : { result = QObject::tr("Ultrafiltration volume accuracy error during treatment." ); break; } + case GuiAlarmID::ALARM_ID_RTC_BATTERY_LOW : { result = QObject::tr("RTC battery low." ); break; } + case GuiAlarmID::ALARM_ID_RTC_OR_TIMER_ACCURACY_FAILURE : { result = QObject::tr("RTC or MCU timer inaccurate." ); break; } + case GuiAlarmID::ALARM_ID_RTC_RAM_OPS_ERROR : { result = QObject::tr("RTC (i.e read time) or RAM operations failure (read or write)." ); break; } + case GuiAlarmID::ALARM_ID_NVDATA_EEPROM_OPS_FAILURE : { result = QObject::tr("EEPROM operations (read, write, erase) failure." ); break; } + case GuiAlarmID::ALARM_ID_NVDATA_MFG_RECORD_CRC_ERROR : { result = QObject::tr("Manufacturing record CRC failure." ); break; } + case GuiAlarmID::ALARM_ID_NVDATA_SRVC_RECORD_CRC_ERROR : { result = QObject::tr("Service record CRC failure." ); break; } + case GuiAlarmID::ALARM_ID_NVDATA_CAL_RECORD_CRC_ERROR : { result = QObject::tr("Calibration record CRC failure." ); break; } + case GuiAlarmID::ALARM_ID_NVDATA_HW_USAGE_DATA_CRC_ERROR : { result = QObject::tr("HW usage data (treatment time in HD and total consumed water in DG) failure." ); break; } + case GuiAlarmID::AlARM_ID_NVDATA_DISINFECTION_DATE_CRC_ERROR : { result = QObject::tr("Last disinfection date CRC error." ); break; } + case GuiAlarmID::ALARM_ID_RO_PUMP_OUT_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("Pressure at outlet of RO pump is out of range." ); break; } + case GuiAlarmID::ALARM_ID_TEMPERATURE_SENSORS_FAULT : { result = QObject::tr("DG temperature sensors fault." ); break; } + case GuiAlarmID::ALARM_ID_FPGA_COMM_TIMEOUT : { result = QObject::tr("FPGA communication down for too long." ); break; } + case GuiAlarmID::ALARM_ID_HD_COMM_TIMEOUT : { result = QObject::tr("HD communication timeout." ); break; } + case GuiAlarmID::ALARM_ID_VALVE_CONTROL_FAILURE : { result = QObject::tr("FPGA not accepting commanded valve states." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate inlet pump failed flow vs motor speed check.\nMismatch with flow rate and rate implied by motor speed." ); break; } + case GuiAlarmID::ALARM_ID_HD_PRIME_PURGE_AIR_TIME_OUT : { result = QObject::tr("HD time out on prime sub-mode purge air state." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed motor speed check.\nMeasured vs commanded." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate inlet pump failed motor speed check.\nMeasured vs commanded." ); break; } + case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate outlet pump failed motor speed check.\nMeasured vs commanded." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_TOO_HIGH : { result = QObject::tr("Blood pump rotor speed too high." ); break; } + case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_CONDUCTIVITY : { result = QObject::tr("Inlet water conductivity too low." ); break; } + case GuiAlarmID::ALARM_ID_INLET_WATER_HIGH_CONDUCTIVITY : { result = QObject::tr("Inlet water conductivity too high." ); break; } + case GuiAlarmID::ALARM_ID_DG_SOFTWARE_FAULT : { result = QObject::tr("DG software fault.\nSoftware found itself in an unexpected state." ); break; } + case GuiAlarmID::ALARM_ID_CONDUCTIVITY_SENSOR_FAULT : { result = QObject::tr("Conductivity sensor fault." ); break; } + case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_TEMPERATURE : { result = QObject::tr("Inlet water temperature too low." ); break; } + case GuiAlarmID::ALARM_ID_INLET_WATER_HIGH_TEMPERATURE : { result = QObject::tr("Inlet water temperature too high." ); break; } + case GuiAlarmID::ALARM_ID_PRESSURE_SENSOR_FAULT : { result = QObject::tr("Pressure sensor fault." ); break; } + case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_PRESSURE : { result = QObject::tr("Inlet water pressure too low." ); break; } + case GuiAlarmID::ALARM_ID_HD_CRITICAL_DATA_ERROR : { result = QObject::tr("HD critical data integrity check failed." ); break; } + case GuiAlarmID::ALARM_ID_HD_ACCELEROMETER_SELF_TEST_FAILURE : { result = QObject::tr("HD accelerometer failed POST." ); break; } + case GuiAlarmID::ALARM_ID_DG_ACCELEROMETER_SELF_TEST_FAILURE : { result = QObject::tr("DG accelerometer failed POST." ); break; } + case GuiAlarmID::ALARM_ID_HD_EXCESSIVE_TILT : { result = QObject::tr("HD tilt exceeds maximum." ); break; } + case GuiAlarmID::ALARM_ID_DG_EXCESSIVE_TILT : { result = QObject::tr("DG tilt exceeds maximum." ); break; } + case GuiAlarmID::ALARM_ID_HD_SHOCK : { result = QObject::tr("HD experienced large acceleration." ); break; } + case GuiAlarmID::ALARM_ID_DG_SHOCK : { result = QObject::tr("DG experienced large acceleration." ); break; } + case GuiAlarmID::ALARM_ID_HD_ACCELEROMETER_FAILURE : { result = QObject::tr("HD accelerometer error (no readings or FPGA reports error)." ); break; } + case GuiAlarmID::ALARM_ID_DG_ACCELEROMETER_FAILURE : { result = QObject::tr("DG accelerometer error (no readings or FPGA reports error)." ); break; } + case GuiAlarmID::ALARM_ID_DG_CRITICAL_DATA_ERROR : { result = QObject::tr("DG critical data integrity check failed." ); break; } + case GuiAlarmID::ALARM_ID_RO_REJECTION_RATIO_OUT_OF_RANGE : { result = QObject::tr("RO rejection ratio out of range." ); break; } + case GuiAlarmID::ALARM_ID_INLET_WATER_PRESSURE_FAULT : { result = QObject::tr("Inlet water pressure fault." ); break; } + case GuiAlarmID::ALARM_ID_HD_VALVE_HOMING_FAILED : { result = QObject::tr("HD valve homing failed." ); break; } + case GuiAlarmID::ALARM_ID_HD_VALVE_TRANSITION_TIMEOUT : { result = QObject::tr("HD valve transition time out." ); break; } + case GuiAlarmID::ALARM_ID_HD_VALVE_NOT_FUNCTIONAL : { result = QObject::tr("HD valve not functional." ); break; } + case GuiAlarmID::ALARM_ID_HD_VALVE_CURRENT_OUT_OF_RANGE : { result = QObject::tr("HD valve current out of range." ); break; } + case GuiAlarmID::ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE : { result = QObject::tr("HD valve position out of target." ); break; } + case GuiAlarmID::ALARM_ID_AIR_TRAP_ILLEGAL_LEVELS : { result = QObject::tr("Air trap level sensors reporting illegal combination of air/fluid." ); break; } + case GuiAlarmID::ALARM_ID_AIR_TRAP_FILL_DURING_PRIME : { result = QObject::tr("Air trap fill timeout during priming." ); break; } + case GuiAlarmID::ALARM_ID_AIR_TRAP_FILL_DURING_TREATMENT : { result = QObject::tr("Air trap fill timeout during treatment." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_FLOW_SIGNAL_STRENGTH_TOO_LOW : { result = QObject::tr("Blood flow sensor signal strength too low." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_FLOW_SIGNAL_STRENGTH_TOO_LOW : { result = QObject::tr("Dialysate flow sensor signal strength too low." ); break; } + case GuiAlarmID::ALARM_ID_EMPTY_SALINE_BAG : { result = QObject::tr("HD Saline bag is empty." ); break; } + case GuiAlarmID::ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE : { result = QObject::tr("HD Saline bolus volume check failure." ); break; } + case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT : { result = QObject::tr("FPGA reports failure reading arterial pressure sensor." ); break; } + case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT : { result = QObject::tr("FPGA reports failure reading venous pressure sensor." ); break; } + case GuiAlarmID::ALARM_ID_UV_REACTOR_NOT_HEALTHY : { result = QObject::tr("UV reactor not healthy (either inlet or outlet)." ); break; } + case GuiAlarmID::ALARM_ID_ACID_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Concentrate conductivity after adding acid out of range alarm." ); break; } + case GuiAlarmID::ALARM_ID_BICARB_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Concentrate conductivity after adding bicarb out of range alarm." ); break; } + case GuiAlarmID::ALARM_ID_RO_PUMP_FLOW_RATE_OUT_OF_RANGE : { result = QObject::tr("RO pump flow rate out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_THERMISTORS_TEMPERATURE_OUT_OF_RANGE : { result = QObject::tr("DG thermistors/sensors temperature out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_FAN_RPM_OUT_OF_RANGE : { result = QObject::tr("DG fan RPM out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_DIALYSATE_FILL_OUT_OF_TIME : { result = QObject::tr("DG dialysate fill runs out of time." ); break; } + case GuiAlarmID::ALARM_ID_CP1_SPEED_CONTROL_ERROR : { result = QObject::tr("DG concentrate pump CP1 speed control error." ); break; } + case GuiAlarmID::ALARM_ID_CP2_SPEED_CONTROL_ERROR : { result = QObject::tr("DG concentrate pump CP2 speed control error." ); break; } + case GuiAlarmID::ALARM_ID_FLOW_RATE_OUT_OF_UPPER_RANGE : { result = QObject::tr("DG flow rate out of upper range." ); break; } + case GuiAlarmID::ALARM_ID_RO_PUMP_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("DG RO pump pressure out of range." ); break; } + case GuiAlarmID::ALARM_ID_DRAIN_PUMP_RPM_OUT_OF_RANGE : { result = QObject::tr("DG drain pump RPM out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEATERS_NEGATIVE_COLD_JUNCTION_TEMPERATURE : { result = QObject::tr("DG heaters cold junction temperature out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEATERS_FAULT : { result = QObject::tr("DG heaters fault." ); break; } + case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_WARNING : { result = QObject::tr("HD end of treatment warning." ); break; } + case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_ALARM : { result = QObject::tr("HD end of treatment alarm (user not acting to end treatment)." ); break; } + case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_HIGH : { result = QObject::tr("HD end of treatment alarm (high priority - user still not acting to end treatment)." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEAT_DISINFECT_CYCLE_FAILED : { result = QObject::tr("DG heat disinfect cycle failed." ); break; } + case GuiAlarmID::ALARM_ID_RO_PUMP_RAMP_UP_TO_FLOW_TIMEOUT : { result = QObject::tr("DG RO pump ramp up to target flow time out." ); break; } + case GuiAlarmID::ALARM_ID_FLOW_RATE_OUT_OF_LOWER_RANGE : { result = QObject::tr("DG flow rate out of lower range." ); break; } + case GuiAlarmID::ALARM_ID_DRAIN_PUMP_OFF_FAULT : { result = QObject::tr("DG drain pump off fault." ); break; } + case GuiAlarmID::ALARM_ID_RO_PUMP_OFF_FAULT : { result = QObject::tr("DG RO pump off fault." ); break; } + case GuiAlarmID::ALARM_ID_PRIME_DIALYSATE_DIALYZER_TIME_OUT : { result = QObject::tr("HD prime dialysate dialyzer time out alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRIME_DIALYSATE_BYPASS_TIME_OUT : { result = QObject::tr("HD prime dialysate bypass time out alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRIME_COMPLETED_LOW_PRIORITY : { result = QObject::tr("HD prime completed low priority alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRIME_COMPLETED_MEDIUM_PRIORITY : { result = QObject::tr("HD prime completed medium priority alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRIME_COMPLETED_HIGH_PRIORITY : { result = QObject::tr("HD prime completed high priority alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRIME_OUT_OF_TIME : { result = QObject::tr("HD prime out of time alarm." ); break; } + case GuiAlarmID::ALARM_ID_DG_COMMAND_INVALID_PARAMETER_FAULT : { result = QObject::tr("HD requests DG command with invalid parameter fault." ); break; } + case GuiAlarmID::ALARM_ID_HD_LOAD_CELL_ACCELERATION_RES_1_ALARM : { result = QObject::tr("HD sees primary load cell for reservoir 1 change too much too fast." ); break; } + case GuiAlarmID::ALARM_ID_HD_LOAD_CELL_ACCELERATION_RES_2_ALARM : { result = QObject::tr("HD sees primary load cell for reservoir 1 change too much too fast." ); break; } + case GuiAlarmID::ALARM_ID_TREATMENT_STOPPED_AFTER_RINSEBACK : { result = QObject::tr("HD in treatment stopped sub-mode after rinseback completed (no escalation)." ); break; } + case GuiAlarmID::ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM : { result = QObject::tr("HD in treatment rinseback operation timeout." ); break; } + case GuiAlarmID::ALARM_ID_TREATMENT_RECIRC_TIMEOUT_ALARM : { result = QObject::tr("HD in treatment re-circ sub-mode for too long." ); break; } + case GuiAlarmID::ALARM_ID_CARTRIDGE_DOOR_OPENED : { result = QObject::tr("HD cartridge door opened alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRE_TREATMENT_NO_CART_SELF_TEST_FAILURE : { result = QObject::tr("HD pre-treatment mode no cartridge self-tests failure." ); break; } + case GuiAlarmID::ALARM_ID_INSTALL_NEW_CARTRIDGE : { result = QObject::tr("HD needs new cartridge to be installed." ); break; } + case GuiAlarmID::ALARM_ID_CARTRIDGE_INSTALLED_IMPROPERLY : { result = QObject::tr("HD cartridge installed improperly alarm." ); break; } + case GuiAlarmID::ALARM_ID_RINSEBACK_VOLUME_CHECK_FAILURE : { result = QObject::tr("HD rinseback volume check failure." ); break; } + case GuiAlarmID::ALARM_ID_NO_CARTRIDGE_LOADED : { result = QObject::tr("HD no cartridge loaded alarm." ); break; } + case GuiAlarmID::ALARM_ID_END_TREATMENT_TIMEOUT_ALARM : { result = QObject::tr("HD end treatment sub-mode timeout alarm." ); break; } + case GuiAlarmID::ALARM_ID_BLOOD_PRIME_VOLUME_CHECK_FAILURE : { result = QObject::tr("HD blood prime volume check failure." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_TEMPERATURE_TOO_HIGH : { result = QObject::tr("HD dialysate temperature too high alarm." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_TEMPERATURE_TOO_LOW : { result = QObject::tr("HD dialysate temperature too low alarm." ); break; } + case GuiAlarmID::ALARM_ID_PRE_TREATMENT_DRY_SELF_TEST_FAILURE : { result = QObject::tr("HD pre-treatment mode dry self-tests failure." ); break; } + case GuiAlarmID::ALARM_ID_PRE_TREATMENT_WET_SELF_TEST_FAILURE : { result = QObject::tr("HD pre-treatment mode wet self-tests failure." ); break; } + case GuiAlarmID::ALARM_ID_DG_FLOW_METER_CHECK_FAILURE : { result = QObject::tr("DG flow meter check failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_DG_RO_PUMP_TOO_MANY_RAMP_UP_RETRY : { result = QObject::tr("DG RO pump ramp up exceed maximum allowed number of retries." ); break; } + case GuiAlarmID::ALARM_ID_NVDATAMGMT_GROUP_RECORD_CRC_INVALID : { result = QObject::tr("DG/HD NV data management overall group record CRC invalid." ); break; } + case GuiAlarmID::ALARM_ID_NVDATAMGMT_INDIVIDUAL_RECORD_CRC_INVALID : { result = QObject::tr("DG/HD NV data management individual record CRC invalid." ); break; } + case GuiAlarmID::ALARM_ID_NVDATAMGMT_INDIVIDUAL_RECORD_TIME_INVALID : { result = QObject::tr("DG/HD NV data management individual record time invalid." ); break; } + case GuiAlarmID::ALARM_ID_HD_AC_POWER_LOST : { result = QObject::tr("HD AC power lost alarm." ); break; } + case GuiAlarmID::ALARM_ID_DG_RESTARTED_FAULT : { result = QObject::tr("HD reports DG restarted fault." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Dialysate conductivity out of range." ); break; } + case GuiAlarmID::ALARM_ID_HD_FLUID_LEAK_DETECTED : { result = QObject::tr("HD fluid leak detected alarm." ); break; } + case GuiAlarmID::ALARM_ID_DG_FLUID_LEAK_DETECTED : { result = QObject::tr("DG fluid leak detected alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_ADC_ERROR : { result = QObject::tr("HD syringe pump ADC error." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_DETECTED : { result = QObject::tr("HD syringe detected alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_VOLUME_ERROR : { result = QObject::tr("HD syringe pump volume check error." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_SPEED_ERROR : { result = QObject::tr("HD syringe pump speed check error." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_SYRINGE_EMPTY : { result = QObject::tr("HD syringe empty alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_OCCLUSION : { result = QObject::tr("HD syringe pump occlusion alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_SYRINGE_REMOVED : { result = QObject::tr("HD syringe pump syringe removed alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_NOT_STOPPED_ERROR : { result = QObject::tr("HD syringe pump not stopped in off state error." ); break; } + case GuiAlarmID::ALARM_ID_HD_BLOOD_LEAK_DETECTED : { result = QObject::tr("HD blood leak detected alarm." ); break; } + case GuiAlarmID::ALARM_ID_CARTRIDGE_REMOVAL_FAILURE : { result = QObject::tr("HD fail to remove cartridge alarm." ); break; } + case GuiAlarmID::ALARM_ID_DG_RESERVOIR_DRAIN_TIMEOUT : { result = QObject::tr("DG reservoir drain time out." ); break; } + case GuiAlarmID::ALARM_ID_DG_RESERVOIR_FILL_TIMEOUT : { result = QObject::tr("DG reservoir fill time out." ); break; } + case GuiAlarmID::ALARM_ID_DG_RESERVOIR_LEAK_TIMEOUT : { result = QObject::tr("DG reservoir leak time out." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEAT_DISINFECT_TARGET_TEMP_TIMEOUT : { result = QObject::tr("DG heat disinfect target temperature time out (could not reach to temperature)." ); break; } + case GuiAlarmID::ALARM_ID_DG_TEMP_SENSORS_DIFF_OUT_OF_RANGE : { result = QObject::tr("DG temperature sensors difference out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEAT_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT: { result = QObject::tr("DG heat disinfect inlet pressure and temperature sensors out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEAT_DISINFECT_INLET_COND_AND_TEMP_OUT : { result = QObject::tr("DG heat disinfect inlet conductivity and temperature out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_BAD_INLET_WATER_QUALITY : { result = QObject::tr("Inlet water quality is bad (temperature, conductivity, pressure)." ); break; } + case GuiAlarmID::ALARM_ID_HD_BP_OCCLUSION_SELF_TEST_FAILURE : { result = QObject::tr("HD blood pump occlusion self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_DIP_OCCLUSION_SELF_TEST_FAILURE : { result = QObject::tr("HD dialysate inlet pump occlusion self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_DOP_OCCLUSION_SELF_TEST_FAILURE : { result = QObject::tr("HD dialysate outlet pump occlusion self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_ARTERIAL_PRESSURE_SELF_TEST_FAILURE : { result = QObject::tr("HD arterial pressure self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_VENOUS_PRESSURE_SELF_TEST_FAILURE : { result = QObject::tr("HD venous pressure self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_BLOOD_FLOW_STATUS_SELF_TEST_FAILURE : { result = QObject::tr("HD blood flow meter status check self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_DIALYSATE_FLOW_STATUS_SELF_TEST_FAILURE : { result = QObject::tr("HD dialysate flow meter status check self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_BLOOD_LEAK_SELF_TEST_FAILURE : { result = QObject::tr("HD blood leak detector self-test failure alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_BLOOD_LEAK_FAULT : { result = QObject::tr("HD blood leak detector fault." ); break; } + case GuiAlarmID::ALARM_ID_DG_LOAD_CELLS_INVALID_CALIBRATION : { result = QObject::tr("DG load cells invalid calibration." ); break; } + case GuiAlarmID::ALARM_ID_HD_VOLTAGE_OUT_OF_RANGE : { result = QObject::tr("HD monitored voltage is out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_PRIMARY_HEATERS_INTERNAL_TEMP_OUT_OF_RANGE : { result = QObject::tr("DG primary heaters internal temperature out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_TRIMMER_HEATER_INTERNAL_TEMP_OUT_OF_RANGE : { result = QObject::tr("DG trimmer heater internal temperature out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_HEATERS_ON_WITH_NO_FLOW_TIMEOUT : { result = QObject::tr("DG heaters on with no flow time out." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_CONDUCTIVITY_FAULT : { result = QObject::tr("DG dialysate generation conductivity fault alarm." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_TEMPERATURE_HIGH : { result = QObject::tr("HD dialysate temperature too high alarm." ); break; } + case GuiAlarmID::ALARM_ID_DIALYSATE_TEMPERATURE_LOW : { result = QObject::tr("HD dialysate temperature too low alarm." ); break; } + case GuiAlarmID::ALARM_ID_DG_VOLTAGE_OUT_OF_RANGE : { result = QObject::tr("DG monitored voltage is out of range." ); break; } + case GuiAlarmID::ALARM_ID_DG_DRAIN_CIRCULATION_LINE_TIMEOUT : { result = QObject::tr("DG drain circulation line timeout." ); break; } + case GuiAlarmID::ALARM_ID_DG_INVALID_LOAD_CELL_VALUE : { result = QObject::tr("DG invalid load cell value." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_ENCODER_DIRECTION_ERROR : { result = QObject::tr("HD syringe pump direction (from encoder) error." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_CONTROLLER_DIRECTION_ERROR : { result = QObject::tr("HD syringe pump direction (from controller) error." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_FAULT : { result = QObject::tr("HD syringe pump fault reported by FPGA." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_OVER_TRAVEL_ERROR : { result = QObject::tr("HD syringe pump over travel error." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_NOT_ENOUGH_HEPARIN_ALARM : { result = QObject::tr("HD syringe pump not enough Heparin alarm." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_DAC_WRITE_ERROR : { result = QObject::tr("HD syringe pump DAC write failure." ); break; } + case GuiAlarmID::ALARM_ID_HD_SYRINGE_PUMP_RUNNING_WHILE_BP_OFF_ERROR : { result = QObject::tr("HD syringe pump is running while the BP is off." ); break; } + case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } + + default: + result = QObject::tr("ALARM_ID_UNDEFINED [%1]").arg(int(vAlarmID)); + break; + } + return result; +} + Index: sources/model/hd/alarm/MAlarmStatusData.cpp =================================================================== diff -u -rc0c63c4b149dafea2b02e4cd31f223e392ff7818 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/model/hd/alarm/MAlarmStatusData.cpp (.../MAlarmStatusData.cpp) (revision c0c63c4b149dafea2b02e4cd31f223e392ff7818) +++ sources/model/hd/alarm/MAlarmStatusData.cpp (.../MAlarmStatusData.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -57,130 +57,3 @@ data.mFlags = _data.mFlags ; return data; } - -/*! - * \brief MAlarmStatus::toText - * \details Looks up the alarm description using the alarm enum - * \param vAlarmID - Alarm Id - * \return The alarm description - */ -QString MAlarmStatus::toText(GuiAlarmID vAlarmID) { - QString result; - switch (vAlarmID) { - case GuiAlarmID::ALARM_ID_NO_ALARM : { result = QObject::tr("" ); break; } - case GuiAlarmID::ALARM_ID_HD_SOFTWARE_FAULT : { result = QObject::tr("Software Error." ); break; } - case GuiAlarmID::ALARM_ID_STUCK_BUTTON_TEST_FAILED : { result = QObject::tr("Stuck button POST failure." ); break; } - case GuiAlarmID::ALARM_ID_FPGA_POST_TEST_FAILED : { result = QObject::tr("FPGA POST failure." ); break; } - case GuiAlarmID::ALARM_ID_WATCHDOG_POST_TEST_FAILED : { result = QObject::tr("Watchdog POST failure." ); break; } - case GuiAlarmID::ALARM_ID_UI_COMM_POST_FAILED : { result = QObject::tr("UI communication POST failure." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Blood pump failed motor controller current check." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_OFF_CHECK : { result = QObject::tr("Blood pump failed motor off check. \nMeasured speed while commanded off." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MC_DIRECTION_CHECK : { result = QObject::tr("Blood pump failed motor controller direction check." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed rotor speed check." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Dialysis inlet pump failed motor controller current check." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_OFF_CHECK : { result = QObject::tr("Dialysis inlet pump failed motor off check. \nMeasured speed while commanded off." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_MC_DIRECTION_CHECK : { result = QObject::tr("Dialysis inlet pump failed motor controller direction check." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_ROTOR_SPEED_CHECK : { result = QObject::tr("Dialysis inlet pump failed rotor speed check." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_MC_CURRENT_CHECK : { result = QObject::tr("Dialysis outlet pump failed motor controller current check." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_OFF_CHECK : { result = QObject::tr("Dialysis outlet pump failed motor off check. \nMeasured speed while commanded off." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_MC_DIRECTION_CHECK : { result = QObject::tr("Dialysis outlet pump failed motor controller direction check." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_ROTOR_SPEED_CHECK : { result = QObject::tr("Dialysis outlet pump failed rotor speed check." ); break; } - case GuiAlarmID::ALARM_ID_WATCHDOG_EXPIRED : { result = QObject::tr("Watchdog expired error." ); break; } - case GuiAlarmID::ALARM_ID_RTC_COMM_ERROR : { result = QObject::tr("Real-time clock communication error." ); break; } - case GuiAlarmID::ALARM_ID_RTC_CONFIG_ERROR : { result = QObject::tr("Real-time clock configuration error." ); break; } - case GuiAlarmID::ALARM_ID_DG_COMM_TIMEOUT : { result = QObject::tr("Dialysate generator communication timeout." ); break; } - case GuiAlarmID::ALARM_ID_UI_COMM_TIMEOUT : { result = QObject::tr("User interface communication timeout." ); break; } - case GuiAlarmID::ALARM_ID_COMM_TOO_MANY_BAD_CRCS : { result = QObject::tr("Too many bad CRCs detected on received system messages." ); break; } - case GuiAlarmID::ALARM_ID_TREATMENT_STOPPED_BY_USER : { result = QObject::tr("Treatment stopped by user action - pressed stop button." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_SITTING_WARNING : { result = QObject::tr("Blood sitting too long warning (>4 min)." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RESUME : { result = QObject::tr("Blood sitting too long alarm (>5 min)." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RINSEBACK : { result = QObject::tr("Blood sitting too long alarm (>10 min)." ); break; } - case GuiAlarmID::ALARM_ID_CAN_MESSAGE_NOT_ACKED : { result = QObject::tr("System message needing acknowledgment was not acknowledged." ); break; } - case GuiAlarmID::ALARM_ID_OCCLUSION_BLOOD_PUMP : { result = QObject::tr("Blood pump occlusion detected." ); break; } - case GuiAlarmID::ALARM_ID_OCCLUSION_DIAL_IN_PUMP : { result = QObject::tr("Dialysate inlet pump occlusion detected." ); break; } - case GuiAlarmID::ALARM_ID_OCCLUSION_DIAL_OUT_PUMP : { result = QObject::tr("Dialysate outlet pump occlusion detected." ); break; } - case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_LOW : { result = QObject::tr("Arterial pressure too low during treatment." ); break; } - case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_HIGH : { result = QObject::tr("Arterial pressure too high during treatment." ); break; } - case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_LOW : { result = QObject::tr("Venous pressure too low during treatment." ); break; } - case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_HIGH : { result = QObject::tr("Venous pressure too high during treatment." ); break; } - case GuiAlarmID::ALARM_ID_UF_RATE_TOO_HIGH_ERROR : { result = QObject::tr("Ultrafiltration rate is too high error during treatment." ); break; } - case GuiAlarmID::ALARM_ID_UF_VOLUME_ACCURACY_ERROR : { result = QObject::tr("Ultrafiltration volume accuracy error during treatment." ); break; } - case GuiAlarmID::ALARM_ID_RTC_BATTERY_LOW : { result = QObject::tr("RTC battery low." ); break; } - case GuiAlarmID::ALARM_ID_RTC_OR_TIMER_ACCURACY_FAILURE : { result = QObject::tr("RTC or MCU timer inaccurate." ); break; } - case GuiAlarmID::ALARM_ID_RTC_RAM_OPS_ERROR : { result = QObject::tr("RTC or RAM operations failure (read or write)." ); break; } - case GuiAlarmID::ALARM_ID_NVDATA_EEPROM_OPS_FAILURE : { result = QObject::tr("EEPRON operations (read, write, erase) failure." ); break; } - case GuiAlarmID::ALARM_ID_NVDATA_MFG_RECORD_CRC_ERROR : { result = QObject::tr("Manufacturing record CRC failure." ); break; } - case GuiAlarmID::ALARM_ID_NVDATA_SRVC_RECORD_CRC_ERROR : { result = QObject::tr("Service record CRC failure." ); break; } - case GuiAlarmID::ALARM_ID_NVDATA_CAL_RECORD_CRC_ERROR : { result = QObject::tr("Calibration record CRC failure." ); break; } - case GuiAlarmID::ALARM_ID_NVDATA_HW_USAGE_DATA_CRC_ERROR : { result = QObject::tr("HW usage data failure." ); break; } - case GuiAlarmID::AlARM_ID_NVDATA_DISINFECTION_DATE_CRC_ERROR : { result = QObject::tr("Last disinfection date CRC error." ); break; } - case GuiAlarmID::ALARM_ID_RO_PUMP_OUT_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("Pressure at outlet of RO pump is out of range." ); break; } - case GuiAlarmID::ALARM_ID_TEMPERATURE_SENSORS_FAULT : { result = QObject::tr("DG temperature sensors fault." ); break; } - case GuiAlarmID::ALARM_ID_FPGA_COMM_TIMEOUT : { result = QObject::tr("FPGA communication down for too long" ); break; } - case GuiAlarmID::ALARM_ID_HD_COMM_TIMEOUT : { result = QObject::tr("HD communication timeout." ); break; } - case GuiAlarmID::ALARM_ID_VALVE_CONTROL_FAILURE : { result = QObject::tr("FPGA not accepting commanded valve states." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed flow vs. motor speed check. \nMismatch with flow rate and rate implied by motor speed." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate inlet pump failed flow vs. motor speed check. \nMismatch with flow rate and rate implied by motor speed." ); break; } - //// TODO: Has been removed // case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_FLOW_VS_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate outlet pump failed flow vs. motor speed check. \nMismatch with flow rate and rate implied by motor speed." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_MOTOR_SPEED_CHECK : { result = QObject::tr("Blood pump failed motor speed check. Measured vs. commanded." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_IN_PUMP_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate inlet pump failed motor speed check. Measured vs. commanded." ); break; } - case GuiAlarmID::ALARM_ID_DIAL_OUT_PUMP_MOTOR_SPEED_CHECK : { result = QObject::tr("Dialysate outlet pump failed motor speed check. Measured vs. commanded." ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_TOO_HIGH : { result = QObject::tr("Blood pump rotor speed too high." ); break; } - case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_CONDUCTIVITY : { result = QObject::tr("Inlet water conductivity too low." ); break; } - case GuiAlarmID::ALARM_ID_INLET_WATER_HIGH_CONDUCTIVITY : { result = QObject::tr("Inlet water conductivity too high" ); break; } - case GuiAlarmID::ALARM_ID_DG_SOFTWARE_FAULT : { result = QObject::tr("DG software fault. Software found itself in an unexpected state" ); break; } - case GuiAlarmID::ALARM_ID_CONDUCTIVITY_SENSOR_FAULT : { result = QObject::tr("Conductivity sensor fault" ); break; } - case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_TEMPERATURE : { result = QObject::tr("Inlet water temperature too low" ); break; } - case GuiAlarmID::ALARM_ID_INLET_WATER_HIGH_TEMPERATURE : { result = QObject::tr("Inlet water temperature too high" ); break; } - case GuiAlarmID::ALARM_ID_PRESSURE_SENSOR_FAULT : { result = QObject::tr("Pressure sensor fault" ); break; } - case GuiAlarmID::ALARM_ID_INLET_WATER_LOW_PRESSURE : { result = QObject::tr("Inlet water pressure too low" ); break; } - case GuiAlarmID::ALARM_ID_HD_CRITICAL_DATA_ERROR : { result = QObject::tr("HD critical data integrity check failed" ); break; } - case GuiAlarmID::ALARM_ID_HD_ACCELEROMETER_SELF_TEST_FAILURE : { result = QObject::tr("HD accelerometer failed POST" ); break; } - case GuiAlarmID::ALARM_ID_DG_ACCELEROMETER_SELF_TEST_FAILURE : { result = QObject::tr("DG accelerometer failed POST" ); break; } - case GuiAlarmID::ALARM_ID_HD_EXCESSIVE_TILT : { result = QObject::tr("HD tilt exceeds maximum" ); break; } - case GuiAlarmID::ALARM_ID_DG_EXCESSIVE_TILT : { result = QObject::tr("DG tilt exceeds maximum" ); break; } - case GuiAlarmID::ALARM_ID_HD_SHOCK : { result = QObject::tr("HD experienced large acceleration" ); break; } - case GuiAlarmID::ALARM_ID_DG_SHOCK : { result = QObject::tr("DG experienced large acceleration" ); break; } - case GuiAlarmID::ALARM_ID_HD_ACCELEROMETER_FAILURE : { result = QObject::tr("HD accelerometer error (no readings or FPGA reports error)" ); break; } - case GuiAlarmID::ALARM_ID_DG_ACCELEROMETER_FAILURE : { result = QObject::tr("DG accelerometer error (no readings or FPGA reports error)" ); break; } - case GuiAlarmID::ALARM_ID_DG_CRITICAL_DATA_ERROR : { result = QObject::tr("DG critical data integrity check failed" ); break; } - case GuiAlarmID::ALARM_ID_RO_REJECTION_RATIO_OUT_OF_RANGE : { result = QObject::tr("RO rejection ratio out of range" ); break; } - case GuiAlarmID::ALARM_ID_INLET_WATER_PRESSURE_FAULT : { result = QObject::tr("Inlet water pressure fault" ); break; } - case GuiAlarmID::ALARM_ID_HD_VALVE_HOMING_FAILED : { result = QObject::tr("HD valve homing failed" ); break; } - case GuiAlarmID::ALARM_ID_HD_VALVE_TRANSITION_TIMEOUT : { result = QObject::tr("HD valve transition time out" ); break; } - case GuiAlarmID::ALARM_ID_HD_VALVE_NOT_FUNCTIONAL : { result = QObject::tr("HD valve not functional" ); break; } - case GuiAlarmID::ALARM_ID_HD_VALVE_CURRENT_OUT_OF_RANGE : { result = QObject::tr("HD valve current out of range" ); break; } - case GuiAlarmID::ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE : { result = QObject::tr("HD valve position out of target" ); break; } - case GuiAlarmID::ALARM_ID_AIR_TRAP_ILLEGAL_LEVELS : { result = QObject::tr("Air trap level sensors reporting illegal combination of air/fluid" ); break; } - case GuiAlarmID::ALARM_ID_AIR_TRAP_FILL_DURING_PRIME : { result = QObject::tr("Air trap fill timeout during priming" ); break; } - case GuiAlarmID::ALARM_ID_AIR_TRAP_FILL_DURING_TREATMENT : { result = QObject::tr("Air trap fill timeout during treatment" ); break; } - case GuiAlarmID::ALARM_ID_BLOOD_FLOW_SIGNAL_STRENGTH_TOO_LOW : { result = QObject::tr("Blood flow sensor signal strength too low" ); break; } - case GuiAlarmID::ALARM_ID_DIALYSATE_FLOW_SIGNAL_STRENGTH_TOO_LOW : { result = QObject::tr("Dialysate flow sensor signal strength too low" ); break; } - case GuiAlarmID::ALARM_ID_EMPTY_SALINE_BAG : { result = QObject::tr("Saline bag is empty" ); break; } - case GuiAlarmID::ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE : { result = QObject::tr("Saline bolus volume check failure" ); break; } - case GuiAlarmID::ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT : { result = QObject::tr("FPGA reports failure reading arterial pressure sensor" ); break; } - case GuiAlarmID::ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT : { result = QObject::tr("FPGA reports failure reading venous pressure sensor" ); break; } - case GuiAlarmID::ALARM_ID_UV_REACTOR_NOT_HEALTHY : { result = QObject::tr("UV reactor not healthy (either inlet or outlet)" ); break; } - case GuiAlarmID::ALARM_ID_ACID_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Post-acid concentrate conductivity out of range" ); break; } - case GuiAlarmID::ALARM_ID_BICARB_CONDUCTIVITY_OUT_OF_RANGE : { result = QObject::tr("Post-bicarb concentrate conductivity out of range" ); break; } - case GuiAlarmID::ALARM_ID_RO_PUMP_FLOW_RATE_OUT_OF_RANGE : { result = QObject::tr("RO pump flow rate out of range" ); break; } - case GuiAlarmID::ALARM_ID_DG_THERMISTORS_TEMPERATURE_OUT_OF_RANGE : { result = QObject::tr("DG thermistors/sensors temperature out of range" ); break; } - case GuiAlarmID::ALARM_ID_DG_FAN_RPM_OUT_OF_RANGE : { result = QObject::tr("DG fan RPM out of range" ); break; } - case GuiAlarmID::ALARM_ID_DG_DIALYSATE_FILL_OUT_OF_TIME : { result = QObject::tr("DG dialysate fill runs out of time" ); break; } - case GuiAlarmID::ALARM_ID_CP1_SPEED_CONTROL_ERROR : { result = QObject::tr("DG concentrate pump CP1 speed control error" ); break; } - case GuiAlarmID::ALARM_ID_CP2_SPEED_CONTROL_ERROR : { result = QObject::tr("DG concentrate pump CP2 speed control error" ); break; } - case GuiAlarmID::ALARM_ID_FLOW_RATE_OUT_OF_UPPER_RANGE : { result = QObject::tr("DG flow rate out of upper range" ); break; } - case GuiAlarmID::ALARM_ID_RO_PUMP_PRESSURE_OUT_OF_RANGE : { result = QObject::tr("DG RO pump pressure out of range" ); break; } - case GuiAlarmID::ALARM_ID_DRAIN_PUMP_RPM_OUT_OF_RANGE : { result = QObject::tr("DG drain pump RPM out of range" ); break; } - case GuiAlarmID::ALARM_ID_DG_HEATERS_NEGATIVE_COLD_JUNCTION_TEMPERATURE : { result = QObject::tr("DG heaters cold junction temperature out of range" ); break; } - case GuiAlarmID::ALARM_ID_DG_HEATERS_FAULT : { result = QObject::tr("DG heaters fault" ); break; } - case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_WARNING : { result = QObject::tr("HD end of treatment warning" ); break; } - case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_ALARM : { result = QObject::tr("HD end of treatment alarm (user not acting to end treatment)" ); break; } - case GuiAlarmID::ALARM_ID_END_OF_TREATMENT_HIGH : { result = QObject::tr("HD end of treatment alarm (high priority - user still not acting to end treatment)" ); break; } - - default: - result = QObject::tr("ALARM_ID_UNDEFINED [%1]").arg(int(vAlarmID)); - break; - } - return result; -} Index: sources/model/settings/MSettings.cpp =================================================================== diff -u -r94fc1cd187816ecbf176df26f9dc5601bf379f13 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 94fc1cd187816ecbf176df26f9dc5601bf379f13) +++ sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -52,6 +52,18 @@ return _settings[vGroup].keys; } +QString MSettings::key(const QString &vGroup, uint vIndex) +{ + QStringList mKeys = keys(vGroup); + QString mKey = "[Unknown %1]"; + if ( vIndex < (unsigned)mKeys.count() ) { + mKey = mKeys [vIndex]; + } else { + mKey = mKey.arg(vIndex); + } + return mKey; +} + /*! * \brief MSettings::values * \details returns all values in a group @@ -73,21 +85,50 @@ QString MSettings::location(const QString &vGroup) { QMutexLocker locker(&_mutex); - return _location[vGroup]; + return _settings[vGroup].location; } /*! + * \brief MSettings::groups + * \details The groups where have been read from the location vLocation + * \param vLocation - The location to look for the group(s) + * \return the groups in QString + */ +QStringList MSettings::groups(const QString &vCategory) +{ + QMutexLocker locker(&_mutex); + return _category[vCategory]; +} + +/*! + * \brief MSettings::categorys + * \details The list of all the categories in the setting + * \return the categories in QStringList + */ +QStringList MSettings::categorys() +{ + QMutexLocker locker(&_mutex); + return _category.keys(); +} + +/*! * \brief MSettings::add * \details The function to be used to add elements in the settings * \param vGroup - the group of the settings * \param vKey - the key to be added under the group vGroup * \param vValue - the value of the key to be added under group vGroup for the key vKey * \param vLocation - the location of the setting data if is different will be set. + * \param vLocation - the category of the setting data which by default is the base location if has extra folder + filename. */ -void MSettings::add(const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation) +void MSettings::add(const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation, const QString &vCategory) { QMutexLocker locker(&_mutex); - if ( ! _location.contains(vGroup) ) _location[vGroup] = vLocation; - _settings[vGroup].keys += vKey ; - _settings[vGroup].values += vValue; + if ( ! _category[vCategory].contains(vGroup) ) _category[vCategory] += vGroup; + + KeyValue mGroup = _settings[vGroup]; + if ( mGroup.location != vLocation ) mGroup.location = vLocation; + if ( mGroup.category != vCategory ) mGroup.category = vCategory; + mGroup.keys += vKey ; + mGroup.values += vValue ; + _settings[vGroup] = mGroup; } Index: sources/model/settings/MSettings.h =================================================================== diff -u -rf688ed9f1c64a2603a6d10fbb090b257a43e1f6f -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/model/settings/MSettings.h (.../MSettings.h) (revision f688ed9f1c64a2603a6d10fbb090b257a43e1f6f) +++ sources/model/settings/MSettings.h (.../MSettings.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -23,7 +23,7 @@ #include "main.h" // Doxygen : don't remove // Define -#define _SettingModel Storage::MSettings::I() +#define _Settings Storage::MSettings::I() // namespace namespace Storage { @@ -33,25 +33,30 @@ Q_OBJECT struct KeyValue { + QString category; + QString location; QList<QString > keys; QList<QVariant> values; }; + QMap<QString,KeyValue > _settings; - QMap<QString,KeyValue> _settings; - QMap<QString,QString > _location; + QMap<QString,QStringList> _category; QMutex _mutex; // Singleton SINGLETON(MSettings) public: - QStringList groups (); - QStringList keys (const QString &vGroup); - QVariantList values (const QString &vGroup); - QString location(const QString &vGroup); + QStringList categorys(); + QStringList groups (); + QStringList groups (const QString &vCategory); + QStringList keys (const QString &vGroup ); + QString key (const QString &vGroup , uint vIndex); + QVariantList values (const QString &vGroup ); + QString location (const QString &vGroup ); - void add (const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation); + void add (const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation, const QString &vCategory); }; } Index: sources/storage/Logger.cpp =================================================================== diff -u -re159592e3a99658e661ab83fffef43322dc075f3 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/storage/Logger.cpp (.../Logger.cpp) (revision e159592e3a99658e661ab83fffef43322dc075f3) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -206,6 +206,7 @@ if ( ok && ! setLogPath(LogType::eLogEvent) ) ok = false; if ( ok && ! setLogPath(LogType::eLogDatum) ) ok = false; if ( ok && ! setLogPath(LogType::eLogDebug) ) ok = false; + if ( ok && ! setLogPath(LogType::eLogTrtmt) ) ok = false; return ok; } // coco end @@ -249,6 +250,7 @@ case LogType::eLogEvent: case LogType::eLogDatum: case LogType::eLogDebug: + // case LogType::eLogTrtmt: // this type of log will never happen here. Only put here to make sure it is intentional. fileName += _logFileNameExt[vLogType]; break; @@ -291,7 +293,7 @@ int result = 0; static QString mOSource; QString mDestination = USB_Mount_Point; - for ( const auto &iType : { eLogEvent, eLogDatum } ) { + for ( const auto &iType : { eLogEvent, eLogDatum /*, eLogDebug*/ } ) { QString mCSource = _logPathNames[iType]; // if the event and datum are mixed (mOSource == mCSource) in one file then no need to go over the same files in same folder and do it again. if (mOSource != mCSource) { @@ -350,7 +352,7 @@ static QString mOExtension; int removeCount = 0; QString mLogFileFilter; - for ( const auto &iType : { eLogEvent , eLogDatum , eLogDebug } ) { + for ( const auto &iType : { eLogEvent , eLogDatum , eLogDebug , eLogTrtmt } ) { QString mCSource = _logPathNames [iType]; QString mCExtension = _logFileNameExt[iType]; // if the event and datum are mixed (mOSource == mCSource && mCExtension == mOExtension) in one file then no need to go over the same files in same folder and do it again. Index: sources/storage/Logger.h =================================================================== diff -u -re159592e3a99658e661ab83fffef43322dc075f3 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/storage/Logger.h (.../Logger.h) (revision e159592e3a99658e661ab83fffef43322dc075f3) +++ sources/storage/Logger.h (.../Logger.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -84,6 +84,8 @@ eLogEvent, ///< Massages on the CANBus : Error is an event type eLogDatum, ///< Massages on the CANBus : Broadcast data type + eLogTrtmt, ///< Treatment Log Files + eLogType_Count, }; @@ -95,6 +97,7 @@ { LogType::eLogEvent, "log/" }, { LogType::eLogDatum, "log/" }, { LogType::eLogDebug, "service/" }, + { LogType::eLogTrtmt, Storage::Treatment_Log_Folder }, }; const QHash<LogType, const char *> _logPrefix { // Will be used for the logging in the file @@ -111,6 +114,7 @@ { LogType::eLogDatum, ".dat" }, #endif { LogType::eLogDebug, ".err" }, + { LogType::eLogTrtmt, ".log" }, }; // be careful when defining these percentages @@ -120,13 +124,15 @@ // so it is 70% for Event/Datum + 15% Service + 15% free = 100% total const QHash<LogType, quint16> _logTypeMaxUsageLimit { #ifdef MIXED_EVENT_DATUM - { LogType::eLogEvent, 70 }, // in days - { LogType::eLogDatum, 70 }, // in days + { LogType::eLogEvent, 70 }, // in percent + { LogType::eLogDatum, 70 }, // in percent #else - { LogType::eLogEvent, 35 }, // in days - { LogType::eLogDatum, 35 }, // in days + { LogType::eLogEvent, 35 }, // in percent + { LogType::eLogDatum, 35 }, // in percent #endif - { LogType::eLogDebug, 15 }, // in days + { LogType::eLogDebug, 15 }, // in percent + // Not Sure yet so commented out in the remove. + { LogType::eLogTrtmt, 100}, // in percent // No Remove for now }; const char *_dateFormat = "yyyy_MM_dd"; Index: sources/storage/Settings.cpp =================================================================== diff -u -r98581b325c24eb5ef0ce0ce475ad15320d659140 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/storage/Settings.cpp (.../Settings.cpp) (revision 98581b325c24eb5ef0ce0ce475ad15320d659140) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -58,7 +58,7 @@ settingFiles += FileHandler::find(folder, fileFilter); } - if ( ! settingFolders.count() ) { + if ( ! settingFiles.count() ) { LOG_DEBUG(QObject::tr("No setting files in the %1").arg(Storage::Settings_Path_Name)); return 2; // TODO : Define an error enum when completed } @@ -69,24 +69,32 @@ QFile file(settingFile.absoluteFilePath()); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { QString group = ""; - while (!file.atEnd()) { - QString line = file.readLine().replace('\n',""); + while ( ! file.atEnd() ) { + QString line = file.readLine().replace('\n',"").trimmed(); if (line.contains("[")) { line.replace("[","").replace("]", ""); - group = line.trimmed(); + group = line; } else { - if (group.isEmpty()) { + if ( group.isEmpty() ) { continue; } else { - if (line.contains('=')) { - QStringList keyValue = line.split('='); - QString key = keyValue[0].trimmed(); - QString value = keyValue[1].trimmed(); + if ( ! line.isEmpty() ) { + QString key = ""; + QString value = ""; + if ( line.contains('=') ) { + QStringList keyValue = line.split('='); + key = keyValue[0].trimmed(); + value = keyValue[1].trimmed(); + } + else { + key = line; + } QString location= settingFile.absolutePath() + "/"; - _SettingModel.add(group, key, QVariant(value), location); - // DEBUG: qDebug() << group << key << value; + QString category= QString(location + settingFile.baseName()).remove(Storage::Settings_Path_Name); + _Settings.add(group, key, QVariant(value), location, category); + // DEBUG: qDebug() << group << key << value << location << category; } } } Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -raad2e406efd1fc2589a19004eb86ca6277f41aea -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision aad2e406efd1fc2589a19004eb86ca6277f41aea) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -29,7 +29,12 @@ /****** TO BE CONSISTENT, ALWAYS INCLUDE '/' AT THE END OF ALL THE FOLDER/DIR/PATH IN HERE ******/ // USB +#ifdef BUILD_FOR_TARGET const char *USB_Mount_Point = "/media/usb/"; +#else + const char *USB_Mount_Point = "/home/denali/Desktop/USB DISK/"; +#endif + const char *USB_File_System = "vfat"; // SD-CARD @@ -38,7 +43,7 @@ const char *SDCard_Base_Path_Name = "/media/sd-card/"; #else // should not be in the project application folder. [not tracking by git] - const char *SDCard_Base_Path_Name = "/media/denali/USB DISK"; + const char *SDCard_Base_Path_Name = "/media/denali/USB DISK/"; #endif // Settings @@ -60,4 +65,9 @@ // Date and Time const char *Date_Time_Set_Sh = "date_time_set.sh"; + + // Treatment + // Please notice that is the folder not the path + // and it needs to be concatenated after SDCard_Base_Path_Name for each build configuration + const char *Treatment_Log_Folder = "treatments/"; } Index: sources/storage/StorageGlobals.h =================================================================== diff -u -raad2e406efd1fc2589a19004eb86ca6277f41aea -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision aad2e406efd1fc2589a19004eb86ca6277f41aea) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -35,4 +35,7 @@ // Date and Time extern const char *Date_Time_Set_Sh; + + // Treatment + extern const char *Treatment_Log_Folder; } Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u --- sources/storage/TreatmentLog.cpp (revision 0) +++ sources/storage/TreatmentLog.cpp (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,204 @@ +/*! + * + * 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 TreatmentLog.cpp + * author (last) Behrouz NematiPour + * date (last) 4/30/2021 + * author (original) Behrouz NematiPour + * date (original) 4/30/2021 + * + */ +#include "TreatmentLog.h" + +// Qt +#include <QtConcurrent> + +// Project +#include "StorageGlobals.h" +#include "FileHandler.h" +#include "Logger.h" +#include "MSettings.h" + +using namespace Storage; + +#define ADDTOLOG(vINDEX) index = vINDEX; logContent += _titles[index] + sep + _values[index] + sep + _units[index] + "\n"; + +TreatmentLog::TreatmentLog(QObject *parent) : QObject(parent) { + initConnections(); + _treatmentLogPath = QString("%1%2") + .arg(Storage::SDCard_Base_Path_Name) + .arg(Storage::Treatment_Log_Folder ); +} + +/*! \brief Connection Initializer + \details All the class signal/slot connections are defined here. +*/ +void TreatmentLog::initConnections() { + connect(&_exportWatcher, SIGNAL(finished()), + this , SLOT(onExport())); + + connect(&_saveWatcher , SIGNAL(finished()), + this , SLOT(onSave ())); +} + +void TreatmentLog::initModel(const AdjustTreatmentLogResponseData &vData) +{ + // Formatted values + QString mStrText = "%1"; + // qDebug() << _Settings.groups(); + // SRSUI910 : PRS187 : Clinical - Data - Order + + + + QString mTreatmentDuration = QTime (0, 0).addSecs(vData.mTreatmentDuration ).toString("HH:mm"); + QString mActualTreatmentDuration = QTime (0, 0).addSecs(vData.mActualTreatmentDuration ).toString("HH:mm"); + QString mTreatmentDateTime = QDateTime::fromSecsSinceEpoch ( vData.mTreatmentDateTime ).toString("yyyy/MM/dd HH:mm"); + + //// TODO: The settings needs modification not only to define the category and groups in a common header but also the settings itself needs some mods. + //// - the category shall become as part of the group + //// - the structure of the settings should become horizontal which vertical now. + QString mAcidConcentrateType = _Settings.key("Acid Concentrate" , vData.mAcidConcentrateType ); + QString mBicarbonateConcentrateType = _Settings.key("Bicarbonate Concentrate" , vData.mBicarbonateConcentrateType ); + QString mDialyzerType = _Settings.key("Dialyzer Type" , vData.mDialyzerType ); + QString mHeparinType = _Settings.key("Heparin Type" , vData.mHeparinType ); + QString mWaterSampleTestResult = _Settings.key("Water Sample Result" , vData.mWaterSampleTestResult ); + + + // init/fill/clear the _values + _values.clear(); + for (int i = 0; i < eTreatmentLogIndexCount; i++) _values << ""; + + + _values[eDeviceID ] = mStrText.arg(vData.mDeviceID ); + + _values[eBloodFlowRate ] = mStrText.arg(vData.mBloodFlowRate ); + _values[eDialysateFlowRate ] = mStrText.arg(vData.mDialysateFlowRate ); + _values[eTreatmentDuration ] = mTreatmentDuration ; + _values[eActualTreatmentDuration ] = mActualTreatmentDuration ; + _values[eAcidConcentrateType ] = mAcidConcentrateType ; + _values[eBicarbonateConcentrateType ] = mBicarbonateConcentrateType ; + _values[ePotassiumConcentration ] = mStrText.arg(vData.mPotassiumConcentration ); + _values[eCalciumConcentration ] = mStrText.arg(vData.mCalciumConcentration ); + _values[eBicarbonateConcentration ] = mStrText.arg(vData.mBicarbonateConcentration ); + _values[eSodiumConcentration ] = mStrText.arg(vData.mSodiumConcentration ); + _values[eDialysateTemperature ] = mStrText.arg(vData.mDialysateTemperature ,0,'f',3); + _values[eDialyzerType ] = mDialyzerType ; + _values[eHeparinType ] = mHeparinType ; + _values[eHeparinConcentration ] = mStrText.arg(vData.mHeparinConcentration ); + _values[eHeparinBolusVolume ] = mStrText.arg(vData.mHeparinBolusVolume ,0,'f',3); + _values[eHeparinDispenseRate ] = mStrText.arg(vData.mHeparinDispenseRate ,0,'f',3); + _values[eHeparinStop ] = mStrText.arg(vData.mHeparinStop ); + _values[eHeparinDeliveredVolume ] = mStrText.arg(vData.mHeparinDeliveredVolume ,0,'f',3); + _values[eTreatmentDateTime ] = mTreatmentDateTime ; + _values[eWaterSampleTestResult ] = mWaterSampleTestResult ; + _values[eDialysateVolumeUsed ] = mStrText.arg(vData.mDialysateVolumeUsed ,0,'f',3); + _values[eTargetUFVolume ] = mStrText.arg(vData.mTargetUFVolume ,0,'f',3); + _values[eActualUFVolume ] = mStrText.arg(vData.mActualUFVolume ,0,'f',3); + _values[eTargetUFRate ] = mStrText.arg(vData.mTargetUFRate ,0,'f',3); + _values[eActualUFRate ] = mStrText.arg(vData.mActualUFRate ,0,'f',3); + _values[eSalineBolusVolume ] = mStrText.arg(vData.mSalineBolusVolume ); + _values[eAverageBloodFlow ] = mStrText.arg(vData.mAverageBloodFlow ,0,'f',3); + _values[eAverageDialysateFlow ] = mStrText.arg(vData.mAverageDialysateFlow ,0,'f',3); + _values[eAverageDialysateTemp ] = mStrText.arg(vData.mAverageDialysateTemp ,0,'f',3); + _values[eAverageArterialPressure ] = mStrText.arg(vData.mAverageArterialPressure ,0,'f',3); + _values[eAverageVenousPressure ] = mStrText.arg(vData.mAverageVenousPressure ,0,'f',3); + _values[eEndTreatmentEarlyAlarm ] = mStrText.arg(vData.mEndTreatmentEarlyAlarm ); +} + +// ----- Save +void TreatmentLog::doSave() +{ + if (_saveWatcher.isRunning()) return; + isIdle(false); + saveLogConcurrent(); +} + +void TreatmentLog::saveLogConcurrent() +{ + LOG_EVENT("Save Treatment Log Started"); + QFuture<bool> mFuture = QtConcurrent::run(this, &TreatmentLog::saveLog); + _saveWatcher.setFuture(mFuture); +} + +bool TreatmentLog::saveLog() +{ + bool ok = (unsigned)_values.count() >= eTreatmentLogIndexCount; + if (!ok) return false; + + + QString logContent; + QString sep = ","; + uint index = 0; + logContent += tr("Patient ID") + sep + QString("None") + "\n"; + + ADDTOLOG(eBloodFlowRate); + ADDTOLOG(eDialysateFlowRate); + ADDTOLOG(eTreatmentDuration); + ADDTOLOG(eAcidConcentrateType); + ADDTOLOG(eBicarbonateConcentrateType); + ADDTOLOG(ePotassiumConcentration); + ADDTOLOG(eCalciumConcentration); + ADDTOLOG(eBicarbonateConcentration); + ADDTOLOG(eSodiumConcentration); + ADDTOLOG(eDialysateTemperature); + ADDTOLOG(eDialyzerType); + ADDTOLOG(eHeparinType); + ADDTOLOG(eHeparinConcentration); + ADDTOLOG(eHeparinBolusVolume); + ADDTOLOG(eHeparinDispenseRate); + ADDTOLOG(eHeparinStop); + + QString mDateTime = _values[eTreatmentDateTime]; + mDateTime.replace("/", "" ); // remove date separator + mDateTime.replace(":", "" ); // remove time separator + mDateTime.replace(" ", "_"); // remove spaces + + QString mDeviceID = _values[eDeviceID]; + QString mFileName = QString("%1_%2.log") + .arg(mDateTime) + .arg(mDeviceID); + Storage::FileHandler::makeFolder(_treatmentLogPath); + ok = Storage::FileHandler::write(_treatmentLogPath + mFileName, logContent, false); + + return ok; +} + +void TreatmentLog::onSave() +{ + LOG_EVENT(QString("Save Treatment Log Ended: %1").arg(_saveWatcher.result())); + isIdle(true); +} + +// ----- Export +void TreatmentLog::doExport() +{ + if (_exportWatcher.isRunning()) return; + isIdle(false); + exportLogConcurrent(); +} + +void TreatmentLog::exportLogConcurrent() +{ + LOG_EVENT("Export Treatment Log Started"); + QFuture<bool> mFuture = QtConcurrent::run(this, &TreatmentLog::exportLog); + _exportWatcher.setFuture(mFuture); +} + +bool TreatmentLog::exportLog() +{ + bool ok; + QString exportPath = Storage::USB_Mount_Point; + Storage::FileHandler::makeFolder(exportPath); + ok = FileHandler::copyFolder(_treatmentLogPath , exportPath); + return ok; +} + +void TreatmentLog::onExport() +{ + LOG_EVENT(QString("Export Treatment Log Ended: %1").arg(_exportWatcher.result())); + isIdle(true); +} Index: sources/storage/TreatmentLog.h =================================================================== diff -u --- sources/storage/TreatmentLog.h (revision 0) +++ sources/storage/TreatmentLog.h (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -0,0 +1,191 @@ +/*! + * + * 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 TreatmentLog.h + * \author (last) Behrouz NematiPour + * \date (last) 4/30/2021 + * \author (original) Behrouz NematiPour + * \date (original) 4/30/2021 + * + */ +#pragma once + +// Qt +#include <QObject> +#include <QFutureWatcher> +#include <QString> + +// Project +#include "main.h" // Doxygen : don't remove +#include "MPostTreatmentAdjustTreatmentLogResponse.h" + +// define +#define _TreatmentLog Storage::TreatmentLog::I() + +namespace Storage { + +class TreatmentLog : public QObject +{ + Q_OBJECT + + QString _treatmentLogPath; + + QFutureWatcher<bool> _saveWatcher; + QFutureWatcher<bool> _exportWatcher; + + QString _unitTextFlowRate = tr("mL/min" ); + QString _unitTextDuration = tr("min" ); + QString _unitTextConcentration = tr("mEg/L" ); + QString _unitTextTemperature = tr("°C" ); + QString _unitTextVolume = tr("L" ); + QString _unitTextFluid = tr("mL" ); + QString _unitTextHeparinConcentration = tr("IU/mL" ); + QString _unitTextDispencingRate = tr("mL/hr" ); + QString _unitTextBloodPressure = tr("mmHg" ); + + QStringList _values; + + enum TreatmentLogIndex { + eDeviceID , + eBloodFlowRate , + eDialysateFlowRate , + eTreatmentDuration , + eActualTreatmentDuration , + eAcidConcentrateType , + eBicarbonateConcentrateType , + ePotassiumConcentration , + eCalciumConcentration , + eBicarbonateConcentration , + eSodiumConcentration , + eDialysateTemperature , + eDialyzerType , + eHeparinType , + eHeparinConcentration , + eHeparinBolusVolume , + eHeparinDispenseRate , + eHeparinStop , + eHeparinDeliveredVolume , + eTreatmentDateTime , + eWaterSampleTestResult , + eDialysateVolumeUsed , + eTargetUFVolume , + eActualUFVolume , + eTargetUFRate , + eActualUFRate , + eSalineBolusVolume , + eAverageBloodFlow , + eAverageDialysateFlow , + eAverageDialysateTemp , + eAverageArterialPressure , + eAverageVenousPressure , + eEndTreatmentEarlyAlarm , + + eTreatmentLogIndexCount + }; + + const QStringList _titles { + tr("Device ID" ), + tr("Blood Flow Rate" ), + tr("Dialysate Flow Rate" ), + tr("Treatment Duration" ), + tr("Actual Treatment Duration" ), + tr("Acid ConcentrateType" ), + tr("Bicarbonate Concentrate Type" ), + tr("Potassium Concentration" ), + tr("Calcium Concentration" ), + tr("Bicarbonate Concentration" ), + tr("Sodium Concentration" ), + tr("Dialysate Temperature" ), + tr("Dialyzer Type" ), + tr("Heparin Type" ), + tr("Heparin Concentration" ), + tr("Heparin Bolus Volume" ), + tr("Heparin Dispense Rate" ), + tr("Heparin Stop" ), + tr("Heparin Delivered Volume" ), + tr("Treatment DateTime" ), + tr("Water Sample Test Result" ), + tr("Dialysate Volume Used" ), + tr("Target UF Volume" ), + tr("Actual UF Volume" ), + tr("Target UF Rate" ), + tr("Actual UF Rate" ), + tr("Saline Bolus Volume" ), + tr("Average Blood Flow" ), + tr("Average Dialysate Flow" ), + tr("Average Dialysate Temp" ), + tr("Average Arterial Pressure" ), + tr("Average Venous Pressure" ), + tr("End Treatment Early Alarm" ), + }; + + const QStringList _units { + "" , + _unitTextFlowRate , + _unitTextFlowRate , + _unitTextDuration , + _unitTextDuration , + "" , + "" , + _unitTextConcentration , + _unitTextConcentration , + _unitTextConcentration , + _unitTextConcentration , + _unitTextTemperature , + "" , + "" , + _unitTextHeparinConcentration , + _unitTextFluid , + _unitTextDispencingRate , + _unitTextDuration , + _unitTextFluid , + "" , + "" , + _unitTextVolume , + _unitTextVolume , + _unitTextVolume , + _unitTextFlowRate , + _unitTextFlowRate , + _unitTextFluid , + _unitTextFlowRate , + _unitTextFlowRate , + _unitTextTemperature , + _unitTextBloodPressure , + _unitTextBloodPressure , + "" , + }; + + void initConnections(); + + bool saveLog (); + void saveLogConcurrent (); + bool exportLog (); + void exportLogConcurrent(); + + NOTIFIER(isIdle) + SINGLETON(TreatmentLog) + +public: + void initModel(const AdjustTreatmentLogResponseData &vData); + + const QStringList titles() const { return _titles; } + const QStringList units () const { return _units ; } + const QStringList values() const { return _values; } + +private slots: + void onSave (); + void onExport (); + +public slots: + void doSave (); + void doExport (); + +signals: + +}; + +} Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -r9327fae7b109203ca698d361b113a81d139a0cf9 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 9327fae7b109203ca698d361b113a81d139a0cf9) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -12,9 +12,8 @@ #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "GuiController.h" #include "StorageGlobals.h" -#include "FileSaver.h" -// forward diclations +// forward declaration class tst_views; using namespace Storage; Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp (.../VPostTreatmentAdjustTreatmentLog.cpp) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.cpp (.../VPostTreatmentAdjustTreatmentLog.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -14,20 +14,38 @@ */ #include "VPostTreatmentAdjustTreatmentLog.h" +// Qt +#include <QtConcurrent/QtConcurrent> +#include <QFuture> + // Project #include "GuiController.h" +#include "FileHandler.h" +using namespace Storage; + VIEW_DEF_CLASS_ADJUSTMENT(VPostTreatmentAdjustmentTreatmentLog) /*! \brief Connection Initializer \details All the class signal/slot connections are defined here. */ void View::VPostTreatmentAdjustmentTreatmentLog::initConnections() { - ADJUST_VIEW_CONNECTION(AdjustTreatmentLogRequestData); + ADJUST_VIEW_CONNECTION(AdjustTreatmentLogRequestData ); ACTION_VIEW_CONNECTION(AdjustTreatmentLogResponseData); + connect(&_TreatmentLog , &TreatmentLog::isIdleNotified, + this , [=](bool vIdle){isIdle(vIdle);}); } /*! + * \brief View::VPostTreatmentAdjustmentTreatmentLog::doRequest + * \details the invocable slot to send user's treatment log request + */ +void View::VPostTreatmentAdjustmentTreatmentLog::doRequest() { + AdjustTreatmentLogRequestData data; + emit didAdjustment(data); +} + +/*! * \brief VPostTreatmentAdjustmentUltrafiltrationInit::onActionReceive * \details received response model data handler * \param vData - model data @@ -37,43 +55,8 @@ adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); - // Formatted values - QStringList mParametersText; - QString mStr = "%1"; - mParametersText += mStr.arg(vData.mBloodFlowRate ); - mParametersText += mStr.arg(vData.mDialysateFlowRate ); - mParametersText += mStr.arg(vData.mTreatmentDuration ); - mParametersText += mStr.arg(vData.mActualTreatmentDuration ); - mParametersText += mStr.arg(vData.mAcidConcentrateType ); - mParametersText += mStr.arg(vData.mBicarbonateConcentrateType ); - mParametersText += mStr.arg(vData.mPotassiumConcentration ); - mParametersText += mStr.arg(vData.mCalciumConcentration ); - mParametersText += mStr.arg(vData.mBicarbonateConcentration ); - mParametersText += mStr.arg(vData.mSodiumConcentration ); - mParametersText += mStr.arg(vData.mDialysateTemperature ,0,'f',3); - mParametersText += mStr.arg(vData.mDialyzerType ); - mParametersText += mStr.arg(vData.mTreatmentDateTime ); - mParametersText += mStr.arg(vData.mAverageBloodFlow ,0,'f',3); - mParametersText += mStr.arg(vData.mAverageDialysateFlow ,0,'f',3); - mParametersText += mStr.arg(vData.mDialysateVolumeUsed ,0,'f',3); - mParametersText += mStr.arg(vData.mAverageDialysateTemp ,0,'f',3); - mParametersText += mStr.arg(vData.mTargetUFVolume ,0,'f',3); - mParametersText += mStr.arg(vData.mActualUFVolume ,0,'f',3); - mParametersText += mStr.arg(vData.mTargetUFRate ,0,'f',3); - mParametersText += mStr.arg(vData.mActualUFRate ,0,'f',3); - mParametersText += mStr.arg(vData.mSalineBolusVolume ); - mParametersText += mStr.arg(vData.mHeparinType ); - mParametersText += mStr.arg(vData.mHeparinConcentration ); - mParametersText += mStr.arg(vData.mHeparinBolusVolume ,0,'f',3); - mParametersText += mStr.arg(vData.mHeparinDispenseRate ,0,'f',3); - mParametersText += mStr.arg(vData.mHeparinPreStop ); - mParametersText += mStr.arg(vData.mHeparinDeliveredVolume ,0,'f',3); - mParametersText += mStr.arg(vData.mAverageArterialPressure ,0,'f',3); - mParametersText += mStr.arg(vData.mAverageVenousPressure ,0,'f',3); - mParametersText += mStr.arg(vData.mEndTreatmentEarlyAlarm ); - mParametersText += mStr.arg(vData.mDeviceID ); - mParametersText += mStr.arg(vData.mWaterSampleTestResult ); - parametersText( mParametersText ); + _TreatmentLog.initModel(vData); + parametersText ( _TreatmentLog.values() ); // raw values bloodFlowRate ( vData.mBloodFlowRate ); @@ -102,26 +85,22 @@ heparinConcentration ( vData.mHeparinConcentration ); heparinBolusVolume ( vData.mHeparinBolusVolume ); heparinDispenseRate ( vData.mHeparinDispenseRate ); - heparinPreStop ( vData.mHeparinPreStop ); + heparinStop ( vData.mHeparinStop ); heparinDeliveredVolume ( vData.mHeparinDeliveredVolume ); averageArterialPressure ( vData.mAverageArterialPressure ); averageVenousPressure ( vData.mAverageVenousPressure ); endTreatmentEarlyAlarm ( vData.mEndTreatmentEarlyAlarm ); deviceID ( vData.mDeviceID ); waterSampleTestResult ( vData.mWaterSampleTestResult ); + if (adjustment_Accepted()) + _TreatmentLog.doSave(); - // *** has to be the last to let the information to be set and then emit the signal *** // *** otherwise will use the Previous values before being set. *** adjustment ( true ); } -/*! - * \brief View::VPostTreatmentAdjustmentTreatmentLog::doConfirm - * \details the invocable slot to send user's Disposables Removal confirm - */ -void View::VPostTreatmentAdjustmentTreatmentLog::doRequest() { - AdjustTreatmentLogRequestData data; - emit didAdjustment(data); +void View::VPostTreatmentAdjustmentTreatmentLog::doExport() { + _TreatmentLog.doExport(); } Index: sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h =================================================================== diff -u -r5e3b27057e9c7dedf9c46e3881609b7e96c3fb71 -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h (.../VPostTreatmentAdjustTreatmentLog.h) (revision 5e3b27057e9c7dedf9c46e3881609b7e96c3fb71) +++ sources/view/hd/adjustment/posttreatment/VPostTreatmentAdjustTreatmentLog.h (.../VPostTreatmentAdjustTreatmentLog.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -16,10 +16,13 @@ #include <QObject> +// Qt +#include <QFutureWatcher> + // Project #include "main.h" // Doxygen : don't remove #include "VAdjustmentResponseBase.h" -#include "MPostTreatmentAdjustTreatmentLogResponse.h" +#include "TreatmentLog.h" // Model MPostTreatmentAdjustTreatmentLogResponse included in this controller header namespace View { @@ -70,23 +73,25 @@ PROPERTY(quint32 , heparinConcentration , 0 ) PROPERTY(float , heparinBolusVolume , 0 ) PROPERTY(float , heparinDispenseRate , 0 ) - PROPERTY(quint32 , heparinPreStop , 0 ) + PROPERTY(quint32 , heparinStop , 0 ) PROPERTY(float , heparinDeliveredVolume , 0 ) PROPERTY(float , averageArterialPressure , 0 ) PROPERTY(float , averageVenousPressure , 0 ) PROPERTY(quint32 , endTreatmentEarlyAlarm , 0 ) PROPERTY(quint32 , deviceID , 0 ) PROPERTY(quint32 , waterSampleTestResult , 0 ) - - PROPERTY(QStringList , parametersTitle , {}) + PROPERTY(QStringList , parametersTitle , _TreatmentLog.titles()) + PROPERTY(QStringList , parametersUnit , _TreatmentLog.units ()) PROPERTY(QStringList , parametersText , {}) - PROPERTY(QStringList , parametersUnit , {}) + PROPERTY(bool , isIdle , true) + VIEW_DEC_CLASS_ADJUSTMENT(VPostTreatmentAdjustmentTreatmentLog, AdjustTreatmentLogResponseData) public slots: - void doRequest(); + void doRequest (); + void doExport (); signals: /*! Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -rf688ed9f1c64a2603a6d10fbb090b257a43e1f6f -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision f688ed9f1c64a2603a6d10fbb090b257a43e1f6f) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -24,16 +24,27 @@ void VSettings::onActionReceive(const SettingsData &) { + QVariantMap mCategorys; + for (const auto &category : _Settings.categorys()) { + QVariantMap details; + QStringList groups = _Settings.groups(category); + // DEBUG: qDebug() << " ----- " << category << groups; + details["groups"] = groups; + mCategorys[category] = details; + } + category(mCategorys); + QVariantMap mSettings; - for (const auto &group : _SettingModel.groups()) { + for (const auto &group : _Settings.groups()) { QVariantMap details; // DEBUG : // qDebug() << " ##### " - // << _SettingModel.keys (group) - // << _SettingModel.values (group); - QStringList keys = _SettingModel.keys (group); - QVariantList values = _SettingModel.values (group); - QString location = _SettingModel.location (group); + // << _Settings.keys (group) + // << _Settings.values (group) + // << _Settings.location (group); + QStringList keys = _Settings.keys (group); + QVariantList values = _Settings.values (group); + QString location = _Settings.location (group); details["location"] = location; details["keys" ] = keys ; Index: sources/view/settings/VSettings.h =================================================================== diff -u -rf688ed9f1c64a2603a6d10fbb090b257a43e1f6f -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e --- sources/view/settings/VSettings.h (.../VSettings.h) (revision f688ed9f1c64a2603a6d10fbb090b257a43e1f6f) +++ sources/view/settings/VSettings.h (.../VSettings.h) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) @@ -31,6 +31,7 @@ CONSTANT(QString , groupFormat, "%1^%2" ) PROPERTY(bool , initialized, false ) + PROPERTY(QVariantMap, category , {} ) PROPERTY(QVariantMap, settings , {} ) VIEW_DEC(VSettings, SettingsData)