Index: denali.pro =================================================================== diff -u -r84c5373209a1a488c00917995f5553d442d159a4 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- denali.pro (.../denali.pro) (revision 84c5373209a1a488c00917995f5553d442d159a4) +++ denali.pro (.../denali.pro) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -52,6 +52,9 @@ common/MsgDefs.h \ \ # Main sources/main.h \ + sources/model/MTreatmentParameters.h \ + sources/model/MTreatmentParametersResp.h \ + sources/storage/filesaver.h \ sources/model/MDGDebugText.h \ sources/model/MHDDebugText.h \ sources/storage/DriveWatcher.h \ @@ -109,6 +112,7 @@ sources/gui/GuiView.h \ sources/gui/GuiController.h \ \ # ---------- Views ---------- + sources/view/VCreateTreatment.h \ sources/view/VEventSpy.h \ sources/view/VView.h \ sources/view/VPowerOff.h \ @@ -158,6 +162,8 @@ \ # common \ # Main main.cpp \ + sources/model/MTreatmentParameters.cpp \ + sources/model/MTreatmentParametersResp.cpp \ sources/Threads.cpp \ sources/MainTimer.cpp \ sources/ApplicationPost.cpp \ @@ -213,6 +219,7 @@ \ # ---------- Views ---------- sources/view/VEventSpy.cpp \ sources/view/VPowerOff.cpp \ + sources/view/VCreateTreatment.cpp \ \ # ---------- Views - Alarm sources/view/hd/alarm/VAlarmStatus.cpp \ \ # ---------- Views - HD - Adjustment - In-Treatment @@ -248,14 +255,13 @@ sources/storage/FileHandler.cpp \ sources/storage/Logger.cpp \ sources/storage/DriveWatcher.cpp \ + sources/storage/filesaver.cpp \ \ # Utility sources/utility/crc.cpp \ sources/utility/format.cpp \ sources/utility/types.cpp -# sources/configuration/display.cpp \ -# sources/configuration/sound.cpp \ -# sources/storage/settings.cpp \ + RESOURCES += \ denali.qrc Index: sources/ApplicationController.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -24,6 +24,9 @@ #include "FileHandler.h" #include "GuiController.h" + +using namespace Storage; + /*! * \brief ApplicationController::ApplicationController * \details Constructor Index: sources/ApplicationController.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/ApplicationController.h (.../ApplicationController.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/ApplicationController.h (.../ApplicationController.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -75,6 +75,8 @@ void createFakeSequencedLongMessage (QVariantList &vData, const int vFakeDataLen); void createFakeSeqAtBeginLongMessage(QVariantList &vData, const int vFakeDataLen); + void saveNewTreatment(QJsonObject obj); + private slots: // Should be private for thread safety and is connected internally. void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void onActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -96,6 +96,10 @@ {Gui::GuiActionType::ID_AdjustUltrafiltrationEditReq , 1 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp , 8 * 4 }, // 8 parameters each 4bytes + // --- + {Gui::GuiActionType::ID_CreateTreatmentReq , 17 * 4 }, // 17 parameters, each 4 bytes + {Gui::GuiActionType::ID_CreateTreatmentRsp , 18 * 4 }, // 18 parameters, each 4 bytes + // ---- {Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmReq , 2 * 4 }, // 2 parameters each 4bytes {Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp , 5 * 4 }, Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -23,6 +23,7 @@ #include "format.h" using namespace Can; +using namespace Model; #define DEBUG_RECEIVE_SIGNAL(vID, vMODEL) //qDebug() << vID << vMODEL; @@ -253,11 +254,19 @@ LOG_EVENT(AlarmSilenceRequestData::toString(vData)); break; - default: + case Gui::GuiActionType::ID_CreateTreatmentReq: { + if ( ! length ) { logInvalidLength(vActionId); return false; } + vPayload = Format::fromVariant(vData); + MAdjustTreatmentParametersRequest params; + params.fromVariantList(vData); + LOG_EVENT(params.toString()); + } break; + + default: { QString mActionIdHexString = Format::toHexString(vActionId); LOG_DEBUG(mSenderID + tr("Unknown transmit Message with ID '%1'").arg(mActionIdHexString)); ok = false; - break; + } break; } return ok; @@ -350,7 +359,9 @@ case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = adjustUltrafiltrationEdit (vMessage, vData); break; // TODO : implement notify<>() case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); break; // TODO : implement notify<>() - // unhandled messages: these will only be logged as received message + case Gui::GuiActionType::ID_CreateTreatmentRsp : ok = createTreatmentRespData (vMessage, vData); break; + // unhandles messages: these will only be logged as received message + // there has nothing been defined for these messages. default : printUnhandled (vMessage ); break; } @@ -585,3 +596,26 @@ return ok; } + +/*! + * \brief MessageInterpreter::createTreatmentRespData + * Checks the validity of the create treatment response data. + * \param vMessage - The message + * \param vData - the output data + * \return true if ok, false otherwise + */ +bool MessageInterpreter::createTreatmentRespData(const Message &vMessage, QVariantList &vData) { + bool ok = false; + if ( ! isType (vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; + if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; + + Model::MTreatmentParametersResponse mData; + ok = mData.fromByteArray(vMessage.data); + LOG_DATUM(mData.toString()); + + mData.toVariantList(vData); + emit didActionReceive(mData.data()); + + return ok; + +} Index: sources/canbus/MessageInterpreter.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -79,6 +79,10 @@ template bool notify (const Message &vMessage, QVariantList &vData, Gui::GuiActionType vIdCheck) __attribute_warn_unused_result__; + + // ---- Create Treatment Response Data + bool createTreatmentRespData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + public: explicit MessageInterpreter(QObject *parent = nullptr); Index: sources/gui/GuiController.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/gui/GuiController.cpp (.../GuiController.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -320,4 +320,3 @@ data.mFlags = QBitArray(16, false); // 16 QBitArray of flags, if needed emit didActionReceive(data); } - Index: sources/gui/GuiController.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/GuiController.h (.../GuiController.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/gui/GuiController.h (.../GuiController.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -27,7 +27,6 @@ #define _GuiController GuiController::I() using namespace Can; - // namespace namespace Gui { Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -50,6 +50,7 @@ #include "VDGTemperaturesData.h" #include "VDGValvesStatesData.h" +#include "VCreateTreatment.h" #include "VTreatmentAdjustmentDuration.h" #include "VTreatmentAdjustmentFlows.h" #include "VTreatmentAdjustmentUltrafiltrationEdit.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -59,9 +59,9 @@ * *** Exactly as it is going to be shown/used in Denali Messages ***\n * *** then it can be compared exactly the way it is with no conversion.***\n */ + enum GuiActionsType_Enum /* : quint16 QML doesn't support enum types */ { ID_Unknown = 0x0000, - ID_CANBusFaultCount = 0x9909, ID_RawData = 0xFFFE, @@ -89,6 +89,9 @@ ID_AlarmStatus = 0x0200, ID_AlarmTriggered = 0x0300, ID_AlarmCleared = 0x0400, + ID_CreateTreatmentReq = 0x3500, // 53 - Not implemented yet on FW side + ID_CreateTreatmentRsp = 0x3600, // 54 - Not implemented yet on FW side + ID_AlarmSilenceReq = 0x3200, // 50 - Not implemented yet on FW side ID_AlarmSilenceRsp = 0x0000, // Needs to be removed. Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -36,7 +36,37 @@ property alias handler : _handler + property alias diameter : _handler.diameter + property alias knobColor : _handler.color + property bool isActive : false; + signal progressRectClicked() + signal progressRectDragged() + signal activeChanged() + + function setActive(active) { + if (active) { + color = Colors.createTreatmentActive + knobColor = Colors.createTreatmentActive + } else { + color = Colors.createTreatmentInactive + knobColor = Colors.createTreatmentInactive + } + + if (active !== isActive) { + isActive = active; + activeChanged() + } + } + + onIsActiveChanged: { + setActive(isActive) + if (!isActive) { + value = minimum + } + activeChanged() + } + height : Variables.progressbarHeight touchMargin : 25 @@ -76,7 +106,7 @@ value = getValueOfX(x) - if ( step === 1 ) { /* keep the value and return */ return; } + if ( step === 1 ) { value = parseInt(value); return; } var start = 0 if ( ! stepSnap ) start = minimum @@ -97,10 +127,15 @@ // propagation is not working on drag ! onDragged: { setValue(vMouseEvent.x) + progressRectDragged() } onClicked: { setValue(vMouseEvent.x) + progressRectClicked() } + onPressChanged: { + _root.pressChanged() + } } // used loader for performance since it may not always be required. Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r9f63306043e9a184ce3e71c573ef0a15d8644f95 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 9f63306043e9a184ce3e71c573ef0a15d8644f95) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file Colors.qml - * \author (last) Peter Lucia - * \date (last) 01-Jul-2020 + * \author (last) Behrouz NematiPour + * \date (last) 05-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 17-Oct-2019 * @@ -54,7 +54,7 @@ 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 borderDialog : "transparent" // different colors for different displays // "#D01A344D" // "#D00F0F0F" //"#F51A344D" readonly property color touchTextAreaTitle : "#a0b6d0" Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file Fonts.qml - * \author (last) Peter Lucia - * \date (last) 06-Jul-2020 + * \author (last) Behrouz NematiPour + * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 17-Oct-2019 * @@ -56,15 +56,11 @@ readonly property int fontPixelDurationCurTime : 89 readonly property int fontPixelDurationAdjTime : 28 - - readonly property int fontPixelUltrafiltrationAdjustmentPauseButton : 26 readonly property int fontPixelUltrafiltrationAdjustmentResumeButton : 30 readonly property int fontPixelUltrafiltrationAdjustmentEditButton : 30 readonly property int fontPixelUltrafiltrationAdjustmentNextButton : 26 readonly property int fontPixelUltrafiltrationAdjustmentConfirmButton : 26 readonly property int fontPixelUltrafiltrationAdjustmentConfirmTitle : 40 readonly property int fontPixelUltrafiltrationAdjustmentEditValue : 46 - - } Index: sources/gui/qml/main.qml =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/gui/qml/main.qml (.../main.qml) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/gui/qml/main.qml (.../main.qml) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -7,7 +7,7 @@ * * \file main.qml * \author (last) Behrouz NematiPour - * \date (last) 25-Aug-2020 + * \date (last) 12-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 * @@ -216,7 +216,7 @@ color: Colors.textMain anchors { right: parent.right - margins: 10 + margins: 5 bottom: parent.bottom } horizontalAlignment: Text.AlignRight Index: sources/main.h =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/main.h (.../main.h) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ sources/main.h (.../main.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -7,7 +7,7 @@ * * \file main.h * \author (last) Behrouz NematiPour - * \date (last) 30-Jul-2020 + * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 28-Oct-2019 * @@ -33,6 +33,10 @@ vCLASS(vCLASS const &) = delete; \ vCLASS & operator = (vCLASS const &) = delete; \ public: \ + /*! \brief instance accessor + \details A singleton class single instance creator/accessor + \return reference to the class static instance + */\ static vCLASS &I() { \ static vCLASS _instance; \ return _instance; \ @@ -50,46 +54,77 @@ //--------------------------------------------------------------------------------// #define DEBUG_PROPERTY_CHANGED(vVARIABLE, PREFIX) // qDebug() << "#" << #vVARIABLE << PREFIX##vVARIABLE; //--------------------------------------------------------------------------------// -#define PROPERTY_SLOT( vTYPE , vVARIABLE ) \ - protected : \ - void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ - static bool init = false; \ - if ( !init || _##vVARIABLE != v##vVARIABLE ) { \ - DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ - init = true; \ - _##vVARIABLE = v##vVARIABLE; \ - emit vVARIABLE##Changed( _##vVARIABLE ); \ - } \ +#define PROPERTY_SLOT( vTYPE , vVARIABLE ) \ + protected : \ + /*! \brief Property setter + \details The property setter which update the private variable \n + - if only the value has been changed \n + - or it's the first time property is set. \n + emits the Property notify (...Changed) signal on update. \n + the notify signal (...Changed) passes the new value as its parameter. \n + \param new value + */\ + void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ + static bool init = false; \ + if ( !init || _##vVARIABLE != v##vVARIABLE ) { \ + DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ + init = true; \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Changed( _##vVARIABLE ); \ + } \ } //--------------------------------------------------------------------------------// -#define TRIGGER_SLOT( vTYPE , vVARIABLE ) \ - protected: \ - void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ - DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ - _##vVARIABLE = v##vVARIABLE; \ - emit vVARIABLE##Triggered( _##vVARIABLE ); \ +#define TRIGGER_SLOT( vTYPE , vVARIABLE ) \ + protected: \ + /*! \brief Trigger setter + \details The Trigger setter which update the private variable \n + with no condition each time the value the passed. \n + emits the Trigger notify (...Triggered) signal after update. \n + the notify signal (...Triggered) passes the new value as its parameter.\n + \param new value + */\ + void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ + DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Triggered( _##vVARIABLE ); \ } //--------------------------------------------------------------------------------// -#define PROPERTY_BASE(vTYPE , vVARIABLE , vDEFVALUE, vSIGNAL) \ - Q_PROPERTY( vTYPE vVARIABLE \ - READ vVARIABLE \ - WRITE vVARIABLE \ - NOTIFY vVARIABLE##vSIGNAL) \ - Q_SIGNALS: \ - void vVARIABLE##vSIGNAL( const vTYPE & v##vVARIABLE ); \ - private: \ - vTYPE _##vVARIABLE = vDEFVALUE; \ - protected: \ - vTYPE vVARIABLE () const { \ - return _##vVARIABLE ; \ - } +#define PROPERTY_BASE(vTYPE , vVARIABLE , vDEFVALUE, vSIGNAL) \ + /*! \brief Qt Property declaration + \details The Qt Property definition by Q_PROPERTY documentation. + */\ + Q_PROPERTY( vTYPE vVARIABLE \ + READ vVARIABLE \ + WRITE vVARIABLE \ + NOTIFY vVARIABLE##vSIGNAL) \ + 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##vSIGNAL( const vTYPE & v##vVARIABLE ); \ + private: \ + vTYPE _##vVARIABLE = vDEFVALUE; \ + protected: \ + /*! \brief Property getter + \details The property getter which reads the private variable + \return current value + */\ + vTYPE vVARIABLE () const { \ + return _##vVARIABLE ; \ + } //--------------------------------------------------------------------------------// -#define PROPERTY( vTYPE , vVARIABLE , vDEFVALUE ) \ - PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ +#define PROPERTY( vTYPE , vVARIABLE , vDEFVALUE ) \ + \ + PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ PROPERTY_SLOT( vTYPE , vVARIABLE) //--------------------------------------------------------------------------------// -#define TRIGGER( vTYPE , vVARIABLE , vDEFVALUE ) \ - PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Triggered) \ +#define TRIGGER( vTYPE , vVARIABLE , vDEFVALUE ) \ + \ + PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Triggered) \ TRIGGER_SLOT( vTYPE , vVARIABLE) //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// @@ -114,53 +149,91 @@ //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_PRIVATE_SLOT(vTYPE) \ private Q_SLOTS: \ + /*! \brief Bridge slot + \details The bridge slot is for thread safety between classes for received message + and is used to emit its signal to pass the model data to next observer. + \param vData - The model data which has been received. + \note This method is private and the interface is signals only. (starts with 'on') + */\ void onActionReceive (const vTYPE &vData) { \ emit didActionReceive(vData); \ } //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_PRIVATE_SLOT_DEFINITION(vTYPE) \ private Q_SLOTS: \ + /*! \brief Adjustment slot + \details The bridge slot is for thread safety between classes for adjustment messages + and is used to emit its signal to pass the model data to next observer. + \param vData - The model data to be used for adjustment + \note This method is private and the interface is signals only. (starts with 'on') + This slot has to have its specific implementation and is not a bridge (not a signal emitter). + */\ void onAdjustment (const vTYPE &vData); //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_PRIVATE_SLOT(vTYPE) \ private Q_SLOTS: \ + /*! \brief Adjustment bridge slot + \details The bridge slot is for thread safety between classes for adjustment messages + and is used to emit its signal to pass the model data to next observer. + \param vData - The model data to be used for adjustment + \note This method is private and the interface is signals only. (starts with 'on') + */\ void onAdjustment (const vTYPE &vData) { \ emit didAdjustment( vData); \ } //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_PUBLIC_SLOT(vTYPE) \ public Q_SLOTS: \ + /*! \brief Adjustment invocable/exposed slot + \details This slot is able to be called within QML context + when an object of the class is instantiated in QML. + For thread safety it's calling its designated signal to notify observers. + \note This method is public and is the interface. (starts with 'do') + */\ void doAdjustment (const vTYPE &vData) { \ emit didAdjustment( vData); \ } //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_SIGNAL(vTYPE) \ Q_SIGNALS: \ + /*! \brief Receive bridge signal + \details The bridge signal is for thread safety between classes for received message + and is used to be emitted in its slot to pass the model data to next observer. + \param vData - The model data which has been received. + \note This method is public to be exposed to the observers to be able to connect to it as the interface. (starts with 'did') + */\ void didActionReceive (const vTYPE &vData); //--------------------------------------------------------------------------------// -#define ACTION_TRANSMT_SIGNAL(vTYPE) \ -Q_SIGNALS: \ - void didActionTransmit(const vTYPE &vData); -//--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_SIGNAL(vTYPE) \ Q_SIGNALS: \ + /*! \brief Adjustment bridge signal + \details The bridge signal is for thread safety between classes for received message + and is used to be emitted in its slot to pass the model data to next observer. + \param vData - The model data which has been received. + \note This method is public to be exposed to the observers to be able to connect to it as the interface. (starts with 'did') + */\ void didAdjustment (const vTYPE &vData); //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_BRIDGE_DEFINITION(vTYPE) \ + \ ACTION_RECEIVE_PRIVATE_SLOT (vTYPE) \ - ACTION_RECEIVE_SIGNAL (vTYPE) + ACTION_RECEIVE_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT(vTYPE) \ + \ ADJUST_TRANSMT_PRIVATE_SLOT_DEFINITION (vTYPE) \ - ADJUST_TRANSMT_SIGNAL (vTYPE) + ADJUST_TRANSMT_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_BRIDGE_DEFINITION(vTYPE) \ + \ ADJUST_TRANSMT_PRIVATE_SLOT (vTYPE) \ - ADJUST_TRANSMT_SIGNAL (vTYPE) + ADJUST_TRANSMT_SIGNAL (vTYPE) \ //--------------------------------------------------------------------------------// #define ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC(vTYPE) \ + \ ADJUST_TRANSMT_PUBLIC_SLOT (vTYPE) \ - ADJUST_TRANSMT_SIGNAL (vTYPE) + ADJUST_TRANSMT_SIGNAL (vTYPE) \ + //--------------------------------------------------------------------------------// #define REGISTER_METATYPE(vTYPE) \ qRegisterMetaType < vTYPE > (#vTYPE); Index: sources/model/MModel.h =================================================================== diff -u -r5387db3e9735f3bbf768906858dbcd725cf23528 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/model/MModel.h (.../MModel.h) (revision 5387db3e9735f3bbf768906858dbcd725cf23528) +++ sources/model/MModel.h (.../MModel.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -7,7 +7,7 @@ * * \file MModel.h * \author (last) Behrouz NematiPour - * \date (last) 20-Aug-2020 + * \date (last) 12-Sep-2020 * \author (original) Behrouz NemaiPour * \date (original) 02-Jul-2020 * @@ -56,71 +56,126 @@ #include "MTreatmentAdjustSalineResponse.h" /*! - * \brief Message interpretation instruction - * \details This comment explains how to add a Denali Message in Denali UI Application + * \page MessageFlow Message interpretation Flow + * \dot + * digraph callgraph { + * node [shape=ellipse, fontname=Arial, fontsize=11]; + * user [shape=box ]; + * QML [URL="\ref application/sources/gui" ]; + * GuiView [URL="\ref Gui::GuiView" ]; + * View [URL="\ref application/sources/view" ]; + * GuiController [URL="\ref Gui::GuiController" ]; + * ApplicationController [URL="\ref ApplicationController" ]; + * FrameInterface [URL="\ref Can::FrameInterface" ]; + * CanInterface [URL="\ref Can::CanInterface" ]; + * CANBus [shape=box ]; + * subgraph MessageDispatcher { + * node [shape=ellipse, fontname=Arial, fontsize=11, URL="\ref Can::MessageDispatcher"]; + * label = "Message_Dispatcher"; + * MessageAcknow [URL="\ref Can::MessageAcknowModel" ]; + * MessageInterpreter [URL="\ref Can::MessageInterpreter" ]; + * MessageBuilder [URL="\ref Can::MessageBuilder" ]; + * MessageDispatcher -> MessageInterpreter [dir="both" ]; + * MessageDispatcher -> MessageAcknow [dir="both" ]; + * MessageInterpreter -> MessageBuilder [dir="both" ]; + * } + * user -> QML [dir="both" ]; + * QML -> { GuiView } [dir="both" ]; + * { GuiView, } -> GuiController [dir="both" ]; + * GuiController -> ApplicationController [dir="both" ]; + * ApplicationController -> MessageDispatcher [dir="both" ]; + * MessageDispatcher -> FrameInterface [dir="both" ]; + * FrameInterface -> CanInterface [dir="both" ]; + * CanInterface -> CANBus [dir="both" ]; + * } + * \enddot * - * 1 - Look at the message structure in the "message list.xlsx" + * \note + * 00 - sort .pro file after all new files added. * - * 2 - MSG ID : - * Add an enum for the message in the guiglobals.h : GuiActionsType_Enum - * and assign a correct message value to it. - * example : MSG ID = 9 => - * \code{.cpp} - * PressureOcclusion = 0x0900, //(little endian) - * \endcode + * \details + * This comment explains how to add a Denali Message in Denali UI Application * - * 3 - MSG Payload Len : - * Add a line in the "messageglobals.h" in payloadLen hash table - * to define the required payload length of the message + * Model : * - * 4 - Model Implementation : - * Implement a model like MPressureOcclusion by copy/paste the closest model .h/.cpp file - * and adding it to project and modify to fit the new model. + * 01 - Look at the message structure in the "message list.xlsx" and in GuiGlobals.h define enum ID_ + * Add an enum for the message in the guiglobals.h : GuiActionsType_Enum + * and assign a correct message value to it. + * Note that it needs to be in little endian so if you have a message Id of 37 your enum should have a value of 0x2500 in hex. + * \code{.cpp} + * ID_HDOperationModeData = 0x2500, // 37 // little endian + * \endcode * - * 5 - Register Model : - * Add the required lines like the other models in the mmodel.h file. + * 02 - MessageGlobals.h : add len + * \code{.cpp} + * {Gui::GuiActionType::ID_HDOperationModeData , 1 * 4 }, // 1 parameter each 4bytes + * \endcode * - * 6 - Populate/Interpret Model Data : - * Copy/Paste one of the other implementations of the Messages setter/getter. - * example : be careful about the type. - * in the header should be like: - * \code{.cpp} - * bool pressureOcclusionData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - * \endcode - * in the implementation should be like: - * \code{.cpp} - * bool MessageInterpreter::pressureOcclusionData(const Message &vMessage, QVariantList &vData) - * { - * // TODO : review other methods - * bool ok = false; - * if ( ! isType (vMessage, Gui::GuiActionType::PressureOcclusion) ) return ok; - * if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::PressureOcclusion) ) return ok; + * 03 - Implement the model by copy/paste of the closest model, fit to your need. + * \sa MHDOperationMode + * \sa MHDOperationModeData.h + * \sa MHDOperationModeData.cpp * - * Model::MPressureOcclusion mData; - * ok = mData.fromByteArray(vMessage.data); - * LOG_DATUM("HD," + mData.toString()); + * 04 - Added #include in MModel.h for the implemented model + * \code{.cpp} + * #include "MHDOperationModeData.h" + * \endcode * - * mData.toVariantList(vData); - * emit didActionReceive(mData.data()); + * 05 - Register the model in MModel.h by adding it to the macro lists : + * - \ref REGISTER_MODEL_METATYPES + * - \ref ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS + * - \ref ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + * - \ref ACTION_RECEIVE_SIGNALS * - * return ok; - * } - * \endcode + * 06 - In the MessageInterpreter add a line of handler in interpretMessage_ method + * and put the enum and model. + * \sa MessageInterpreter::interpretMessage_HD + * \sa MessageInterpreter::interpretMessage_DG + * \sa MessageInterpreter.cpp * - * Add a case in MessageInterpreter::interpretMessage_HD for that message id Enum - * with lines like : - * \code{.cpp} - * case Gui::GuiActionType::PressureOcclusion: - * ok = pressureOcclusionData (vMessage, vData); - * break; - * \endcode + * View : + * 07 - Implement the view by copy/paste of the closest view, fit to your need. + * \sa VHDOperationMode + * \sa VHDOperationModeData.h + * \sa VHDOperationModeData.cpp * + * 08 - Register the view in VView.h in macro list + * \sa REGISTER_VIEW_TYPES + * \sa VView.h + * + * 09 - Include the view header in the GuiGlobals.cpp + * \code{.cpp} + * #include "VHDOperationModeData.h" + * \endcode + * \sa GuiGlobals.cpp + * + * QML : + * 10 - Import the registered view + * \code{.js} + * import VHDOperationMode 0.1; + * \endcode + * \sa main.qml + * + * 11 - Create an object + * \code{.js} + * VHDOperationMode { id: vHDOperationMode } + * \endcode + * \sa main.qml + * + * 12 - Use it. */ + //--------------------------------------------------------------------------------// //-------- Please add the model type to the lists below to register them ---------// //--------------------------------------------------------------------------------// + +/*! + \def REGISTER_MODEL_METATYPES + \details Registers the models in the Qt MetaType so it can be used in signal/slots between threads. + */ #define REGISTER_MODEL_METATYPES \ + \ REGISTER_METATYPE( BloodFlowData ) \ REGISTER_METATYPE( DialysateFlowData ) \ REGISTER_METATYPE( OutletFlowData ) \ @@ -162,10 +217,24 @@ REGISTER_METATYPE( AdjustUltrafiltrationStateResponseData ) \ REGISTER_METATYPE( AdjustUltrafiltrationEditResponseData ) \ REGISTER_METATYPE( AdjustUltrafiltrationConfirmResponseData ) \ - REGISTER_METATYPE( AdjustSalineResponseData ) + REGISTER_METATYPE( AdjustSalineResponseData ) \ //===============================================================================// +/*! + \def ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS + \details This macro connects the source object vSource to the models defined in the list for received messages. + It connects source didActionReceive() signal to the this pointer of the class object + onActionReceive(). + The code below is implemented for each model : + \code {.cpp} + connect(&vSOURCE, SIGNAL(didActionReceive(const vTYPE &)), + this , SLOT( onActionReceive(const vTYPE &))); + \endcode + This macro should be used in the cpp file of the class. + This macro should be used with its counterpart macro \ref ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + */ #define ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ + \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, BloodFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DialysateFlowData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, OutletFlowData ) \ @@ -198,17 +267,37 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationConfirmResponseData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustSalineResponseData ) + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustSalineResponseData ) \ + // /* Request */ ---------------------------------------------------------// #define ADJUST_TRANSMT_MODEL_BRIDGE_CONNECTIONS(vSOURCE) \ + \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationConfirmRequestData ) \ - ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustSalineRequestData ) + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustSalineRequestData ) \ + //===============================================================================// +/*! + \def ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + \details This macro defines the signal/slot of the source object vSource to the models + listed in its definition for received messages. + The code below will be implemented for each model : + \code {.cpp} + private slots: + void onActionReceive (const vTYPE &vData) { + emit didActionReceive(vData); + } + signals: + void didActionReceive (const vTYPE &vData); + \endcode + This macro should be used in the header file of the class. + This macro should be used with its counterpart macro \ref ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS + */ #define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \ + \ ACTION_RECEIVE_BRIDGE_DEFINITION( BloodFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DialysateFlowData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( OutletFlowData ) \ @@ -241,25 +330,30 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationEditResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationConfirmResponseData ) \ - ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustSalineResponseData ) -// /* Request */ ---------------------------------------------------------// + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustSalineResponseData ) \ + + #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS \ + /* Request --------------------------------------------------------- */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustUltrafiltrationConfirmRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustSalineRequestData ) -// /* Request */ ----------------------- NoEmit --------------------------// + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustSalineRequestData ) \ + + #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_NOEMIT \ + /* Request ----------------------- NoEmit -------------------------- */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationStateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationEditRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustUltrafiltrationConfirmRequestData ) \ - ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustSalineRequestData ) -// /* Request */ ----------------------- public --------------------------// + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustSalineRequestData ) \ + #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_PUBLIC \ + /* Request ----------------------- public -------------------------- */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustBloodDialysateRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDurationRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustUltrafiltrationStateRequestData ) \ @@ -268,6 +362,7 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustSalineRequestData ) //===============================================================================// #define ACTION_RECEIVE_SIGNALS \ + /* Received signals */ \ ACTION_RECEIVE_SIGNAL( BloodFlowData ) \ ACTION_RECEIVE_SIGNAL( DialysateFlowData ) \ ACTION_RECEIVE_SIGNAL( OutletFlowData ) \ Index: sources/storage/FileHandler.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -85,6 +85,7 @@ return true; } + /*! * \brief FileHandler::read * \details reads file vFilename content into vContent variable. @@ -107,6 +108,29 @@ } /*! + * \brief FileHandler::readCSV + * \details reads the provided filename's JSON content into the vContent variable. + * \param vFileName - Source file name + * \param vContent - The content of the file which will be written to when done. + * \return false if file can't be read + */ +bool FileHandler::readJSON(const QString &vFileName, QJsonObject &vContent) +{ + QFile file(vFileName); + if (! file.open(QFile::Text | QFile::ReadOnly)) { + errOut(QObject::tr("Can't open file for read (%1).Possible corrupted file system").arg(vFileName)); + return false; + } + QTextStream in(&file); + QString content = in.readAll(); + + + QJsonDocument doc = QJsonDocument::fromJson(content.toUtf8()); + vContent = doc.object(); + return true; +} + +/*! * \brief FileHandler::copyFolder * \details Copies all the file and folders recursively. * \param vSource - The source folder Index: sources/storage/FileHandler.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/storage/FileHandler.h (.../FileHandler.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/storage/FileHandler.h (.../FileHandler.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -16,6 +16,8 @@ // Qt #include +#include +#include class QDate; namespace Storage { @@ -32,8 +34,9 @@ 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 removeFiles(const QStringList &vFolders, const QStringList &vNameFilter, const QDate &vDateOlderThan); Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -12,7 +12,9 @@ * \date (original) 26-Aug-2020 * */ +// Qt +// Project #include "StorageGlobals.h" /*! @@ -28,5 +30,15 @@ const char *USB_File_System = "vfat"; // Log - const char *SDCard_Base_Path_Name = "/media/sd-card/"; + const char *Log_Base_Path_Name = "/media/sd-card/"; + const char *Log_Base_Path_Name_Location = "/media/sd-card/log/"; + const char *Log_File_Name = "denali.log"; + + // Treatment + const char *Treatment_Base_Path_Name = "/media/sd-card/treatment/"; + const char *Treatment_Profiles_Dir = "/media/sd-card/treatment/profiles/"; + const char *Treatment_Parameter_Ranges_Path = "/media/sd-card/treatment/denali.conf"; + const char *Treatment_Parameter_Ranges_Path_CSV = "/media/sd-card/treatment/denali.csv"; + + const char *SDCard_Base_Path_Name = "/media/sd-card/"; } Index: sources/storage/StorageGlobals.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -24,5 +24,13 @@ extern const char *USB_File_System; // Log - extern const char *SDCard_Base_Path_Name; + extern const char *Log_Base_Path_Name ; + extern const char *Log_Base_Path_Name_Location; + extern const char *Log_File_Name ; + + // Treatment + extern const char *Treatment_Profiles_Dir ; + extern const char *Treatment_Parameter_Ranges_Path ; + extern const char *Treatment_Parameter_Ranges_Path_CSV ; + extern const char *SDCard_Base_Path_Name ; } Index: sources/storage/filesaver.cpp =================================================================== diff -u -r0622f1ec79b9a24a3f9d58cd2de329df997b37d6 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/storage/filesaver.cpp (.../filesaver.cpp) (revision 0622f1ec79b9a24a3f9d58cd2de329df997b37d6) +++ sources/storage/filesaver.cpp (.../filesaver.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -6,7 +6,7 @@ #include // Project -#include "filehandler.h" +#include "FileHandler.h" using namespace Storage; Index: sources/view/VCreateTreatment.cpp =================================================================== diff -u -r0622f1ec79b9a24a3f9d58cd2de329df997b37d6 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/view/VCreateTreatment.cpp (.../VCreateTreatment.cpp) (revision 0622f1ec79b9a24a3f9d58cd2de329df997b37d6) +++ sources/view/VCreateTreatment.cpp (.../VCreateTreatment.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -3,7 +3,7 @@ // Qt // Project -#include "filehandler.h" +#include "FileHandler.h" #include "MsgDefs.h" using namespace Gui; Index: sources/view/VCreateTreatment.h =================================================================== diff -u -r0622f1ec79b9a24a3f9d58cd2de329df997b37d6 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision 0622f1ec79b9a24a3f9d58cd2de329df997b37d6) +++ sources/view/VCreateTreatment.h (.../VCreateTreatment.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -12,8 +12,8 @@ // Project #include "MTreatmentParameters.h" #include "MTreatmentParametersResp.h" -#include "guicontroller.h" -#include "storageglobals.h" +#include "GuiController.h" +#include "StorageGlobals.h" #include "filesaver.h" // forward diclations Index: sources/view/VView.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- sources/view/VView.h (.../VView.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/VView.h (.../VView.h) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -130,7 +130,7 @@ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationEdit ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationConfirm ) \ + REGISTER_TYPE( VCreateTreatment ) \ REGISTER_TYPE( VTreatmentAdjustmentSaline ) \ //--------------------------------------------------------------------------------// - Index: unittests/tst_messaging.cpp =================================================================== diff -u -r7edcaf054062754370e0abd165f17ca9941b7d07 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- unittests/tst_messaging.cpp (.../tst_messaging.cpp) (revision 7edcaf054062754370e0abd165f17ca9941b7d07) +++ unittests/tst_messaging.cpp (.../tst_messaging.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -7,7 +7,7 @@ * * \file tst_messaging.cpp * \author (last) Behrouz NematiPour - * \date (last) 23-Aug-2020 + * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * @@ -18,10 +18,10 @@ // Project #include "main.h" -#include "messageinterpreter.h" -#include "messagebuilder.h" +#include "MessageInterpreter.h" +#include "MessageBuilder.h" #include "MPowerOff.h" -#include "messagedispatcher.h" +#include "MessageDispatcher.h" tst_messaging::tst_messaging(QObject *parent) : QObject(parent) { } Index: unittests/tst_models.cpp =================================================================== diff -u -re57b46729e975dd9981728c56f297d8ceadca50a -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- unittests/tst_models.cpp (.../tst_models.cpp) (revision e57b46729e975dd9981728c56f297d8ceadca50a) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -7,7 +7,7 @@ * * \file tst_models.cpp * \author (last) Behrouz NematiPour - * \date (last) 13-Aug-2020 + * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * @@ -79,10 +79,10 @@ QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mDialydateReate")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); } void tst_models::tst_MAdjustBloodDialysateResponse () @@ -105,7 +105,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.mBloodRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mDialydateReate; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mDialysateRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; Index: unittests/tst_views.cpp =================================================================== diff -u -r0622f1ec79b9a24a3f9d58cd2de329df997b37d6 -rb8dd541d377ad1e8d7b988ce0163d99bff53843f --- unittests/tst_views.cpp (.../tst_views.cpp) (revision 0622f1ec79b9a24a3f9d58cd2de329df997b37d6) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision b8dd541d377ad1e8d7b988ce0163d99bff53843f) @@ -6,8 +6,8 @@ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file tst_views.cpp - * \author (last) Behrouz NemaiPour - * \date (last) 23-Jun-2020 + * \author (last) Behrouz NematiPour + * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * @@ -17,9 +17,9 @@ // Qt // Project -#include "vtreatmentadjustmentresponsebase.h" -#include "vtreatmentadjustmentultrafiltrationstate.h" -#include "filehandler.h" +#include "VTreatmentAdjustmentResponseBase.h" +#include "VTreatmentAdjustmentUltrafiltrationState.h" +#include "FileHandler.h" tst_views::tst_views(QObject *parent) : QObject(parent) { }