Index: denali.qrc
===================================================================
diff -u -r99e12314855a6b8dd46989b9c0e5263b74af5dc4 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- denali.qrc (.../denali.qrc) (revision 99e12314855a6b8dd46989b9c0e5263b74af5dc4)
+++ denali.qrc (.../denali.qrc) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -20,9 +20,9 @@
resources/images/ArrowRight.png
resources/images/logo d Dark Transparent.png
resources/images/Close.png
- resources/images/alarm.svg
- resources/images/bell.svg
- resources/images/bell-off.svg
+ resources/images/alarm.png
+ resources/images/bell.png
+ resources/images/bell-off.png
resources/images/Back.png
resources/images/Pause.png
resources/images/Resume.png
@@ -32,6 +32,8 @@
resources/images/Wave-Minus.png
resources/images/Wave-Plus.png
resources/images/microsd.png
+ resources/images/OffGray.png
+ resources/images/Done.png
sources/gui/qml/components/MainMenu.qml
@@ -56,9 +58,14 @@
sources/gui/qml/components/RangeRect.qml
sources/gui/qml/components/RangeBar.qml
sources/gui/qml/components/Circle.qml
+ sources/gui/qml/components/CircleWithText.qml
sources/gui/qml/components/TimeText.qml
sources/gui/qml/components/ProgressCircle.qml
sources/gui/qml/components/Slider.qml
+ sources/gui/qml/components/SliderCreateTreatment.qml
+ sources/gui/qml/components/SliderDoubleCreateTreatment.qml
+ sources/gui/qml/components/RectSelectCreateTreatment.qml
+ sources/gui/qml/components/TopMenuBarCreateTreatment.qml
sources/gui/qml/components/ProgressBarEx.qml
sources/gui/qml/components/CloseButton.qml
sources/gui/qml/components/ConfirmButton.qml
@@ -91,6 +98,9 @@
sources/gui/qml/pages/treatment/TreatmentHome.qml
sources/gui/qml/pages/treatment/TreatmentStack.qml
sources/gui/qml/pages/treatment/TreatmentCreate.qml
+ sources/gui/qml/pages/treatment/TreatmentBegin.qml
+ sources/gui/qml/pages/treatment/TreatmentConfirm.qml
+ sources/gui/qml/pages/treatment/TreatmentPrime.qml
sources/gui/qml/pages/treatment/TreatmentStart.qml
Index: sources/ApplicationController.cpp
===================================================================
diff -u -rbb74da05f81b82dad3ec844c1feb1135b949f1c2 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision bb74da05f81b82dad3ec844c1feb1135b949f1c2)
+++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -7,9 +7,9 @@
*
* \file ApplicationController.cpp
* \author (last) Peter Lucia
- * \date (last) 25-Jun-2020
+ * \date (last) 15-Oct-2020
* \author (original) Behrouz NematiPour
- * \date (original) 24-Sep-2019
+ * \date (original) 26-Aug-2020
*
*/
#include "ApplicationController.h"
@@ -135,7 +135,7 @@
void ApplicationController::initThread(QThread &vThread)
{
// runs in main thread
- Q_ASSERT_X(QThread::currentThread() == qApp->thread() , __func__, "The Class initialization must be done in Main Thread" );
+ Q_ASSERT_X(QThread::currentThread() == qApp->thread(), __func__, "The Class initialization must be done in Main Thread" );
_thread = &vThread;
_thread->setObjectName(QString("%1_Thread").arg(metaObject()->className()));
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit()));
@@ -297,7 +297,8 @@
if (mFakeDataLen) {
if (gFakeSeqAtBegin) {
createFakeSeqAtBeginLongMessage(mData, mFakeDataLen);
- } else {
+ }
+ else {
createFakeSequencedLongMessage (mData, mFakeDataLen);
}
}
@@ -324,7 +325,7 @@
if (vFakeDataLen == 1 && gFakeData == QByteArray::fromHex(gFakeData_default)) {
static quint16 txCount = 0;
Types::U16 seq;
- quint8 dataBytesLeft = 0;
+ quint8 dataBytesLeft = 0;
const quint8 crcBytesLen = 2;
for (int i = 0; i < 13; i++) {
switch (i) {
@@ -358,7 +359,8 @@
Types::safeIncrement(txCount);
}
vData += QByteArray::fromHex(data.toHex());
- } else {
+ }
+ else {
vData += gFakeData;
}
}
@@ -379,7 +381,7 @@
if (vFakeDataLen == 1 && gFakeData == QByteArray::fromHex(gFakeData_default)) {
static quint32 txCount = 0;
Types::U32 seq;
- quint8 dataBytesLeft = 0;
+ quint8 dataBytesLeft = 0;
const quint8 crcBytesLen = 2;
for (int i = 0; i < 13; i++) {
switch (i) {
@@ -419,7 +421,8 @@
Types::safeIncrement(txCount);
}
vData += QByteArray::fromHex(data.toHex());
- } else {
+ }
+ else {
vData += gFakeData;
}
}
Index: sources/ApplicationController.h
===================================================================
diff -u -r6aea3fd1baa6992d6eba9938599374f615649fab -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/ApplicationController.h (.../ApplicationController.h) (revision 6aea3fd1baa6992d6eba9938599374f615649fab)
+++ sources/ApplicationController.h (.../ApplicationController.h) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -7,9 +7,9 @@
*
* \file ApplicationController.h
* \author (last) Peter Lucia
- * \date (last) 25-Jun-2020
+ * \date (last) 15-Oct-2020
* \author (original) Behrouz NematiPour
- * \date (original) 24-Sep-2019
+ * \date (original) 26-Aug-2020
*
*/
#pragma once
@@ -42,8 +42,7 @@
* Later with implementation/help of the main state machine will decide on the state of the device what needs to be done.
* \note States are like [Idle, Run on Battery, Fault, FW connection lost] and such
*/
-class ApplicationController : public QObject
-{
+class ApplicationController : public QObject {
Q_OBJECT
// Singleton
@@ -95,6 +94,7 @@
signals:
void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG
void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG
+ void didFailedTransmit(Sequence seq);
void didUSBDriveMount ();
void didUSBDriveUmount();
@@ -104,10 +104,6 @@
void didExport ();
- void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow);
- void didAdjustDuration(quint32 vDuration);
- void didFailedTransmit(Sequence seq);
-
// ---- Signal/Slots
ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS
ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS
Index: sources/gui/qml/components/RangeBar.qml
===================================================================
diff -u -r99e12314855a6b8dd46989b9c0e5263b74af5dc4 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/components/RangeBar.qml (.../RangeBar.qml) (revision 99e12314855a6b8dd46989b9c0e5263b74af5dc4)
+++ sources/gui/qml/components/RangeBar.qml (.../RangeBar.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,8 +6,8 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file RangeBar.qml
- * \author (last) Behrouz NemaiPour
- * \date (last) 04-Jun-2020
+ * \author (last) Behrouz NematiPour
+ * \date (last) 16-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 27-Jan-2020
*
Index: sources/gui/qml/components/RangeRect.qml
===================================================================
diff -u -r9a0581274e4dc51af6d6f3e4dd932581e8dce445 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 9a0581274e4dc51af6d6f3e4dd932581e8dce445)
+++ sources/gui/qml/components/RangeRect.qml (.../RangeRect.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,8 +6,8 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file RangeRect.qml
- * \author (last) Behrouz NemaiPour
- * \date (last) 04-Jun-2020
+ * \author (last) Peter Lucia
+ * \date (last) 06-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 24-Jan-2020
*
@@ -26,6 +26,7 @@
Rectangle { id: _root
signal clicked(var vMouseEvent)
signal dragged(var vMouseEvent)
+ signal pressChanged()
property int decimal : 0
@@ -93,5 +94,8 @@
onClicked: {
_root.clicked(mouse)
}
+ onPressedChanged: {
+ _root.pressChanged();
+ }
}
}
Index: sources/gui/qml/components/TickMarks.qml
===================================================================
diff -u -r605815f54dfac948ada786080f55d1b6e7a0d47b -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/components/TickMarks.qml (.../TickMarks.qml) (revision 605815f54dfac948ada786080f55d1b6e7a0d47b)
+++ sources/gui/qml/components/TickMarks.qml (.../TickMarks.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,8 +6,8 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file TickMarks.qml
- * \author (last) Behrouz NemaiPour
- * \date (last) 04-Jun-2020
+ * \author (last) Behrouz NematiPour
+ * \date (last) 16-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 22-Mar-2020
*
Index: sources/gui/qml/globals/Colors.qml
===================================================================
diff -u -r99e12314855a6b8dd46989b9c0e5263b74af5dc4 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 99e12314855a6b8dd46989b9c0e5263b74af5dc4)
+++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -7,7 +7,7 @@
*
* \file Colors.qml
* \author (last) Peter Lucia
- * \date (last) 01-Jul-2020
+ * \date (last) 15-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 17-Oct-2019
*
@@ -28,74 +28,83 @@
readonly property color transparent : "Transparent" // No Color
readonly property color separatorLine : "#5f809d"
-
- readonly property color backgroundMain : "#1A344D"
+ readonly property color backgroundMain : "#1A344D"
readonly property color backgroundButtonNormal : transparent
- readonly property color backgroundButtonSelect : "#438FEB"
- readonly property color backgroundDialog : "#254670"
- readonly property color backgroundMenu : "#14314C"
- readonly property color backgroundMainMenu : "#0D2639"
- readonly property color backgroundDottedMenu : "#64809D"
- readonly property color backgroundSlider : "#195187"
+ readonly property color backgroundButtonSelect : "#438FEB"
+ readonly property color backgroundButtonSelectDark : "#214773"
+ readonly property color backgroundDialog : "#254670"
+ readonly property color backgroundMenu : "#14314C"
+ readonly property color backgroundMainMenu : "#0D2639"
+ readonly property color backgroundDottedMenu : "#64809D"
+ readonly property color backgroundSlider : "#195187"
- readonly property color backgroundUltrafiltrationButton : "#31568F"
- readonly property color textValueUltrafiltrationButtonFg: "#98aec2"
+ readonly property color backgroundUltrafiltrationButton : "#31568F"
+ readonly property color textValueUltrafiltrationButtonFg : "#98aec2"
- readonly property color backgroundRangeRect : "#3e546e"
- readonly property color highlightProgressBar : "#3d8eef"
- readonly property color highlightMedProgressBar : "#1b2b3e"
- readonly property color textProgressBar : "#88a3c5"
+ readonly property color backgroundRangeRect : "#3e546e"
+ readonly property color highlightProgressBar : "#3d8eef"
+ readonly property color highlightMedProgressBar : "#1b2b3e"
+ readonly property color textProgressBar : "#88a3c5"
readonly property color textRangeMarker : white
readonly property color rangeMarker : white
- readonly property color rangeMarkerShort : "#9fb6d1"
+ readonly property color rangeMarkerShort : "#9fb6d1"
- readonly property color textMain : "#FCFCFC"
- readonly property color textButton : "#FCFCFC" //"#E8E8E8"
- readonly property color textDisableButton : "#607A91"
- readonly property color textTickMark : "#438FEB"
+ readonly property color textMain : "#FCFCFC"
+ readonly property color textButton : "#FCFCFC" //"#E8E8E8"
+ readonly property color textDisableButton : "#607A91"
+ readonly property color textTickMark : "#438FEB"
- readonly property color borderButton : "#4290EC" //K:D //"#438FEB"
- readonly property color borderDisableButton : "#607A91"
- readonly property color boderSeparatorLine : "#476982"
- readonly property color borderDialog : transparent // "#D01A344D" // "#D00F0F0F" //"#F51A344D"
+ readonly property color borderButton : "#4290EC" //K:D //"#438FEB"
+ readonly property color borderDisableButton : "#607A91"
+ readonly property color boderSeparatorLine : "#476982"
+ readonly property color borderDialog : transparent // different colors for different displays // "#D01A344D" // "#D00F0F0F" //"#F51A344D"
- readonly property color touchTextAreaTitle : "#a0b6d0"
+ readonly property color touchTextAreaTitle : "#a0b6d0"
readonly property color textTextRectTitle : white
- readonly property color textTextRectLabel : "#e8e8e8"
- readonly property color textTextRectExtra : "#708795"
+ readonly property color textTextRectLabel : "#e8e8e8"
+ readonly property color textTextRectExtra : "#708795"
- readonly property color line : "#094266"
+ readonly property color line : "#094266"
readonly property color pressuresText : white
- readonly property color pressuresArterialBar : "#31bcdb"
- readonly property color pressuresVenousBar : "#c568ed"
+ readonly property color pressuresArterialBar : "#31bcdb"
+ readonly property color pressuresVenousBar : "#c568ed"
readonly property color pressuresOutOfRaneBg : red
readonly property color fluidText : white
readonly property color fluidValue : white
- readonly property color fluidUnit : "#708795"
+ readonly property color fluidUnit : "#708795"
readonly property color textNotificationNoneBg : white
- readonly property color textNotificationNoneFg : "#1b2b3e"
+ readonly property color textNotificationNoneFg : "#1b2b3e"
- readonly property color textNotificationLowBg : "#f5a623" // ?
+ readonly property color textNotificationLowBg : "#f5a623" // ?
readonly property color textNotificationLowFg : white // ?
- readonly property color textNotificationMedBg : "#f5a623" // ?
+ readonly property color textNotificationMedBg : "#f5a623" // ?
readonly property color textNotificationMedFg : white // ?
readonly property color textNotificationHighBg : red
readonly property color textNotificationHighFg : white
- readonly property color alarmTopBarHighBg : "#831913"
+ readonly property color alarmTopBarHighBg : "#831913"
readonly property color alarmTopBarHighFg : white
- readonly property color alarmTopBarMedBg : "#db8f00"
+ readonly property color alarmTopBarMedBg : "#db8f00"
readonly property color alarmTopBarMedFg : white
- readonly property color alarmTopBarLowBg : "#db8f00"
+ readonly property color alarmTopBarLowBg : "#db8f00"
readonly property color alarmTopBarLowFg : white
+ readonly property color createTreatmentActive : "#3d8eef"
+ readonly property color createTreatmentInactive : "#3e546e"
+ readonly property color createTreatmentNotReady : "#1f4974"
+ readonly property color createTreatmentReady : "#438FEB"
+ readonly property color createTreatmentTextNotReady : "#507090"
+ readonly property color createTreatmentTextReady : "white"
+ readonly property color createTreatmentInvalidParam : "red"
+
+
}
Index: sources/gui/qml/globals/Fonts.qml
===================================================================
diff -u -r9a0581274e4dc51af6d6f3e4dd932581e8dce445 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 9a0581274e4dc51af6d6f3e4dd932581e8dce445)
+++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -7,7 +7,7 @@
*
* \file Fonts.qml
* \author (last) Peter Lucia
- * \date (last) 06-Jul-2020
+ * \date (last) 15-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 17-Oct-2019
*
@@ -25,6 +25,7 @@
QtObject {
readonly property int fontPixelButton : 24
readonly property int fontPixelTitle : 42
+ readonly property int fontPixelSection : 36
readonly property int fontPixelDialogText : 22
readonly property int fontPixelTouchAreaTitle : 16
Index: sources/gui/qml/globals/Variables.qml
===================================================================
diff -u -r9a0581274e4dc51af6d6f3e4dd932581e8dce445 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 9a0581274e4dc51af6d6f3e4dd932581e8dce445)
+++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,8 +6,8 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file Variables.qml
- * \author (last) Behrouz NematiPour
- * \date (last) 10-Aug-2020
+ * \author (last) Peter Lucia
+ * \date (last) 06-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 09-Oct-2019
*
@@ -23,12 +23,12 @@
* which is going to be used in the project.
*/
QtObject {
- readonly property int applicationWidth : 1280
- readonly property int applicationHeight : 800
- readonly property int buttonSpacing : 150
- readonly property int dialogSVGHeight : 50
- readonly property int dialogSVGWidth : 50
- readonly property int dialogSVGIconOffset : 25
+ readonly property int applicationWidth : 1280
+ readonly property int applicationHeight : 800
+ readonly property int buttonSpacing : 150
+ readonly property int dialogIconHeight : 50
+ readonly property int dialogIconWidth : 50
+ readonly property int dialogIconHorizontalOffset: 25
readonly property int headerHeight : 100
readonly property int mainMenuHeight : 70
@@ -70,16 +70,24 @@
readonly property int progressbarHandler : 35
readonly property int progressbarFluidHeight: 5
+ readonly property int progressbarSmall : 5
+ readonly property int progressbarSmallWidth : 600
+ readonly property int progressbarRectHeight : 50
+ readonly property int progressbarRectWidth : 620
readonly property int sliderTextMargin : 20
+ readonly property int treatmentSpacing : 60
readonly property int notificationHeight : 50
readonly property int notificationIconSize : 36
readonly property int backIconDiameter : 17
readonly property int pauseIconDiameter : 60
+ readonly property int topBarMenuHeight : 100
+ readonly property int sliderCircleDiameter : 25
+
readonly property int pressuresProgressbarWidth : 725
readonly property int ultrafiltrationProgressbarWidth : 880
@@ -115,5 +123,7 @@
// - Fluid
readonly property string unitTextSaline : qsTr("mL")
readonly property string unitTextHeparin : qsTr("mL")
+ // - Create Treatment
+ readonly property string unitTextBPMeasurementInterval : qsTr("min")
}
Index: sources/gui/qml/pages/treatment/TreatmentStack.qml
===================================================================
diff -u -r9a0581274e4dc51af6d6f3e4dd932581e8dce445 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 9a0581274e4dc51af6d6f3e4dd932581e8dce445)
+++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -7,7 +7,7 @@
*
* \file TreatmentStack.qml
* \author (last) Behrouz NematiPour
- * \date (last) 18-Aug-2020
+ * \date (last) 16-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 27-Jan-2020
*
@@ -17,15 +17,19 @@
import QtQuick 2.12
// Project
-import Gui.Actions 0.1
-import VTreatmentRanges 0.1
-import VTreatmentAdjustmentSaline 0.1
-import VHDTreatmentStates 0.1
+import Gui.Actions 0.1
+import VTreatmentRanges 0.1
+import VTreatmentAdjustmentSaline 0.1
+import VHDTreatmentStates 0.1
+import VTreatmentAdjustmentUltrafiltrationState 0.1
+import VTreatmentAdjustmentUltrafiltrationEdit 0.1
+import VTreatmentAdjustmentUltrafiltrationConfirm 0.1
// Qml imports
import "qrc:/globals"
import "qrc:/components"
import "qrc:/pages/treatment/adjustments"
+
/*!
* \brief TreatmentStack is the screen
* which contains the main stack for all the Trearment screens
@@ -38,16 +42,31 @@
stackView.initialItem : _treatmentHome
// Views
- VTreatmentRanges { id: vTreatmentRanges }
- VTreatmentAdjustmentSaline { id: vTreatmentAdjustmentSaline }
- VHDTreatmentStates { id: vHDTreatmentStates
- property bool ufPaused : ufState === GuiActions.UF_PAUSED_STATE
- property bool txPaused : subMode === GuiActions.TREATMENT_DIALYSIS_STATE
- }
+ VTreatmentRanges { id: vTreatmentRanges }
+ VTreatmentAdjustmentSaline { id: vTreatmentAdjustmentSaline }
+ VHDTreatmentStates { id: vHDTreatmentStates }
+ VTreatmentAdjustmentUltrafiltrationState { id: vTreatmentAdjustmentUltrafiltrationState }
+ VTreatmentAdjustmentUltrafiltrationEdit { id: vTreatmentAdjustmentUltrafiltrationEdit }
+ VTreatmentAdjustmentUltrafiltrationConfirm { id: vTreatmentAdjustmentUltrafiltrationConfirm }
+ // ultrafiltration state information bar properties
+ readonly property bool isUFPaused : vHDTreatmentStates.ufPaused
+ readonly property bool isUFOff : vHDTreatmentStates.ufOff
+ readonly property bool isUFRunning : vHDTreatmentStates.ufRunning
+ readonly property bool isUFCompleted : vHDTreatmentStates.ufCompleted
+ readonly property string ufInfoImageSource : isUFPaused ? "qrc:/images/iPauseGray" :
+ isUFOff ? "qrc:/images/iOffGray" :
+ isUFCompleted ? "qrc:/images/iDone" : ""
+ readonly property string ufInfoText : isUFPaused ? qsTr("Ultrafiltration is paused" ) :
+ isUFOff ? qsTr("Ultrafiltration is off" ) :
+ isUFCompleted ? qsTr("Ultrafiltration is completed" ) : ""
+ readonly property string ufInfoTextColor : isUFPaused ? "gray" :
+ isUFOff ? "gray" :
+ isUFCompleted ? "lightgray" : ""
+
// Components
MainMenu { id: _treatmentMenu
- y : -Variables.mainMenuHeight
+ y : Variables.mainMenuHeight * -1
position : MainMenu.Position.Top
hidden : true
titles : [ qsTr("Back") , qsTr("Treatment") , qsTr("Trending") , qsTr("Settings") ]
@@ -79,21 +98,35 @@
_treatmentAdjustmentDuration.open()
}
onSectionUltrafiltrationClicked: {
- if (
- vTreatmentAdjustmentUltrafiltrationState.isPaused || // comes from the treatment adjustment
- vHDTreatmentStates.ufPaused // comes from the broadcast Treatment States salineState field
- ) {
- _treatmentAdjustmentUltrafiltrationPaused.open()
- } else {
+ if ( isUFRunning ) {
_treatmentAdjustmentUltrafiltrationStart .open()
+ } else {
+ _treatmentAdjustmentUltrafiltrationPaused.open()
}
}
}
TreatmentCreate { id: _treatmentCreate
+ onBackClicked : pop()
+ onContinueClicked : vCreateTreatment.onFinishedCreate()
+ }
+
+ TreatmentConfirm { id: _treatmentConfirm
onBackClicked : pop()
+ onConfirmClicked : vCreateTreatment.onFinishedConfirm()
}
+ TreatmentPrime { id: _treatmentPrime
+ onBackClicked : pop()
+ onContinueClicked : vCreateTreatment.onFinishedPrime()
+ }
+
+ TreatmentBegin { id: _treatmentBegin
+ onBackClicked : pop()
+ onStartClicked : vCreateTreatment.onStart()
+ }
+
+
//// Treatment Adjustment Dialogs
TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow
onCloseClicked : close()
@@ -189,17 +222,18 @@
Connections { target: vTreatmentAdjustmentUltrafiltrationState
onAdjustmentTriggered : {
if ( vTreatmentAdjustmentUltrafiltrationState.adjustment_Accepted ) {
- if ( vTreatmentAdjustmentUltrafiltrationState.isPaused ) {
+ if (vHDTreatmentStates.ufPaused) { // handle screen regarding current accepted
_treatmentAdjustmentUltrafiltrationStart .close()
_treatmentAdjustmentUltrafiltrationPaused.open ()
} else {
_treatmentAdjustmentUltrafiltrationPaused.close()
}
- } else {
- if ( vTreatmentAdjustmentUltrafiltrationState.isPaused ) {
- _treatmentAdjustmentUltrafiltrationPaused.notification.text = vTreatmentAdjustmentUltrafiltrationState.text()
+ }
+ else {
+ if (vHDTreatmentStates.ufRunning) { // handle error messages regarding current accepted
+ _treatmentAdjustmentUltrafiltrationStart.notificationText = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText
} else {
- _treatmentAdjustmentUltrafiltrationStart .notification.text = vTreatmentAdjustmentUltrafiltrationState.text()
+ _treatmentAdjustmentUltrafiltrationPaused.notificationText = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText
}
}
}
@@ -227,13 +261,17 @@
Connections { target: vTreatmentAdjustmentUltrafiltrationConfirm
onAdjustmentTriggered : {
if (vTreatmentAdjustmentUltrafiltrationConfirm.adjustment_Accepted) {
- // HD resumes the ultrafiltration and no need to recall the doPause just update the state
- vTreatmentAdjustmentUltrafiltrationState.isPaused = false
- vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentUltrafiltrationConfirm.volume
+ vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentUltrafiltrationConfirm.volume
_treatmentAdjustmentUltrafiltrationConfirm.close()
} else {
_treatmentAdjustmentUltrafiltrationConfirm.notification.text = vTreatmentAdjustmentUltrafiltrationConfirm.text()
}
}
}
+
+ Connections { target: vCreateTreatment
+ onShowConfirm : { push(_treatmentConfirm) }
+ onShowPrime : { push(_treatmentPrime ) }
+ onShowBegin : { push(_treatmentBegin ) }
+ }
}
Index: sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml
===================================================================
diff -u -r9a0581274e4dc51af6d6f3e4dd932581e8dce445 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision 9a0581274e4dc51af6d6f3e4dd932581e8dce445)
+++ sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,8 +6,8 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file TreatmentPressure.qml
- * \author (last) Behrouz NemaiPour
- * \date (last) 10-Jun-2020
+ * \author (last) Behrouz NematiPour
+ * \date (last) 16-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 27-Jan-2020
*
@@ -54,7 +54,7 @@
rangebar.color: Colors.pressuresArterialBar
markerOutRangeNotify: true
- value : vTreatmentPressureOcclusion.pressureocclusion_ArterialPressure
+ value : vTreatmentPressureOcclusion.pressureocclusion_ArterialPressure
minimum : _root.arterialMinimum
lowerBound : _root.arterialLowerBound
Index: sources/storage/FileHandler.h
===================================================================
diff -u -r84c5373209a1a488c00917995f5553d442d159a4 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/storage/FileHandler.h (.../FileHandler.h) (revision 84c5373209a1a488c00917995f5553d442d159a4)
+++ sources/storage/FileHandler.h (.../FileHandler.h) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,16 +6,18 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file FileHandler.h
- * \author (last) Behrouz NematiPour
- * \date (last) 25-Aug-2020
+ * \author (last) Peter Lucia
+ * \date (last) 15-Oct-2020
* \author (original) Behrouz NematiPour
- * \date (original) 24-Sep-2019
+ * \date (original) 26-Aug-2020
*
*/
#pragma once
// Qt
#include
+#include
+#include
class QDate;
namespace Storage {
@@ -32,12 +34,13 @@
static void errOut(const QString &vMessage);
public:
- static bool write(const QString &vFileName, const QString &vContent, bool vAppend = true);
- static bool read (const QString &vFileName, QString &vContent);
+ static bool write (const QString &vFileName, const QString &vContent, bool vAppend = true);
+ static bool read (const QString &vFileName, QString &vContent);
+ static bool readJSON (const QString &vFileName, QJsonObject &vContent);
- static int copyFolder (const QString &vSource, const QString &vDestination);
+ static int copyFolder (const QString &vSource , const QString &vDestination);
static int removeFiles(const QStringList &vFolders, const QStringList &vNameFilter, const QDate &vDateOlderThan);
- static bool makeFolder (const QString &vFolder);
- static bool isMounted (const QString &vPath, bool *vIsReadOnly = nullptr);
+ static bool makeFolder (const QString &vFolder);
+ static bool isMounted (const QString &vPath, bool *vIsReadOnly = nullptr);
};
}
Index: sources/view/VEventSpy.cpp
===================================================================
diff -u -r605815f54dfac948ada786080f55d1b6e7a0d47b -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 605815f54dfac948ada786080f55d1b6e7a0d47b)
+++ sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -7,7 +7,7 @@
*
* \file VEventSpy.cpp
* \author (last) Behrouz NematiPour
- * \date (last) 23-Aug-2020
+ * \date (last) 16-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 23-Aug-2020
*
@@ -79,18 +79,21 @@
}
/*!
- * \brief VEventSpy::mouseEventSpy
+ * \brief VEventSpy::mouseEventSpy
* \details Mouse event spy
- * \param vEvent - mouse event
- * \param typeName - mouse button type name
+ * if needs to spy on the mouse events
+ * (which is happening on the desktop only since there is not mouse attached to the device)
+ * Remove comment of the #define SPY_MOUSE_EVENT
+ * \param vEvent - mouse event
+ * \param vTypeName - mouse button type name
*/
// coco begin validated: this code has been manually tested.
// the only intention of this code is to be used for EMC testing and has been tested and is working fine.
-void VEventSpy::mouseEventSpy(QEvent *vEvent, const QString &typeName)
+void VEventSpy::mouseEventSpy(QEvent *vEvent, const QString &vTypeName)
{
#ifndef SPY_MOUSE_EVENT
Q_UNUSED(vEvent)
- Q_UNUSED(typeName)
+ Q_UNUSED(vTypeName)
#else
QMouseEvent *mouseEvent = static_cast(vEvent);
int x = mouseEvent->x();
@@ -119,7 +122,7 @@
default : break;
}
- LOG_DEBUG( btn + typeName + mdf +
+ LOG_DEBUG( btn + vTypeName + mdf +
QString(",%1,%2")
.arg(x, 4, 10, QChar('0'))
.arg(y, 4, 10, QChar('0')));
@@ -139,7 +142,7 @@
/*!
* \brief VEventSpy::touchEventSpy
* \param vEvent - touch event
- * \param typeName - The type of the QEvent which has been shortened e.g. tB: TouchBegin
+ * \param vTypeName - The type of the QEvent which has been shortened e.g. tB: TouchBegin
*/
// coco begin validated: this code has been manually tested.
// the only intention of this code is to be used for EMC testing and has been tested and is working fine.
Index: unittests/tst_models.cpp
===================================================================
diff -u -r12e7b6dda53cf8db7707c7fa55dcf6137e7d6997 -r9d8a60eb984003d3f7814cbe507b1b37f519bc80
--- unittests/tst_models.cpp (.../tst_models.cpp) (revision 12e7b6dda53cf8db7707c7fa55dcf6137e7d6997)
+++ unittests/tst_models.cpp (.../tst_models.cpp) (revision 9d8a60eb984003d3f7814cbe507b1b37f519bc80)
@@ -6,8 +6,8 @@
* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
*
* \file tst_models.cpp
- * \author (last) Behrouz NematiPour
- * \date (last) 13-Aug-2020
+ * \author (last) Peter Lucia
+ * \date (last) 15-Oct-2020
* \author (original) Behrouz NematiPour
* \date (original) 21-Apr-2020
*
@@ -49,8 +49,11 @@
#include "MAlarmTriggered.h"
#include "MAlarmCleared.h"
-// #define CONSOLEOUT
+#include "MTreatmentParameters.h"
+#include "MTreatmentParametersResp.h"
+#undef CONSOLEOUT
+
/*!
* \brief tst_models::tst_models
* \details Constructor
@@ -226,8 +229,19 @@
{
QTest::addColumn("errorIndex");
QTest::addColumn("data");
- QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01"));
- QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray());
+ QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B"));
+ QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray());
+ QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00"));
+ QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01"));
+ QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02"));
+ QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03"));
+ QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04"));
+ QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05"));
+ QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06"));
+ QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07"));
+ QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08"));
+ QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09"));
+ QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A"));
}
void tst_models::tst_MAdjustUltrafiltrationStateResponse ()
@@ -246,8 +260,10 @@
#endif
switch (errorIndex) {
- case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
- case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
+ case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
+ case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
+ case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
+ case 3: { index = index * sizeof mData._data.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
default:
QVERIFY2(false, "Incorrect Test");
break;
@@ -470,7 +486,7 @@
#endif
switch (errorIndex) {
- case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
+ case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
case 1: { index = index * sizeof mData._data.mROInletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
case 2: { index = index * sizeof mData._data.mROOutletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
case 3: { index = index * sizeof mData._data.mDrainInletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
@@ -1379,6 +1395,131 @@
}
}
+void tst_models::tst_MTreatmentParametersResp_data()
+{
+ QTest::addColumn("errorIndex");
+ QTest::addColumn("data");
+ QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48"));
+ QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray());
+ QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray("00"));
+ QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray("00" "01"));
+ QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02"));
+ QTest::newRow("bloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" ));
+ QTest::newRow("bloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04"));
+ QTest::newRow("bloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05"));
+ QTest::newRow("bloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06"));
+ QTest::newRow("dialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07"));
+ QTest::newRow("dialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08"));
+ QTest::newRow("dialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09"));
+ QTest::newRow("dialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A"));
+ QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B"));
+ QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C"));
+ QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D"));
+ QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E"));
+ QTest::newRow("heparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"));
+ QTest::newRow("heparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10"));
+ QTest::newRow("heparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11"));
+ QTest::newRow("heparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12"));
+ QTest::newRow("heparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13"));
+ QTest::newRow("heparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14"));
+ QTest::newRow("heparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15"));
+ QTest::newRow("heparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16"));
+ QTest::newRow("heparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17"));
+ QTest::newRow("heparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18"));
+ QTest::newRow("heparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19"));
+ QTest::newRow("heparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A"));
+ QTest::newRow("salineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B"));
+ QTest::newRow("salineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C"));
+ QTest::newRow("salineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D"));
+ QTest::newRow("salineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E"));
+ QTest::newRow("acidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F"));
+ QTest::newRow("acidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20"));
+ QTest::newRow("acidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21"));
+ QTest::newRow("acidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22"));
+ QTest::newRow("bicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23"));
+ QTest::newRow("bicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24"));
+ QTest::newRow("bicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25"));
+ QTest::newRow("bicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26"));
+ QTest::newRow("dialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27"));
+ QTest::newRow("dialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28"));
+ QTest::newRow("dialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29"));
+ QTest::newRow("dialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A"));
+ QTest::newRow("dialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C"));
+ QTest::newRow("dialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D"));
+ QTest::newRow("dialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E"));
+ QTest::newRow("dialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F"));
+ QTest::newRow("arterialPressureLimitLow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30"));
+ QTest::newRow("arterialPressureLimitLow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31"));
+ QTest::newRow("arterialPressureLimitLow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32"));
+ QTest::newRow("arterialPressureLimitLow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33"));
+ QTest::newRow("arterialPressureLimitHigh") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34"));
+ QTest::newRow("arterialPressureLimitHigh") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35"));
+ QTest::newRow("arterialPressureLimitHigh") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36"));
+ QTest::newRow("arterialPressureLimitHigh") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37"));
+ QTest::newRow("venousPressureLimitLow") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38"));
+ QTest::newRow("venousPressureLimitLow") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39"));
+ QTest::newRow("venousPressureLimitLow") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A"));
+ QTest::newRow("venousPressureLimitLow") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B"));
+ QTest::newRow("venousPressureLimitHigh") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C"));
+ QTest::newRow("venousPressureLimitHigh") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D"));
+ QTest::newRow("venousPressureLimitHigh") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E"));
+ QTest::newRow("venousPressureLimitHigh") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F"));
+ QTest::newRow("bloodPressureMeasureInterval") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40"));
+ QTest::newRow("bloodPressureMeasureInterval") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41"));
+ QTest::newRow("bloodPressureMeasureInterval") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42"));
+ QTest::newRow("bloodPressureMeasureInterval") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43"));
+ QTest::newRow("rinsebackFlowRate") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44"));
+ QTest::newRow("rinsebackFlowRate") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45"));
+ QTest::newRow("rinsebackFlowRate") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46"));
+ QTest::newRow("rinsebackFlowRate") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47"));
+}
+
+
+void tst_models::tst_MTreatmentParametersResp()
+{
+ Model::MTreatmentParametersResponse mData;
+
+
+ QFETCH(int , errorIndex );
+ QFETCH(QByteArray, data );
+
+ int startIndex = 0;
+ int index = errorIndex - 1;
+ bool ok = mData.fromByteArray(data, &startIndex);
+
+ Q_UNUSED(ok)
+#ifdef CONSOLEOUT
+ qDebug() << "index: " << index << "\n"
+ << "errorIndex: " << errorIndex << "\n"
+ << "startIndex: " << startIndex << "\n"
+ << "ok: " << ok << "\n"
+ << "data: " << data;
+#endif
+ switch (errorIndex) {
+ case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 1: { index = index * sizeof mData._data.requestValid ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 2: { index = index * sizeof mData._data.bloodFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 3: { index = index * sizeof mData._data.dialysateFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 4: { index = index * sizeof mData._data.duration ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 5: { index = index * sizeof mData._data.heparinDispensingRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 6: { index = index * sizeof mData._data.heparinBolusVolume ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 7: { index = index * sizeof mData._data.heparinStopTime ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 8: { index = index * sizeof mData._data.salineBolus ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 9: { index = index * sizeof mData._data.acidConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 10: { index = index * sizeof mData._data.bicarbonateConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 11: { index = index * sizeof mData._data.dialyzerType ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 12: { index = index * sizeof mData._data.dialysateTemp ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 13: { index = index * sizeof mData._data.arterialPressureLimitLow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 14: { index = index * sizeof mData._data.arterialPressureLimitHigh ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 15: { index = index * sizeof mData._data.venousPressureLimitLow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 16: { index = index * sizeof mData._data.venousPressureLimitHigh ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 17: { index = index * sizeof mData._data.bloodPressureMeasureInterval ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ case 18: { index = index * sizeof mData._data.rinsebackFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break;
+ default: QVERIFY2(false, "Incorrect Test");
+ break;
+ }
+}
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentSalineBolusData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentSalineBolusData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ //
@@ -1403,12 +1544,14 @@
void tst_models::tst_MTreatmentSalineBolusData() {
Model::MTreatmentSaline mData;
+
QFETCH(int , errorIndex );
QFETCH(QByteArray, data );
int startIndex = 0;
int index = errorIndex - 1;
bool ok = mData.fromByteArray(data, &startIndex);
+
Q_UNUSED(ok)
#ifdef CONSOLEOUT
qDebug() << index << errorIndex << startIndex << ok << data ;
@@ -1425,13 +1568,121 @@
}
}
+void tst_models::tst_MTreatmentParametersResp_fromVariantList()
+{
+ Model::MTreatmentParametersResponse mData;
+
+ QVariantList list;
+ for (int i = 0; i < 20; ++i)
+ {
+
+ list.append(QVariant(1));
+ AdjustTreatmentParametersResponseData tempData = mData.fromVariantList(list);
+ if (i == 17) {
+ QVERIFY(1 == tempData.requestValid);
+ QVERIFY(1 == tempData.bloodFlowRate);
+ QVERIFY(1 == tempData.dialysateFlowRate);
+ QVERIFY(1 == tempData.duration);
+ QVERIFY(1 == tempData.heparinDispensingRate);
+ QVERIFY(1 == tempData.heparinBolusVolume);
+ QVERIFY(1 == tempData.heparinStopTime);
+ QVERIFY(1 == tempData.salineBolus);
+ QVERIFY(1 == tempData.acidConcentrate);
+ QVERIFY(1 == tempData.bicarbonateConcentrate);
+ QVERIFY(1 == tempData.dialyzerType);
+ QVERIFY(1 == tempData.dialysateTemp);
+ QVERIFY(1 == tempData.arterialPressureLimitLow);
+ QVERIFY(1 == tempData.arterialPressureLimitHigh);
+ QVERIFY(1 == tempData.venousPressureLimitLow);
+ QVERIFY(1 == tempData.venousPressureLimitHigh);
+ QVERIFY(1 == tempData.bloodPressureMeasureInterval);
+ QVERIFY(1 == tempData.rinsebackFlowRate);
+ }
+ else {
+ AdjustTreatmentParametersResponseData data;
+ QVERIFY(data.requestValid == tempData.requestValid);
+ QVERIFY(data.bloodFlowRate == tempData.bloodFlowRate);
+ QVERIFY(data.dialysateFlowRate == tempData.dialysateFlowRate);
+ QVERIFY(data.duration == tempData.duration);
+ QVERIFY(data.heparinDispensingRate == tempData.heparinDispensingRate);
+ QVERIFY(data.heparinBolusVolume == tempData.heparinBolusVolume);
+ QVERIFY(data.heparinStopTime == tempData.heparinStopTime);
+ QVERIFY(data.salineBolus == tempData.salineBolus);
+ QVERIFY(data.acidConcentrate == tempData.acidConcentrate);
+ QVERIFY(data.bicarbonateConcentrate == tempData.bicarbonateConcentrate);
+ QVERIFY(data.dialyzerType == tempData.dialyzerType);
+ QVERIFY(data.dialysateTemp == tempData.dialysateTemp);
+ QVERIFY(data.arterialPressureLimitLow == tempData.arterialPressureLimitLow);
+ QVERIFY(data.arterialPressureLimitHigh == tempData.arterialPressureLimitHigh);
+ QVERIFY(data.venousPressureLimitLow == tempData.venousPressureLimitLow);
+ QVERIFY(data.venousPressureLimitHigh == tempData.venousPressureLimitHigh);
+ QVERIFY(data.bloodPressureMeasureInterval== tempData.bloodPressureMeasureInterval);
+ QVERIFY(data.rinsebackFlowRate == tempData.rinsebackFlowRate);
+
+ }
+ }
+}
+
+
+void tst_models::tst_MTreatmentParameters_fromVariantList()
+{
+ Model::MAdjustTreatmentParametersRequest mData;
+
+ QVariantList list;
+ for (int i = 0; i < 20; ++i)
+ {
+
+ list.append(QVariant(1));
+ AdjustTreatmentParametersRequestData tempData = mData.fromVariantList(list);
+ if (i == 16) {
+ QVERIFY(1 == tempData.bloodFlowRate);
+ QVERIFY(1 == tempData.dialysateFlowRate);
+ QVERIFY(1 == tempData.duration);
+ QVERIFY(1 == tempData.heparinDispensingRate);
+ QVERIFY(1 == tempData.heparinBolusVolume);
+ QVERIFY(1 == tempData.heparinStopTime);
+ QVERIFY(1 == tempData.salineBolus);
+ QVERIFY(1 == tempData.acidConcentrate);
+ QVERIFY(1 == tempData.bicarbonateConcentrate);
+ QVERIFY(1 == tempData.dialyzerType);
+ QVERIFY(1 == tempData.dialysateTemp);
+ QVERIFY(1 == tempData.arterialPressureLimitLow);
+ QVERIFY(1 == tempData.arterialPressureLimitHigh);
+ QVERIFY(1 == tempData.venousPressureLimitLow);
+ QVERIFY(1 == tempData.venousPressureLimitHigh);
+ QVERIFY(1 == tempData.bloodPressureMeasureInterval);
+ QVERIFY(1 == tempData.rinsebackFlowRate);
+ }
+ else {
+ AdjustTreatmentParametersRequestData data;
+ QVERIFY(data.bloodFlowRate == tempData.bloodFlowRate);
+ QVERIFY(data.dialysateFlowRate == tempData.dialysateFlowRate);
+ QVERIFY(data.duration == tempData.duration);
+ QVERIFY(data.heparinDispensingRate == tempData.heparinDispensingRate);
+ QVERIFY(data.heparinBolusVolume == tempData.heparinBolusVolume);
+ QVERIFY(data.heparinStopTime == tempData.heparinStopTime);
+ QVERIFY(data.salineBolus == tempData.salineBolus);
+ QVERIFY(data.acidConcentrate == tempData.acidConcentrate);
+ QVERIFY(data.bicarbonateConcentrate == tempData.bicarbonateConcentrate);
+ QVERIFY(data.dialyzerType == tempData.dialyzerType);
+ QVERIFY(data.dialysateTemp == tempData.dialysateTemp);
+ QVERIFY(data.arterialPressureLimitLow == tempData.arterialPressureLimitLow);
+ QVERIFY(data.arterialPressureLimitHigh == tempData.arterialPressureLimitHigh);
+ QVERIFY(data.venousPressureLimitLow == tempData.venousPressureLimitLow);
+ QVERIFY(data.venousPressureLimitHigh == tempData.venousPressureLimitHigh);
+ QVERIFY(data.bloodPressureMeasureInterval== tempData.bloodPressureMeasureInterval);
+ QVERIFY(data.rinsebackFlowRate == tempData.rinsebackFlowRate);
+
+ }
+ }
+}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSalineBolusResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSalineBolusResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ //
void tst_models::tst_MSalineBolusResponse_data () {
QTest::addColumn("errorIndex");
QTest::addColumn("data");
- QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B"));
+ QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F"));
QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray());
QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00"));
QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01"));
@@ -1444,6 +1695,10 @@
QTest::newRow("mTarget ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08"));
QTest::newRow("mTarget ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09"));
QTest::newRow("mTarget ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A"));
+ QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B"));
+ QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C"));
+ QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D"));
+ QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E"));
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSalineBolusResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ //
void tst_models::tst_MSalineBolusResponse() {
@@ -1465,6 +1720,7 @@
case 1: { index = index * sizeof mData._data.mAccepted; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
case 3: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
+ case 4: { index = index * sizeof mData._data.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break;
default:
QVERIFY2(false, "Incorrect Test");
break;