Index: denali.pro =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -recb2c280db303fbf2321b484572c092ae2c55cce --- denali.pro (.../denali.pro) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ denali.pro (.../denali.pro) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -53,8 +53,8 @@ common/MsgDefs.h \ \ # Main sources/main.h \ - sources/model/mtreatmentparameters.h \ - sources/model/mtreatmentparametersresp.h \ + sources/model/MTreatmentParameters.h \ + sources/model/MTreatmentParametersResp.h \ sources/storage/filesaver.h \ sources/model/MDGDebugText.h \ sources/model/MHDDebugText.h \ @@ -163,8 +163,8 @@ \ # common \ # Main main.cpp \ - sources/model/mtreatmentparameters.cpp \ - sources/model/mtreatmentparametersresp.cpp \ + sources/model/MTreatmentParameters.cpp \ + sources/model/MTreatmentParametersResp.cpp \ sources/storage/filesaver.cpp \ sources/model/MDGDebugText.cpp \ sources/model/MHDDebugText.cpp \ Index: sources/applicationcontroller.h =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -recb2c280db303fbf2321b484572c092ae2c55cce --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -23,7 +23,7 @@ #include "applicationpost.h" #include "MModel.h" #include "messageglobals.h" -#include "mtreatmentparameters.h" +#include "MTreatmentParameters.h" // define #define _ApplicationController ApplicationController::I() Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -recb2c280db303fbf2321b484572c092ae2c55cce --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -21,7 +21,7 @@ // Project #include "logger.h" #include "format.h" -#include "mtreatmentparameters.h" +#include "MTreatmentParameters.h" using namespace Can; using namespace Model; Index: sources/model/MModel.h =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -recb2c280db303fbf2321b484572c092ae2c55cce --- sources/model/MModel.h (.../MModel.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/model/MModel.h (.../MModel.h) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -40,8 +40,8 @@ #include "MDGTemperaturesData.h" #include "MDGValvesStatesData.h" -#include "mtreatmentparameters.h" -#include "mtreatmentparametersresp.h" +#include "MTreatmentParameters.h" +#include "MTreatmentParametersResp.h" #include "MHDDebugText.h" #include "MDGDebugText.h" Index: sources/model/MTreatmentParameters.cpp =================================================================== diff -u --- sources/model/MTreatmentParameters.cpp (revision 0) +++ sources/model/MTreatmentParameters.cpp (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -0,0 +1,55 @@ +#include "MTreatmentParameters.h" +using namespace Model; + +TreatmentParameters::TreatmentParameters() {} + +QString TreatmentParameters::toString() +{ + return QString(stringPrefix + "(%0, %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16)") + .arg(data.bloodFlowRate) + .arg(data.dialysateFlowRate) + .arg(data.duration) + .arg(data.heparinDispensingRate) + .arg(data.heparinBolusVolume) + .arg(data.heparinStopTime) + .arg(data.salineBolus) + .arg(data.acidConcentrate) + .arg(data.bicarbonateConcentrate) + .arg(data.dialyzerType) + .arg(data.dialysateTemp) + .arg(data.arterialPressureLimitLow) + .arg(data.arterialPressureLimitHigh) + .arg(data.venousPressureLimitLow) + .arg(data.venousPressureLimitHigh) + .arg(data.bloodPressureMeasureInterval) + .arg(data.rinsebackFlowRate); +} + +TreatmentParameters::Data TreatmentParameters::fromVariantList(const QVariantList &list) +{ + Data data; + if (list.length() != 17) + { + qDebug() << "Invalid QVariant List found in " << __FUNCTION__; + qDebug() << list; + return data; + } + data.bloodFlowRate = list[0].toUInt(); + data.dialysateFlowRate = list[1].toUInt(); + data.duration = list[2].toUInt(); + data.heparinDispensingRate = list[3].toUInt(); + data.heparinBolusVolume = list[4].toUInt(); + data.heparinStopTime = list[5].toUInt(); + data.salineBolus = list[6].toUInt(); + data.acidConcentrate = list[7].toUInt(); + data.bicarbonateConcentrate = list[8].toUInt(); + data.dialyzerType = list[9].toUInt(); + data.dialysateTemp = list[10].toUInt(); + data.arterialPressureLimitLow = list[11].toInt(); + data.arterialPressureLimitHigh = list[12].toInt(); + data.venousPressureLimitLow = list[13].toInt(); + data.venousPressureLimitHigh = list[14].toInt(); + data.bloodPressureMeasureInterval = list[15].toUInt(); + data.rinsebackFlowRate = list[16].toUInt(); + return data; +} Index: sources/model/MTreatmentParameters.h =================================================================== diff -u --- sources/model/MTreatmentParameters.h (revision 0) +++ sources/model/MTreatmentParameters.h (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -0,0 +1,47 @@ +#ifndef MTREATMENTPARAMETERS_H +#define MTREATMENTPARAMETERS_H + +// Qt + +// Project +#include "types.h" +class tst_models; + +namespace Model { +class TreatmentParameters +{ + friend class::tst_models; +public: + TreatmentParameters(); + + struct Data { + quint32 bloodFlowRate = 0; // mL/min + quint32 dialysateFlowRate = 0; // mL/min + quint32 duration = 0; // minutes + quint32 heparinDispensingRate = 0; // mL/hr + quint32 heparinBolusVolume = 0; // mL + quint32 heparinStopTime = 0; // min + quint32 salineBolus = 0; // mL + quint32 acidConcentrate = 0; // + quint32 bicarbonateConcentrate = 0; // + quint32 dialyzerType = 0; // + quint32 dialysateTemp = 0; // Celsius + qint32 arterialPressureLimitLow = 0; // mmHg + qint32 arterialPressureLimitHigh = 0; // mmHg + qint32 venousPressureLimitLow = 0; // mmHg + qint32 venousPressureLimitHigh = 0; // mmHg + quint32 bloodPressureMeasureInterval = 0; // minutes + quint32 rinsebackFlowRate = 0; // mL/min + }; + + Data data; + + QString toString(); + TreatmentParameters::Data fromVariantList(const QVariantList &list); +private: + QString stringPrefix = "Treatment Parameters"; +}; +} + +typedef Model::TreatmentParameters::Data TreatmentData; +#endif // MTREATMENTPARAMETERS_H Index: sources/model/MTreatmentParametersResp.cpp =================================================================== diff -u --- sources/model/MTreatmentParametersResp.cpp (revision 0) +++ sources/model/MTreatmentParametersResp.cpp (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -0,0 +1,148 @@ +#include "MTreatmentParametersResp.h" +using namespace Model; + +TreatmentParametersResp::TreatmentParametersResp() {} + +/** + * @brief TreatmentParametersResp::toVariantList + * Converts the response data to a QVariantList + * @param list (&QVariantlist) - the list to write the data to + */ +void TreatmentParametersResp::toVariantList(QVariantList &list) const +{ + list += _data.requestValid.value; + list += _data.bloodFlowRate.value; + list += _data.dialysateFlowRate.value; + list += _data.duration.value; + list += _data.heparinDispensingRate.value; + list += _data.heparinBolusVolume.value; + list += _data.heparinStopTime.value; + list += _data.salineBolus.value; + list += _data.acidConcentrate.value; + list += _data.bicarbonateConcentrate.value; + list += _data.dialyzerType.value; + list += _data.dialysateTemp.value; + list += _data.arterialPressureLimitLow.value; + list += _data.arterialPressureLimitHigh.value; + list += _data.venousPressureLimitLow.value; + list += _data.venousPressureLimitHigh.value; + list += _data.bloodPressureMeasureInterval.value; + list += _data.rinsebackFlowRate.value; + +} + +TreatmentParametersRespData TreatmentParametersResp::fromVariantList(const QVariantList &list) +{ + Data data; + if (list.length() != 18) + { + qDebug() << "Invalid QVariant List in " << __FUNCTION__; + return data; + } + data.requestValid = list[0].toUInt(); + data.bloodFlowRate = list[1].toUInt(); + data.dialysateFlowRate = list[2].toUInt(); + data.duration = list[3].toUInt(); + data.heparinDispensingRate = list[4].toUInt(); + data.heparinBolusVolume = list[5].toUInt(); + data.heparinStopTime = list[6].toUInt(); + data.salineBolus = list[7].toUInt(); + data.acidConcentrate = list[8].toUInt(); + data.bicarbonateConcentrate = list[9].toUInt(); + data.dialyzerType = list[10].toUInt(); + data.dialysateTemp = list[11].toUInt(); + data.arterialPressureLimitLow = list[12].toUInt(); + data.arterialPressureLimitHigh = list[13].toUInt(); + data.venousPressureLimitLow = list[14].toUInt(); + data.venousPressureLimitHigh = list[15].toUInt(); + data.bloodPressureMeasureInterval = list[16].toUInt(); + data.rinsebackFlowRate = list[17].toUInt(); + return data; +} + +bool TreatmentParametersResp::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.requestValid )) + if (GetValue(vByteArray, index, _data.bloodFlowRate )) + if (GetValue(vByteArray, index, _data.dialysateFlowRate )) + if (GetValue(vByteArray, index, _data.duration )) + if (GetValue(vByteArray, index, _data.heparinDispensingRate )) + if (GetValue(vByteArray, index, _data.heparinBolusVolume )) + if (GetValue(vByteArray, index, _data.heparinStopTime )) + if (GetValue(vByteArray, index, _data.salineBolus )) + if (GetValue(vByteArray, index, _data.acidConcentrate )) + if (GetValue(vByteArray, index, _data.bicarbonateConcentrate )) + if (GetValue(vByteArray, index, _data.dialyzerType )) + if (GetValue(vByteArray, index, _data.dialysateTemp )) + if (GetValue(vByteArray, index, _data.arterialPressureLimitLow )) + if (GetValue(vByteArray, index, _data.arterialPressureLimitHigh )) + if (GetValue(vByteArray, index, _data.venousPressureLimitLow )) + if (GetValue(vByteArray, index, _data.venousPressureLimitHigh )) + if (GetValue(vByteArray, index, _data.bloodPressureMeasureInterval )) + if (GetValue(vByteArray, index, _data.rinsebackFlowRate )) + 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; } +} + +QString TreatmentParametersResp::toString() const { + return QString(stringPrefix + "(%0, %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16, %17)") + .arg(_data.requestValid.value) + .arg(_data.bloodFlowRate.value) + .arg(_data.dialysateFlowRate.value) + .arg(_data.duration.value) + .arg(_data.heparinDispensingRate.value) + .arg(_data.heparinBolusVolume.value) + .arg(_data.heparinStopTime.value) + .arg(_data.salineBolus.value) + .arg(_data.acidConcentrate.value) + .arg(_data.bicarbonateConcentrate.value) + .arg(_data.dialyzerType.value) + .arg(_data.dialysateTemp.value) + .arg(_data.arterialPressureLimitLow.value) + .arg(_data.arterialPressureLimitHigh.value) + .arg(_data.venousPressureLimitLow.value) + .arg(_data.venousPressureLimitHigh.value) + .arg(_data.bloodPressureMeasureInterval.value) + .arg(_data.rinsebackFlowRate.value); +} + +TreatmentParametersRespData TreatmentParametersResp::data() const { + Data data; + data.requestValid = _data.requestValid.value; + data.bloodFlowRate = _data.bloodFlowRate.value; + data.dialysateFlowRate = _data.dialysateFlowRate.value; + data.duration = _data.duration.value; + data.heparinDispensingRate = _data.heparinDispensingRate.value; + data.heparinBolusVolume = _data.heparinBolusVolume.value; + data.heparinStopTime = _data.heparinStopTime.value; + data.salineBolus = _data.salineBolus.value; + data.acidConcentrate = _data.acidConcentrate.value; + data.bicarbonateConcentrate = _data.bicarbonateConcentrate.value; + data.dialyzerType = _data.dialyzerType.value; + data.dialysateTemp = _data.dialysateTemp.value; + data.arterialPressureLimitLow = _data.arterialPressureLimitLow.value; + data.arterialPressureLimitHigh = _data.arterialPressureLimitHigh.value; + data.venousPressureLimitLow = _data.venousPressureLimitLow.value; + data.venousPressureLimitHigh = _data.venousPressureLimitHigh.value; + data.bloodPressureMeasureInterval = _data.bloodPressureMeasureInterval.value; + data.rinsebackFlowRate = _data.rinsebackFlowRate.value; + return data; +} + Index: sources/model/MTreatmentParametersResp.h =================================================================== diff -u --- sources/model/MTreatmentParametersResp.h (revision 0) +++ sources/model/MTreatmentParametersResp.h (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -0,0 +1,79 @@ +#ifndef MTREATMENTPARAMETERSRESP_H +#define MTREATMENTPARAMETERSRESP_H + +// Qt + +// Project +#include "types.h" + + +class tst_models; + +namespace Model { +class TreatmentParametersResp +{ + friend class::tst_models; +public: + TreatmentParametersResp(); + + struct Data { + quint32 requestValid = 0; + quint32 bloodFlowRate = 0; + quint32 dialysateFlowRate = 0; + quint32 duration = 0; + quint32 heparinDispensingRate = 0; + quint32 heparinBolusVolume = 0; + quint32 heparinStopTime = 0; + quint32 salineBolus = 0; + quint32 acidConcentrate = 0; + quint32 bicarbonateConcentrate = 0; + quint32 dialyzerType = 0; + quint32 dialysateTemp = 0; + quint32 arterialPressureLimitLow = 0; + quint32 arterialPressureLimitHigh = 0; + quint32 venousPressureLimitLow = 0; + quint32 venousPressureLimitHigh = 0; + quint32 bloodPressureMeasureInterval = 0; + quint32 rinsebackFlowRate = 0; + }; + + Data fromVariantList(const QVariantList &list); + void toVariantList(QVariantList &list) const; + bool fromByteArray(const QByteArray &vByteArray, int *vIndex = nullptr); + QString toString() const; + Data data() const; + +protected: + struct _Data { + + Types::U32 requestValid ; + Types::U32 bloodFlowRate ; + Types::U32 dialysateFlowRate ; + Types::U32 duration ; + Types::U32 heparinDispensingRate ; + Types::U32 heparinBolusVolume ; + Types::U32 heparinStopTime ; + Types::U32 salineBolus ; + Types::U32 acidConcentrate ; + Types::U32 bicarbonateConcentrate ; + Types::U32 dialyzerType ; + Types::U32 dialysateTemp ; + Types::U32 arterialPressureLimitLow ; + Types::U32 arterialPressureLimitHigh ; + Types::U32 venousPressureLimitLow ; + Types::U32 venousPressureLimitHigh ; + Types::U32 bloodPressureMeasureInterval ; + Types::U32 rinsebackFlowRate ; + + } _data; + + +private: + QString stringPrefix = "Treatment Parameters Response"; + +}; + +} + +typedef Model::TreatmentParametersResp::Data TreatmentParametersRespData; +#endif // MTREATMENTPARAMETERSRESP_H Fisheye: Tag ecb2c280db303fbf2321b484572c092ae2c55cce refers to a dead (removed) revision in file `sources/model/mtreatmentparameters.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ecb2c280db303fbf2321b484572c092ae2c55cce refers to a dead (removed) revision in file `sources/model/mtreatmentparameters.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ecb2c280db303fbf2321b484572c092ae2c55cce refers to a dead (removed) revision in file `sources/model/mtreatmentparametersresp.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ecb2c280db303fbf2321b484572c092ae2c55cce refers to a dead (removed) revision in file `sources/model/mtreatmentparametersresp.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/VCreateTreatment.h =================================================================== diff -u -r1cedf9bd892c07399551d7d46048bb5079d784ae -recb2c280db303fbf2321b484572c092ae2c55cce --- sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision 1cedf9bd892c07399551d7d46048bb5079d784ae) +++ sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -10,8 +10,8 @@ #include // Project -#include "mtreatmentparameters.h" -#include "mtreatmentparametersresp.h" +#include "MTreatmentParameters.h" +#include "MTreatmentParametersResp.h" #include "guicontroller.h" #include "storageglobals.h" #include "filesaver.h" Index: unittests/tst_models.cpp =================================================================== diff -u -rcfb9dbd1fb0a0370d7b4394b2f8e48b350282aef -recb2c280db303fbf2321b484572c092ae2c55cce --- unittests/tst_models.cpp (.../tst_models.cpp) (revision cfb9dbd1fb0a0370d7b4394b2f8e48b350282aef) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -49,8 +49,8 @@ #include "MAlarmTriggered.h" #include "MAlarmCleared.h" -#include "mtreatmentparameters.h" -#include "mtreatmentparametersresp.h" +#include "MTreatmentParameters.h" +#include "MTreatmentParametersResp.h" // #define CONSOLEOUT Index: unittests/tst_views.cpp =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -recb2c280db303fbf2321b484572c092ae2c55cce --- unittests/tst_views.cpp (.../tst_views.cpp) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision ecb2c280db303fbf2321b484572c092ae2c55cce) @@ -20,7 +20,7 @@ // Project #include "vtreatmentadjustmentresponsebase.h" #include "vtreatmentadjustmentultrafiltrationstate.h" -#include "mtreatmentparameters.h" +#include "MTreatmentParameters.h" #include "filehandler.h" tst_views::tst_views(QObject *parent) : QObject(parent) { }