Index: denali.pro =================================================================== diff -u -r9187b3bc0167642cfb350a372654e4cfc0be046b -re226d05ea339805934c2ebbaba108e7b03d5a001 --- denali.pro (.../denali.pro) (revision 9187b3bc0167642cfb350a372654e4cfc0be046b) +++ denali.pro (.../denali.pro) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -53,6 +53,7 @@ sources/main.h \ sources/model/MDGDebugText.h \ sources/model/MHDDebugText.h \ + sources/model/dg/data/MDGAccelerometerData.h \ sources/model/hd/data/MHDAccelerometerData.h \ sources/storage/DriveWatcher.h \ sources/threads.h \ @@ -110,6 +111,7 @@ sources/gui/guicontroller.h \ \ # ---------- Views ---------- sources/view/VEventSpy.h \ + sources/view/dg/data/VDGAccelerometerData.h \ sources/view/hd/data/VHDAccelerometerData.h \ sources/view/hd/data/VHDTreatmentStatesData.h \ sources/view/vview.h \ @@ -161,6 +163,7 @@ main.cpp \ sources/model/MDGDebugText.cpp \ sources/model/MHDDebugText.cpp \ + sources/model/dg/data/MDGAccelerometerData.cpp \ sources/model/hd/data/MHDAccelerometerData.cpp \ sources/storage/DriveWatcher.cpp \ sources/threads.cpp \ @@ -215,6 +218,7 @@ sources/gui/guicontroller.cpp \ \ # ---------- Views ---------- sources/view/VEventSpy.cpp \ + sources/view/dg/data/VDGAccelerometerData.cpp \ sources/view/hd/data/VHDAccelerometerData.cpp \ sources/view/hd/data/VHDTreatmentStatesData.cpp \ sources/view/vpoweroff.cpp \ Index: denali.pro.user =================================================================== diff -u -ra7d69670d2082f2e6e6941c986a3574ad9a7b280 -re226d05ea339805934c2ebbaba108e7b03d5a001 --- denali.pro.user (.../denali.pro.user) (revision a7d69670d2082f2e6e6941c986a3574ad9a7b280) +++ denali.pro.user (.../denali.pro.user) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/canbus/messageglobals.h =================================================================== diff -u -r9187b3bc0167642cfb350a372654e4cfc0be046b -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 9187b3bc0167642cfb350a372654e4cfc0be046b) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -70,6 +70,7 @@ {Gui::GuiActionType::ID_DGHeatersData , 3 * 4 }, // 3 parameters each 4bytes {Gui::GuiActionType::ID_DGLoadCellReadingsData , 4 * 4 }, // 4 parameters each 4bytes {Gui::GuiActionType::ID_DGTemperaturesData , 12 * 4 }, // 12 parameters each 4bytes + {Gui::GuiActionType::ID_DGAccelerometerData , 9 * 4 }, // 9 parameters each 4bytes // ---- {Gui::GuiActionType::ID_AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes @@ -210,6 +211,4 @@ typedef QList MessageList; typedef QList FrameList; - } - Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r9187b3bc0167642cfb350a372654e4cfc0be046b -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 9187b3bc0167642cfb350a372654e4cfc0be046b) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -46,8 +46,7 @@ * \return true on successful check and prepare. */ template -bool MessageInterpreter::notify(const Message &vMessage, QVariantList &vData, Gui::GuiActionType vIdCheck) -{ +bool MessageInterpreter::notify(const Message &vMessage, QVariantList &vData, Gui::GuiActionType vIdCheck) { bool ok = false; TModel tModel; if ( ! isValidMessage(vMessage, vIdCheck) ) return ok; @@ -71,8 +70,7 @@ * \param vType - The type of the message to be checked against * \return true on correct type */ -bool MessageInterpreter::isType(const Message &vMessage, Gui::GuiActionType vType) const -{ +bool MessageInterpreter::isType(const Message &vMessage, Gui::GuiActionType vType) const { if ( vMessage.actionId != vType ) { return false; } @@ -90,8 +88,7 @@ * \param vType - The type of the message to be checked against * \return true on correct data length for the type vType */ -bool MessageInterpreter::isPayloadLenValid(const Message &vMessage, Gui::GuiActionType vType) const -{ +bool MessageInterpreter::isPayloadLenValid(const Message &vMessage, Gui::GuiActionType vType) const { QString mActionIdHexString = Format::toHexString(vMessage.actionId); if ( ! payloadLen.contains(vType) ) { LOG_DEBUG(QString("Undefined data length for received Message with ID '%1'").arg(mActionIdHexString)); @@ -109,8 +106,7 @@ * \details Logs invalid data length for the message type vActionId * \param vActionId - Message Type */ -void MessageInterpreter::logInvalidLength(const Gui::GuiActionType &vActionId) -{ +void MessageInterpreter::logInvalidLength(const Gui::GuiActionType &vActionId) { QString mActionIdHexString = Format::toHexString(vActionId); LOG_DEBUG(QString("Incorrect data length for transmit message with ID '%1'") .arg(mActionIdHexString)); @@ -123,8 +119,7 @@ * \param vType - The type of the message to be checked against * \return true on valid massage */ -bool MessageInterpreter::isValidMessage(const Message &vMessage, Gui::GuiActionType vType) const -{ +bool MessageInterpreter::isValidMessage(const Message &vMessage, Gui::GuiActionType vType) const { if ( ! isType (vMessage, vType) ) return false; if ( ! isPayloadLenValid(vMessage, vType) ) return false; return true; @@ -137,8 +132,7 @@ * is known to the interpreter but has not been handled/implemented. * \param vMessage - The message contains Unhandled Message ID */ -void MessageInterpreter::printUnhandled(const Message &vMessage) const -{ +void MessageInterpreter::printUnhandled(const Message &vMessage) const { if ( gDisableUnhandledReport ) return; QString mActionIdHexString = Format::toHexString(vMessage.actionId, false, eLenMessageIDDigits); QString logMessage = tr("Unhandled Message ID (HD)") + '\n' + @@ -154,8 +148,7 @@ * \details Regarding the type of message logs the message received. * \param vModel - the MAbstract model type */ -void MessageInterpreter::logReceivedMessage(const Model::MAbstract &vModel) -{ +void MessageInterpreter::logReceivedMessage(const Model::MAbstract &vModel) { switch (vModel.typeText()) { case Model::MAbstract::Type_Enum::eDatum: LOG_DATUM(vModel.toString()); @@ -178,8 +171,7 @@ * \return true if the vActionId is valid. * This return value will be used later for error handling. */ -bool MessageInterpreter::interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload) -{ +bool MessageInterpreter::interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload) { bool ok = true; QString mSenderID = "UI,"; @@ -276,8 +268,7 @@ * \return true if the message channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::interpretMessage(const Message &vMessage, QVariantList &vData) { bool ok = false; switch (vMessage.can_id) { case eChlid_HD_UI : @@ -309,8 +300,7 @@ * \return true if the message CANBUS channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage_HD(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::interpretMessage_HD(const Message &vMessage, QVariantList &vData) { bool ok = false; vData.clear(); switch (vMessage.actionId) { // notice we are in receive mode @@ -372,8 +362,7 @@ * \return true if the message CANBUS channel is in the range which can be interpreted, false otherwise. * This return value will be used later to emit MessageDispatcher::didActionReceive signal or not */ -bool MessageInterpreter::interpretMessage_DG(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::interpretMessage_DG(const Message &vMessage, QVariantList &vData) { bool ok = false; vData.clear(); switch (vMessage.actionId) { // notice we are in receive mode @@ -392,13 +381,13 @@ case Gui::GuiActionType::ID_DGLoadCellReadingsData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGLoadCellReadingsData); break; case Gui::GuiActionType::ID_DGTemperaturesData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGTemperaturesData ); break; case Gui::GuiActionType::ID_DGDebugText : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGDebugText ); break; + case Gui::GuiActionType::ID_DGAccelerometerData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGAccelerometerData ); break; // unhandled messages: these will only be logged as received message // there has nothing been defined for these messages. default: printUnhandled (vMessage); break; - } return ok; @@ -416,8 +405,7 @@ * \param vData - Fault Count data * \return true if the data can be extracted as defined for Fault Count Message ID */ -bool MessageInterpreter::canbusFaultCountData(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::canbusFaultCountData(const Message &vMessage, QVariantList &vData) { // TODO : review other methods bool ok = false; if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_CANBusFaultCount) ) return ok; @@ -431,6 +419,7 @@ // coco end vData += mCanBUSFaultCount.value; } + return ok; } @@ -470,8 +459,7 @@ * \param vData - Alarm Triggered data * \return true if the data can be extracted as defined for Alarm Triggered Message ID */ -bool MessageInterpreter::alarmTriggered(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::alarmTriggered(const Message &vMessage, QVariantList &vData) { // TODO : review other methods bool ok = false; if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AlarmTriggered) ) return ok; @@ -495,8 +483,7 @@ * \param vData - Alarm Cleared data * \return true if the data can be extracted as defined for Alarm Cleared Message ID */ -bool MessageInterpreter::alarmCleared(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::alarmCleared(const Message &vMessage, QVariantList &vData) { // TODO : review other methods bool ok = false; if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AlarmCleared) ) return ok; @@ -522,8 +509,7 @@ * \param vData - Treatment Ultrafiltration State Adjustment Response data * \return true if the data can be extracted as defined for Treatment Ultrafiltration State Adjustment Response Message ID */ -bool MessageInterpreter::adjustUltrafiltrationState(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::adjustUltrafiltrationState(const Message &vMessage, QVariantList &vData) { bool ok = false; // TODO : In HD the Ultrafiltration State change shall have the rejection reason like other responses. if ( ! isType (vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq) ) return ok; @@ -548,8 +534,7 @@ * \param vData - Treatment Ultrafiltration Volume Adjustment Response data * \return true if the data can be extracted as defined for Treatment Ultrafiltration Volume Adjustment Response Message ID */ -bool MessageInterpreter::adjustUltrafiltrationEdit(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::adjustUltrafiltrationEdit(const Message &vMessage, QVariantList &vData) { bool ok = false; if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp) ) return ok; @@ -572,8 +557,7 @@ * \param vData - Treatment Ultrafiltration Volume Adjustment Confirm Response data * \return true if the data can be extracted as defined for Treatment Ultrafiltration Volume Adjustment Confirm Response Message ID */ -bool MessageInterpreter::adjustUltrafiltrationConfirm(const Message &vMessage, QVariantList &vData) -{ +bool MessageInterpreter::adjustUltrafiltrationConfirm(const Message &vMessage, QVariantList &vData) { bool ok = false; if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp) ) return ok; Index: sources/gui/guiglobals.cpp =================================================================== diff -u -r0385c56172a5803c14086b9464243600d019ef1f -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision 0385c56172a5803c14086b9464243600d019ef1f) +++ sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -50,6 +50,7 @@ #include "VDGReservoirData.h" #include "VDGTemperaturesData.h" #include "VDGValvesStatesData.h" +#include "VDGAccelerometerData.h" #include "vtreatmentadjustmentduration.h" #include "vtreatmentadjustmentflows.h" Index: sources/gui/guiglobals.h =================================================================== diff -u -r9187b3bc0167642cfb350a372654e4cfc0be046b -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision 9187b3bc0167642cfb350a372654e4cfc0be046b) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -96,6 +96,7 @@ ID_DGHeatersData = 0x2C00, // 44 ID_DGLoadCellReadingsData = 0x0C00, // 12 ID_DGTemperaturesData = 0x2D00, // 45 + ID_DGAccelerometerData = 0x3400, // 52 ID_AdjustBloodDialysateReq = 0x1700, // 23 ID_AdjustBloodDialysateRsp = 0x1800, // 24 Index: sources/gui/qml/pages/ManagerHome.qml =================================================================== diff -u -r4a13ac62c294b40ae39281ea8849611c27a0e9ae -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 4a13ac62c294b40ae39281ea8849611c27a0e9ae) +++ sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -238,6 +238,24 @@ textObjectName: "_HDAccelerometerData" } + DebugDataColumn { id: _DGAccelerometerColumn + x: col(7) + y: row(0) + title: qsTr(" DG Acc ") + model: [ + vDGAccelerometer.x .toFixed(3) , + vDGAccelerometer.y .toFixed(3) , + vDGAccelerometer.z .toFixed(3) , + vDGAccelerometer.xMax .toFixed(3) , + vDGAccelerometer.yMax .toFixed(3) , + vDGAccelerometer.zMax .toFixed(3) , + vDGAccelerometer.xTilt .toFixed(3) , + vDGAccelerometer.yTilt .toFixed(3) , + vDGAccelerometer.zTilt .toFixed(3) + ] + textObjectName: "_DGAccelerometerData" + } + Text { id : _canbusFaultCountText x: col(0) y: row(6) Index: sources/model/MModel.h =================================================================== diff -u -r9187b3bc0167642cfb350a372654e4cfc0be046b -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/model/MModel.h (.../MModel.h) (revision 9187b3bc0167642cfb350a372654e4cfc0be046b) +++ sources/model/MModel.h (.../MModel.h) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -40,6 +40,7 @@ #include "MDGROPumpData.h" #include "MDGTemperaturesData.h" #include "MDGValvesStatesData.h" +#include "MDGAccelerometerData.h" #include "MHDDebugText.h" #include "MDGDebugText.h" @@ -144,10 +145,11 @@ REGISTER_METATYPE( DGHeatersData ) \ REGISTER_METATYPE( DGLoadCellReadingsData ) \ REGISTER_METATYPE( DGTemperaturesData ) \ + REGISTER_METATYPE( DGAccelerometerData ) \ \ REGISTER_METATYPE( HDDebugTextData ) \ REGISTER_METATYPE( DGDebugTextData ) \ - /* Request */ \ + /* Request */ \ REGISTER_METATYPE( AdjustBloodDialysateRequestData ) \ REGISTER_METATYPE( AdjustDurationRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationStateRequestData ) \ @@ -188,6 +190,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGHeatersData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGLoadCellReadingsData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGTemperaturesData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGAccelerometerData ) \ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, HDDebugTextData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, DGDebugTextData ) \ @@ -232,6 +235,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( DGHeatersData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DGLoadCellReadingsData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DGTemperaturesData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( DGAccelerometerData ) \ \ ACTION_RECEIVE_BRIDGE_DEFINITION( HDDebugTextData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( DGDebugTextData ) \ @@ -292,6 +296,7 @@ ACTION_RECEIVE_SIGNAL( DGHeatersData ) \ ACTION_RECEIVE_SIGNAL( DGLoadCellReadingsData ) \ ACTION_RECEIVE_SIGNAL( DGTemperaturesData ) \ + ACTION_RECEIVE_SIGNAL( DGAccelerometerData ) \ \ ACTION_RECEIVE_SIGNAL( HDDebugTextData ) \ ACTION_RECEIVE_SIGNAL( DGDebugTextData ) \ Index: sources/model/dg/data/MDGAccelerometerData.cpp =================================================================== diff -u --- sources/model/dg/data/MDGAccelerometerData.cpp (revision 0) +++ sources/model/dg/data/MDGAccelerometerData.cpp (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -0,0 +1,68 @@ +/*! + * + * Copyright (c) 2020-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MDGAccelerometerData.cpp + * \author (last) Peman Montazemi + * \date (last) 20-Oct-2020 + * \author (original) Peman Montazemi + * \date (original) 20-Oct-2020 + * + */ +#include "MDGAccelerometerData.h" + +using namespace Model; + +QVariantList MDGAccelerometer::parameters() const { + return { + _data.mX .value, + _data.mY .value, + _data.mZ .value, + _data.mXMax .value, + _data.mYMax .value, + _data.mZMax .value, + _data.mXTilt .value, + _data.mYTilt .value, + _data.mZTilt .value, + }; +} + +bool MDGAccelerometer::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mX )) + if (GetValue(vByteArray, index, _data.mY )) + if (GetValue(vByteArray, index, _data.mZ )) + if (GetValue(vByteArray, index, _data.mXMax )) + if (GetValue(vByteArray, index, _data.mYMax )) + if (GetValue(vByteArray, index, _data.mZMax )) + if (GetValue(vByteArray, index, _data.mXTilt )) + if (GetValue(vByteArray, index, _data.mYTilt )) + if (GetValue(vByteArray, index, _data.mZTilt )) + 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; } +} + +MDGAccelerometer::Data MDGAccelerometer::data() const { + Data data; + data.mX = _data.mX .value; + data.mY = _data.mY .value; + data.mZ = _data.mZ .value; + data.mXMax = _data.mXMax .value; + data.mYMax = _data.mYMax .value; + data.mZMax = _data.mZMax .value; + data.mXTilt = _data.mXTilt .value; + data.mYTilt = _data.mYTilt .value; + data.mZTilt = _data.mZTilt .value; + return data; +} Index: sources/model/dg/data/MDGAccelerometerData.h =================================================================== diff -u --- sources/model/dg/data/MDGAccelerometerData.h (revision 0) +++ sources/model/dg/data/MDGAccelerometerData.h (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -0,0 +1,75 @@ +/*! + * + * Copyright (c) 2020-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MDGAccelerometerData.h + * \author (last) Peman Montazemi + * \date (last) 20-Oct-2020 + * \author (original) Peman Montazemi + * \date (original) 20-Oct-2020 + * + */ +#pragma once + + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +class MDGAccelerometer : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::F32 mX ; + Types::F32 mY ; + Types::F32 mZ ; + Types::F32 mXMax ; + Types::F32 mYMax ; + Types::F32 mZMax ; + Types::F32 mXTilt ; + Types::F32 mYTilt ; + Types::F32 mZTilt ; + } _data; + +public: + + Type_Enum typeText() const override { return Type_Enum::eDatum ; } + Unit_Enum unitText() const override { return Unit_Enum::eDG ; } + QString infoText() const override { return QString("DGAccelData") ; } + + struct Data { + float mX = 0; /*!< x Magnitude of acceleration vector in x axis in g units */ + float mY = 0; /*!< y Magnitude of acceleration vector in y axis in g units */ + float mZ = 0; /*!< z Magnitude of acceleration vector in z axis in g units */ + float mXMax = 0; /*!< x Max Maximum magnitude of acceleration vector in x axis in g units */ + float mYMax = 0; /*!< y Max Maximum magnitude of acceleration vector in y axis in g units */ + float mZMax = 0; /*!< z Max Maximum magnitude of acceleration vector in z axis in g units */ + float mXTilt = 0; /*!< x Tilt Tilt angle in the x axis in degrees */ + float mYTilt = 0; /*!< y Tilt Tilt angle in the y axis in degrees */ + float mZTilt = 0; /*!< z Tilt Tilt angle in the z axis in degrees */ + }; + +public: + MDGAccelerometer () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MDGAccelerometer::Data DGAccelerometerData; Index: sources/view/dg/data/VDGAccelerometerData.cpp =================================================================== diff -u --- sources/view/dg/data/VDGAccelerometerData.cpp (revision 0) +++ sources/view/dg/data/VDGAccelerometerData.cpp (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -0,0 +1,32 @@ +/*! + * + * Copyright (c) 2020-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VDGAccelerometerData.cpp + * \author (last) Peman Montazemi + * \date (last) 20-Oct-2020 + * \author (original) Peman Montazemi + * \date (original) 20-Oct-2020 + * + */ +#include "VDGAccelerometerData.h" + +// Project +#include "guicontroller.h" + +VIEW_DEF(VDGAccelerometer, DGAccelerometerData) + +void VDGAccelerometer::onActionReceive(const DGAccelerometerData &vData) { + x (vData.mX ); + y (vData.mY ); + z (vData.mZ ); + xMax (vData.mXMax ); + yMax (vData.mYMax ); + zMax (vData.mZMax ); + zTilt (vData.mXTilt ); + yTilt (vData.mYTilt ); + zTilt (vData.mZTilt ); +} Index: sources/view/dg/data/VDGAccelerometerData.h =================================================================== diff -u --- sources/view/dg/data/VDGAccelerometerData.h (revision 0) +++ sources/view/dg/data/VDGAccelerometerData.h (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -0,0 +1,42 @@ +/*! + * + * Copyright (c) 2020-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VDGAccelerometerData.h + * \author (last) Peman Montazemi + * \date (last) 20-Oct-2020 + * \author (original) Peman Montazemi + * \date (original) 20-Oct-2020 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MModel.h" +#include "vview.h" + +// namespace +namespace View { + +class VDGAccelerometer : public QObject { + Q_OBJECT + + PROPERTY( float , x , 0) + PROPERTY( float , y , 0) + PROPERTY( float , z , 0) + PROPERTY( float , xMax , 0) + PROPERTY( float , yMax , 0) + PROPERTY( float , zMax , 0) + PROPERTY( float , xTilt , 0) + PROPERTY( float , yTilt , 0) + PROPERTY( float , zTilt , 0) + + VIEW_DEC(VDGAccelerometer, DGAccelerometerData) +}; +} Index: sources/view/hd/data/VHDAccelerometerData.cpp =================================================================== diff -u -r63107b136b69d7275b63ecfc5d64527874366124 -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/view/hd/data/VHDAccelerometerData.cpp (.../VHDAccelerometerData.cpp) (revision 63107b136b69d7275b63ecfc5d64527874366124) +++ sources/view/hd/data/VHDAccelerometerData.cpp (.../VHDAccelerometerData.cpp) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -19,8 +19,7 @@ VIEW_DEF(VHDAccelerometer, HDAccelerometerData) -void VHDAccelerometer::onActionReceive(const HDAccelerometerData &vData) -{ +void VHDAccelerometer::onActionReceive(const HDAccelerometerData &vData) { x (vData.mX ); y (vData.mY ); z (vData.mZ ); Index: sources/view/vview.h =================================================================== diff -u -r9187b3bc0167642cfb350a372654e4cfc0be046b -re226d05ea339805934c2ebbaba108e7b03d5a001 --- sources/view/vview.h (.../vview.h) (revision 9187b3bc0167642cfb350a372654e4cfc0be046b) +++ sources/view/vview.h (.../vview.h) (revision e226d05ea339805934c2ebbaba108e7b03d5a001) @@ -116,6 +116,7 @@ REGISTER_TYPE( VDGReservoir ) \ REGISTER_TYPE( VDGTemperatures ) \ REGISTER_TYPE( VDGValvesStates ) \ + REGISTER_TYPE( VDGAccelerometer ) \ \ REGISTER_TYPE( VTreatmentAdjustmentDuration ) \ REGISTER_TYPE( VTreatmentAdjustmentFlows ) \