Index: cppcheck.err =================================================================== diff -u -r571019286d14ba1b655897c70ee28b7a9a0d80d5 -ra89b5249df072be403141463d7d88728b66a848e --- cppcheck.err (.../cppcheck.err) (revision 571019286d14ba1b655897c70ee28b7a9a0d80d5) +++ cppcheck.err (.../cppcheck.err) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -39,7 +39,7 @@ When you see this message it is always safe to reduce the variable scope 1 level. [sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h:67] -> [sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h:61]: (warning) The class 'MAdjustUltrafiltrationEditResponse' defines member variable with name 'stringPrefix' also defined in its parent class 'MAdjustUltrafiltrationConfirmResponse'. [sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h:79] -> [sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h:79]: (warning) The class 'MAdjustUltrafiltrationEditResponse' defines member variable with name '_data' also defined in its parent class 'MAdjustUltrafiltrationConfirmResponse'. -[sources/storage/Settings.h:39]: (style) Unused private function: 'Settings::makeSetting' +[sources/storage/Settings.h:44]: (style) Unused private function: 'Settings::makeSetting' [sources/AlarmGenerator.cpp:68]: (style) The function 'ALARM_ID_BLE_CUFF' is never used. [sources/view/VTreatmentCreate.cpp:124]: (style) The function 'doCancel' is never used. [sources/view/settings/VNetworkModel.cpp:223]: (style) The function 'doCheckIfConnected' is never used. Index: denali.pro =================================================================== diff -u -rb3eb8bc9696c4db9867ad1cf13b47c455a94e0fe -ra89b5249df072be403141463d7d88728b66a848e --- denali.pro (.../denali.pro) (revision b3eb8bc9696c4db9867ad1cf13b47c455a94e0fe) +++ denali.pro (.../denali.pro) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -128,6 +128,7 @@ \ # ---------- Models - HD - Adjustment - Settings sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.h \ sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.h \ + sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.h \ \ # ---------- Models - HD - Adjustment - Pre-Treatment sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.h \ @@ -346,6 +347,7 @@ \ # ---------- Models - HD - Adjustment - Settings sources/model/hd/adjustment/settings/MAdjustHDVersionsResponse.cpp \ sources/model/hd/adjustment/settings/MAdjustHDDateTimeResponse.cpp \ + sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.cpp \ \ # ---------- Models - HD - Adjustment - Pre-Treatment sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustInitTreatmentResponse.cpp \ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp \ Index: denali.pro.user =================================================================== diff -u -r56ad953ae404fcf6956bd4f76b7a54b12d0285d3 -ra89b5249df072be403141463d7d88728b66a848e --- denali.pro.user (.../denali.pro.user) (revision 56ad953ae404fcf6956bd4f76b7a54b12d0285d3) +++ denali.pro.user (.../denali.pro.user) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -r6816b783f50e08267aa016d64350bc020080d901 -ra89b5249df072be403141463d7d88728b66a848e --- en_US.udic (.../en_US.udic) (revision 6816b783f50e08267aa016d64350bc020080d901) +++ en_US.udic (.../en_US.udic) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -119,3 +119,5 @@ VDGOperation csv Sys +FIXME +HDAlarm Index: scripts/brightness_set.sh =================================================================== diff -u --- scripts/brightness_set.sh (revision 0) +++ scripts/brightness_set.sh (revision a89b5249df072be403141463d7d88728b66a848e) @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$#" -eq 0 ]; then + currentFile=$(basename "$0") + echo "Usage: ./$currentFile ''" + exit 0 +fi + +echo "$1" > /sys/class/backlight/backlight-mipi/brightness Index: scripts/copy.sh =================================================================== diff -u -r6c5b5292ae3b3ebf979175dcb1256c88b1baf90c -ra89b5249df072be403141463d7d88728b66a848e --- scripts/copy.sh (.../copy.sh) (revision 6c5b5292ae3b3ebf979175dcb1256c88b1baf90c) +++ scripts/copy.sh (.../copy.sh) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -169,11 +169,17 @@ done } +# copy the brightness settings scripts +function copyBrightnessScripts() { + copyFileTo "brightness_set.sh" $SCRIPTSPATH +} + # copy the settings scripts function setupSettingsScripts() { ssh $SSHUSER@$IPADDR "mkdir $SCRIPTSPATH;" copyDateTimeScripts copyWifiScripts + copyBrightnessScripts ssh $SSHUSER@$IPADDR "cd $1; chmod a+x *.sh;" } Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r6816b783f50e08267aa016d64350bc020080d901 -ra89b5249df072be403141463d7d88728b66a848e --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 6816b783f50e08267aa016d64350bc020080d901) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -328,6 +328,20 @@ /*! * \brief MessageDispatcher::onAdjustment + * \details This method transmits the DG Set Date Time Denali message. + * \details This method transmits the request to set the alarm volume. + * \param vData - Data model contains the alarm volume + * \return void + */ +void MessageDispatcher::onAdjustment(const AdjustHDAlarmVolumeRequestData &vData) +{ + QVariantList mData; + mData += vData.volume; + onActionTransmit(GuiActionType::ID_AlarmVolumeSetReq, mData); +} + +/*! + * \brief MessageDispatcher::onAdjustment * \details This method transmits the Alarm Acknowledge Request message. * \param vData - Data model contains the user acknowledge request information. * \return void @@ -788,6 +802,8 @@ bool ok = false; QVariantList mData; Sequence mSequence = vMessage.sequence; + Can_Source src = MessageInterpreter::identifySource(vMessage.can_id); + QString ids = src == Can_Source::eCan_HD ? "HD" : src == Can_Source::eCan_DG ? "DG" : "XX"; // coco begin validated: Has been validated manually. If MessageInterpreter::interpretMessage fails, this also returns false if (_interpreter.interpretMessage(vMessage, mData)) { // coco end @@ -796,7 +812,7 @@ switch (mActionId) { case GuiActionType::ID_Acknow: #ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG - LOG_EVENT(tr("HD,Ack Bak, Sq:%1").arg(mSequence)); + LOG_EVENT(tr("%1,Ack Bak, Sq:%2").arg(ids).arg(mSequence)); break; #endif #ifdef DEBUG_ACKBACK_HD_TO_UI qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckBak : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence).arg(vMessage.actionId); @@ -807,7 +823,7 @@ default: if (mSequence < 0) { #ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG - LOG_EVENT(tr("HD,Ack Req, Sq:%1, ID:%2").arg(mSequence).arg(Format::toHexString(mActionId))); + LOG_EVENT(tr("%1,Ack Req, Sq:%2, ID:%3").arg(ids).arg(mSequence).arg(Format::toHexString(mActionId))); #endif #ifdef DEBUG_ACKBACK_HD_TO_UI qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckReq : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence).arg(vMessage.actionId); Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -rb3eb8bc9696c4db9867ad1cf13b47c455a94e0fe -ra89b5249df072be403141463d7d88728b66a848e --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision b3eb8bc9696c4db9867ad1cf13b47c455a94e0fe) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -111,6 +111,7 @@ GuiActionType::ID_AlarmSilenceReq , GuiActionType::ID_AlarmClearedConditionReq , GuiActionType::ID_AlarmActiveListReq , + GuiActionType::ID_AlarmVolumeSetReq , // Pre-Treatment GuiActionType::ID_AdjustInitTreatmentReq , GuiActionType::ID_AdjustWaterSampleReq , Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -rdd6c876521e397ff990f81e7363b4f007fe3e2d9 -ra89b5249df072be403141463d7d88728b66a848e --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision dd6c876521e397ff990f81e7363b4f007fe3e2d9) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -92,6 +92,8 @@ {Gui::GuiActionType::ID_AlarmUserActionReq , 1 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AlarmActiveListReq , 0 * 4 }, // 1 parameter each 4bytes {Gui::GuiActionType::ID_AlarmActiveListRsp , 12 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AlarmVolumeSetReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AlarmVolumeSetRsp , 2 * 4 }, // 2 parameters each 4bytes // ---- {Gui::GuiActionType::ID_TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes @@ -286,6 +288,16 @@ }; /*! + * \brief The Can_Source enum + * \details The allowable sources of the CANBus messages. + */ +enum Can_Source { + eCan_Unknown = -1, + eCan_HD = 0, + eCan_DG = 1, +}; + +/*! * \brief The Message struct * \details The message structure after it's been converted form hex bytes to meaningful struct for UI. */ Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rb3eb8bc9696c4db9867ad1cf13b47c455a94e0fe -ra89b5249df072be403141463d7d88728b66a848e --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision b3eb8bc9696c4db9867ad1cf13b47c455a94e0fe) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -277,6 +277,7 @@ // alarms case Gui::GuiActionType::ID_AlarmSilenceReq : INTERPRET_TRANSMIT_MESSAGE(AlarmSilenceRequestData ); break; case Gui::GuiActionType::ID_AlarmUserActionReq : INTERPRET_TRANSMIT_MESSAGE(AlarmUserActionRequestData ); break; + case Gui::GuiActionType::ID_AlarmVolumeSetReq : INTERPRET_TRANSMIT_MESSAGE(AdjustHDAlarmVolumeRequestData ); break; // coco begin validated: Manually tested. This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. case Gui::GuiActionType::ID_AlarmClearedConditionReq : INTERPRET_TRANSMIT_MESSAGE(AlarmClearedConditionRequestData ); break; case Gui::GuiActionType::ID_AlarmActiveListReq : INTERPRET_TRSMT_MT_MESSAGE(AlarmActiveListRequestData ); break; @@ -291,6 +292,32 @@ } /*! + * \brief MessageInterpreter::identifySource + * \details Identifies the source of the message regarding the channgel id + * \return the source of the message in enum + * \sa can::Can_Source + */ +Can_Source MessageInterpreter::identifySource(Can_Id vCanId) +{ + switch (vCanId) { + case eChlid_HD_DG : // 0x008, ///< HD => DG + case eChlid_HD_UI : // 0x020, ///< HD => UI + case eChlid_HD_Alarm: // 0x001, ///< HD alarm broadcast + case eChlid_HD_Sync : // 0x040, ///< HD sync broadcast + return Can_Source::eCan_HD; + + case eChlid_DG_HD : // 0x010, ///< DG => HD + case eChlid_DG_UI : // 0x070, ///< DG => UI + case eChlid_DG_Alarm: // 0x002, ///< DG alarm broadcast + case eChlid_DG_Sync : // 0x080, ///< DG sync broadcast + return Can_Source::eCan_DG; + + default: + return Can_Source::eCan_Unknown; + } +} + +/*! * \brief MessageInterpreter::interpretMessage * \details This method will call appropriate message interpreter * for received messages from HD or DG regarding the Can_Id. @@ -306,19 +333,11 @@ bool MessageInterpreter::interpretMessage(const Message &vMessage, QVariantList &vData) { bool ok = false; - switch (vMessage.can_id) { - case eChlid_HD_DG : // break; // 0x008 : to remove the channel from listen list remove the break comment - case eChlid_HD_UI : // break; // 0x020 : to remove the channel from listen list remove the break comment - case eChlid_HD_Alarm: // break; // 0x001 : to remove the channel from listen list remove the break comment - case eChlid_HD_Sync : /* 0x040 */ ok = interpretMessage_HD(vMessage, vData); break; - case eChlid_DG_HD : // break; // 0x010 : to remove the channel from listen list remove the break comment - case eChlid_DG_UI : // break; // 0x070 : to remove the channel from listen list remove the break comment - case eChlid_DG_Alarm: // break; // 0x002 : to remove the channel from listen list remove the break comment - case eChlid_DG_Sync : /* 0x080 */ ok = interpretMessage_DG(vMessage, vData); break; - - default: - break; + switch (identifySource(vMessage.can_id)) { + case Can_Source::eCan_HD: ok = interpretMessage_HD(vMessage, vData); break; + case Can_Source::eCan_DG: ok = interpretMessage_DG(vMessage, vData); break; + default : break; } return ok; } @@ -422,6 +441,7 @@ case Gui::GuiActionType::ID_AlarmStatus : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmStatus ); break; case Gui::GuiActionType::ID_AlarmTriggered : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmTriggered ); break; case Gui::GuiActionType::ID_AlarmCleared : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmCleared ); break; + case Gui::GuiActionType::ID_AlarmVolumeSetRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmVolumeSetRsp ); break; // coco begin validated: Manually tested. This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. case Gui::GuiActionType::ID_AlarmClearedConditionRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmClearedConditionRsp ); break; case Gui::GuiActionType::ID_AlarmActiveListRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmActiveListRsp ); break; Index: sources/canbus/MessageInterpreter.h =================================================================== diff -u -r0b8e00869ef81ef0a834c03c13049f4c281870d2 -ra89b5249df072be403141463d7d88728b66a848e --- sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision 0b8e00869ef81ef0a834c03c13049f4c281870d2) +++ sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -79,6 +79,8 @@ bool interpretMessage(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; bool interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload, Can_Id &vCanId) __attribute_warn_unused_result__; + static Can_Source identifySource(Can_Id vCanId); + signals: ACTION_RECEIVE_SIGNALS }; Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rb3eb8bc9696c4db9867ad1cf13b47c455a94e0fe -ra89b5249df072be403141463d7d88728b66a848e --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision b3eb8bc9696c4db9867ad1cf13b47c455a94e0fe) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -120,6 +120,8 @@ ID_AlarmUserActionReq = 0x4000, // 64 // there is no response since it is kind of the response to the ID_AlarmStatus from UI to HD ID_AlarmActiveListReq = 0x9700, // 151 ID_AlarmActiveListRsp = 0x9800, // 152 + ID_AlarmVolumeSetReq = 0x4E00, // 78 + ID_AlarmVolumeSetRsp = 0x7C00, // 124 // Pre-Treatment // Pre-Treatment Initiate Treatment Index: sources/gui/qml/pages/settings/SettingsDG.qml =================================================================== diff -u -r56ad953ae404fcf6956bd4f76b7a54b12d0285d3 -ra89b5249df072be403141463d7d88728b66a848e --- sources/gui/qml/pages/settings/SettingsDG.qml (.../SettingsDG.qml) (revision 56ad953ae404fcf6956bd4f76b7a54b12d0285d3) +++ sources/gui/qml/pages/settings/SettingsDG.qml (.../SettingsDG.qml) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -24,8 +24,14 @@ import "qrc:/components" /*! - * \brief SettingsDateTimeSet is used to adjust the - * date and time on the device + * \brief SettingsDG provides user options to manually initiate the + * - Water Flush + * - Heat Disinfection + * - Chemical Disinfection \n + * or schedule the + * - Water Flush + * - Heat Disinfection \n + * on daily cycle at certain time of the day */ SettingsBase { id: _root QtObject { id: vSettingsDG Index: sources/gui/qml/pages/settings/SettingsDateTime.qml =================================================================== diff -u -r56ad953ae404fcf6956bd4f76b7a54b12d0285d3 -ra89b5249df072be403141463d7d88728b66a848e --- sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision 56ad953ae404fcf6956bd4f76b7a54b12d0285d3) +++ sources/gui/qml/pages/settings/SettingsDateTime.qml (.../SettingsDateTime.qml) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -80,7 +80,7 @@ width : entryWidth validator : IntValidator { bottom : 0 - top : 24 + top : 23 } } @@ -147,6 +147,7 @@ width : entryWidth validator : IntValidator { bottom : 1970 + top : 2100 // seems date command is not accepting more than 2100 } } } Index: sources/model/MAbstract.h =================================================================== diff -u -r7077e38c74db9cccb5496ffefcf8936c0916de76 -ra89b5249df072be403141463d7d88728b66a848e --- sources/model/MAbstract.h (.../MAbstract.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) +++ sources/model/MAbstract.h (.../MAbstract.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -8,7 +8,7 @@ * \file MAbstract.h * \author (last) Behrouz NematiPour * \date (last) 16-Oct-2020 - * \author (original) Behrouz NemaiPour + * \author (original) Behrouz NematiPour * \date (original) 02-Jul-2020 * */ Index: sources/model/MModel.h =================================================================== diff -u -rb3eb8bc9696c4db9867ad1cf13b47c455a94e0fe -ra89b5249df072be403141463d7d88728b66a848e --- sources/model/MModel.h (.../MModel.h) (revision b3eb8bc9696c4db9867ad1cf13b47c455a94e0fe) +++ sources/model/MModel.h (.../MModel.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -24,6 +24,7 @@ #include "MAlarmCleared.h" #include "MAlarmClearedCondition.h" #include "MAlarmActiveList.h" +#include "MAdjustHDAlarmVolumeResponse.h" // States Messages #include "MHDOperationModeData.h" @@ -333,6 +334,7 @@ REGISTER_METATYPE( AdjustVersionsRequestData ) \ REGISTER_METATYPE( AdjustHDDateTimeRequestData ) \ REGISTER_METATYPE( AdjustDGDateTimeRequestData ) \ + REGISTER_METATYPE( AdjustHDAlarmVolumeRequestData ) \ \ /* Response */ \ /* Post-Treatment */ \ @@ -368,6 +370,7 @@ REGISTER_METATYPE( AdjustDGDateTimeResponseData ) \ /* Alarms - Active List Response */ \ REGISTER_METATYPE( AlarmActiveListResponseData ) \ + REGISTER_METATYPE( AdjustHDAlarmVolumeResponseData ) \ @@ -473,6 +476,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDGDateTimeResponseData ) \ /* Alarms - Active List Response */ \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AlarmActiveListResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustHDAlarmVolumeResponseData ) \ // /* Request */ ---------------------------------------------------------// @@ -493,6 +497,7 @@ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustVersionsRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustHDDateTimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDGDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustHDAlarmVolumeRequestData ) \ /* Post-Treatment */ \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustPatientDisconnectionConfirmRequestData ) \ ADJUST_TRANSMT_BRIDGE_CONNECTION(vSOURCE, AdjustDisposablesRemovalConfirmRequestData ) \ @@ -625,6 +630,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDGDateTimeResponseData ) \ /* Alarms - Active List Response */ \ ACTION_RECEIVE_BRIDGE_DEFINITION( AlarmActiveListResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustHDAlarmVolumeResponseData ) \ #define ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS \ @@ -664,6 +670,7 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustVersionsRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustHDDateTimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustDGDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION( AdjustHDAlarmVolumeRequestData ) \ /* Alarms */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION( AlarmUserActionRequestData ) \ @@ -709,6 +716,7 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustVersionsRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustHDDateTimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustDGDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AdjustHDAlarmVolumeRequestData ) \ /* Alarms */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_NOEMIT( AlarmUserActionRequestData ) \ @@ -754,6 +762,7 @@ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustVersionsRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustHDDateTimeRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustDGDateTimeRequestData ) \ + ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AdjustHDAlarmVolumeRequestData ) \ /* Alarms */ \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AlarmSilenceRequestData ) \ ADJUST_TRANSMT_BRIDGE_DEFINITION_PUBLIC( AlarmUserActionRequestData ) \ @@ -851,6 +860,7 @@ ACTION_RECEIVE_SIGNAL( AdjustDGDateTimeResponseData ) \ /* Alarms */ \ ACTION_RECEIVE_SIGNAL( AlarmActiveListResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustHDAlarmVolumeResponseData ) \ //--------------------------------------------------------------------------------// Index: sources/model/dg/adjustment/settings/MAdjustDGRequests.h =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -ra89b5249df072be403141463d7d88728b66a848e --- sources/model/dg/adjustment/settings/MAdjustDGRequests.h (.../MAdjustDGRequests.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/model/dg/adjustment/settings/MAdjustDGRequests.h (.../MAdjustDGRequests.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -37,7 +37,7 @@ * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| - * | 111 | 0x110 | Req | Y | UI | DG | Set RTC Date and Time | + * | 111 | 0x110 | Req | Y | UI | DG | Set RTC Date and Time | * * | Payload || * | || @@ -55,6 +55,8 @@ static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustDGDateTime", vParameters); } + + static Can::Can_Id canid () { return Can::Can_Id::eChlid_UI_DG; } }; } Index: sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.cpp =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.cpp (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.cpp (revision a89b5249df072be403141463d7d88728b66a848e) @@ -0,0 +1,45 @@ +/*! + * + * Copyright (c) 2021 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 MAdjustHDAlarmVolumeResponse.cpp + * \author (last) Peter Lucia + * \date (last) 04-May-2021 + * \author (original) Peter Lucia + * \date (original) 04-May-2021 + * + */ +#include "MAdjustHDAlarmVolumeResponse.h" + +using namespace Model; + +QVariantList MAdjustHDAlarmVolumeResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustHDAlarmVolumeResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +/*! + * \brief MAdjustHDDateTimeResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustHDAlarmVolumeResponseData MAdjustHDAlarmVolumeResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.h =================================================================== diff -u --- sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.h (revision 0) +++ sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.h (revision a89b5249df072be403141463d7d88728b66a848e) @@ -0,0 +1,82 @@ +/*! + * + * Copyright (c) 2021 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 MAdjustHDAlarmVolumeResponse.h + * \author (last) Peter Lucia + * \date (last) 04-May-2021 + * \author (original) Peter Lucia + * \date (original) 04-May-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustHDAlarmVolumeResponse class + * \details The HD Alarm Volume adjustment response model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:---------------------:| + * |0x7C00| 0x020 | Rsp | Y | HD | UI | Set Alarm Volume Rsp | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustHDAlarmVolume| + * + */ +class MAdjustHDAlarmVolumeResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + } _data; + +public: + + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eHD ; } + QString infoText () const override { return QString("AdjustHDAlarmVolume") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustHDAlarmVolumeResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustHDAlarmVolumeResponse::Data AdjustHDAlarmVolumeResponseData; Index: sources/model/hd/adjustment/settings/MAdjustHDRequests.h =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -ra89b5249df072be403141463d7d88728b66a848e --- sources/model/hd/adjustment/settings/MAdjustHDRequests.h (.../MAdjustHDRequests.h) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/model/hd/adjustment/settings/MAdjustHDRequests.h (.../MAdjustHDRequests.h) (revision a89b5249df072be403141463d7d88728b66a848e) @@ -39,9 +39,9 @@ * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| * | 109 | 0x100 | Req | Y | UI | HD | Set RTC Date and Time | * - * | Payload || - * | || - * | #1:(U32) | \ref mEpoch | + * | Payload || + * | || + * | #1:(U32) mEpoch | \ref mEpoch | * */ class MAdjustHDDateTimeReq : public MModel { @@ -57,7 +57,35 @@ } }; -} +/*! + * \brief The MAdjustAlarmVolumeReq class + * \details The HD alarm volume request model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * | 0x4E00 | 0x100 | Req | Y | UI | HD | HD Set Alarm Volume Request | + * + * | Payload || + * | || + * | #1:(U32) volume | \ref MAdjustHDAlarmVolumeResponse | + * + */ +class MAdjustHDAlarmVolumeReq : public MModel { +public: -typedef Model::MAdjustHDDateTimeReq AdjustHDDateTimeRequestData; + quint32 volume; + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString( { volume } ); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustHDAlarmVolume", vParameters); + } +}; +} + +typedef Model::MAdjustHDDateTimeReq AdjustHDDateTimeRequestData ; +typedef Model::MAdjustHDAlarmVolumeReq AdjustHDAlarmVolumeRequestData ;