Index: denali.pro =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- denali.pro (.../denali.pro) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ denali.pro (.../denali.pro) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -234,6 +234,7 @@ sources/view/settings/VSettings.h \ sources/view/settings/VAdjustmentVersions.h \ sources/view/settings/VNetworkModel.h \ + sources/view/settings/VAdjustmentAlarmVolume.h \ \ # ---------- Views - Alarm sources/view/hd/alarm/VAlarmStatus.h \ sources/view/hd/alarm/VAlarmActiveList.h \ @@ -452,6 +453,7 @@ sources/view/settings/VDateTime.cpp \ sources/view/settings/VAdjustmentVersions.cpp \ sources/view/settings/VNetworkModel.cpp \ + sources/view/settings/VAdjustmentAlarmVolume.cpp \ \ # ---------- Views - HD - Adjustment sources/view/VAdjustmentResponseBase.cpp \ \ # ---------- Views - HD - Adjustment - Pre-Treatment Index: denali.pro.user =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- denali.pro.user (.../denali.pro.user) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ denali.pro.user (.../denali.pro.user) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -r61f16c988a159401c92730b4cbfca5085c77222f -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- en_US.udic (.../en_US.udic) (revision 61f16c988a159401c92730b4cbfca5085c77222f) +++ en_US.udic (.../en_US.udic) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -125,4 +125,4 @@ VDevice acknow Gui -Gui +hd Index: scripts/brightness_get.sh =================================================================== diff -u --- scripts/brightness_get.sh (revision 0) +++ scripts/brightness_get.sh (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "$(cat /sys/class/backlight/backlight-mipi/brightness)" Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r61f16c988a159401c92730b4cbfca5085c77222f -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 61f16c988a159401c92730b4cbfca5085c77222f) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -323,7 +323,7 @@ void MessageDispatcher::onAdjustment(const AlarmActiveListRequestData &) { QVariantList mData; - onActionTransmit(GuiActionType::ID_AlarmUserActionReq, mData); + onActionTransmit(GuiActionType::ID_AlarmActiveListReq, mData); } /*! @@ -336,7 +336,7 @@ void MessageDispatcher::onAdjustment(const AdjustHDAlarmVolumeRequestData &vData) { QVariantList mData; - mData += vData.volume; + mData += vData.volume / 20; // HD vol range is [1-5] and we show [20%-100%] to user. onActionTransmit(GuiActionType::ID_AlarmVolumeSetReq, mData); } Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r376859852f4d1a07263c44524aec347db29e0133 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 376859852f4d1a07263c44524aec347db29e0133) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -293,7 +293,7 @@ /*! * \brief MessageInterpreter::identifySource - * \details Identifies the source of the message regarding the channgel id + * \details Identifies the source of the message regarding the channel id * \return the source of the message in enum * \sa can::Can_Source */ Index: sources/device/DeviceController.cpp =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -352,7 +352,7 @@ // has been tested manually bool ok; _usbDrive = vDevice.toLatin1().constData(); - ok = ::mount(_usbDrive, USB_Mount_Point, USB_File_System,MS_SYNCHRONOUS , "") == 0; + ok = ::mount(_usbDrive, USB_Mount_Point, USB_File_System, MS_SYNCHRONOUS, "") == 0; if (ok) { _mounted = true; _removed = false; @@ -420,8 +420,7 @@ bool DeviceController::checkError(DeviceError::Scripts_Error_Enum vError, TModel &vModel, QString vExtraLogInfo) { if ( vError ) { - QString src = vError > DeviceError::eScripts_Error_Start ? MAbstract::unitText(MAbstract::Unit_Enum::eUI) : MAbstract::unitText(MAbstract::Unit_Enum::eDV) + ","; - + QString src = (vError > DeviceError::eScripts_Error_Start ? MAbstract::unitText(MAbstract::Unit_Enum::eUI) : MAbstract::unitText(MAbstract::Unit_Enum::eDV)) + ","; vModel._data.mAccepted = false ; vModel._data.mReason = vError ; vModel._data.mMessage = DeviceError::scriptErrorText(vError) + QString(" [%1]").arg(vError); @@ -439,43 +438,45 @@ */ void DeviceController::onAttributeRequest(const DeviceBrightnessRequestData &vData) { + // ----- initializing the member variable models + _deviceBrightnessRequest ._data = vData; + _deviceBrightnessResponse._data.mBrightnessPercent = _deviceBrightnessRequest._data.mBrightness_old * 10; // set to old value in case of error - Model::MDeviceBrightnessRequest mRequest (vData); - Model::MDeviceBrightnessResponse mResponse ; - mResponse._data.mBrightnessPercent = _brightness_old * 10; // set to old value in case of error - // ----- extract the required data - _brightness_val = vData.mBrightnessPercent / 10; // convert the GUI value(percent) to device value - LOG_EVENT(mRequest.toString()); + _deviceBrightnessRequest._data.mBrightness_val = vData.mBrightnessPercent / 10; // convert the GUI value(percent) to device value + LOG_EVENT(_deviceBrightnessRequest.toString()); // ----- check that script exists. QString script; - if ( checkError( DeviceError::checkScript(script, Brightness_Set ), mResponse, script) ) + if ( checkError( DeviceError::checkScript(script, vData.mRead ? Brightness_Get : Brightness_Set), _deviceBrightnessResponse, script) ) return; // ----- check if the process is not running if ( _processBrightness.state() != QProcess::NotRunning ) { - checkError(DeviceError::eScripts_Error_IsRunning, mResponse); + checkError(DeviceError::eScripts_Error_IsRunning, _deviceBrightnessResponse); return; } // ----- check the data is valid - if ( _brightness_min > _brightness_val || _brightness_val > _brightness_max ) { - checkError(DeviceError::eScripts_Error_OutOfRange, mResponse); + // TODO : this should be in the model + if ( _deviceBrightnessRequest.mBrightness_min > _deviceBrightnessRequest._data.mBrightness_val || _deviceBrightnessRequest._data.mBrightness_val > _deviceBrightnessRequest.mBrightness_max ) { + checkError(DeviceError::eScripts_Error_OutOfRange, _deviceBrightnessResponse); return; } + // ----- check the value is in the list of correct resolution - // create the list of correct values + // create the list of correct values + // TODO : this should be in the model QList _allowableValues; - for ( quint8 i = _brightness_min; i <= _brightness_max; i += _brightness_res ) _allowableValues += i; - // check the value is in the list - if ( ! _allowableValues.contains(_brightness_val) ) { - checkError(DeviceError::eScripts_Error_Incorrect, mResponse); + for ( quint8 i = _deviceBrightnessRequest.mBrightness_min; i <= _deviceBrightnessRequest.mBrightness_max; i += _deviceBrightnessRequest.mBrightness_res ) _allowableValues += i; + // check the value is in the list + if ( ! _allowableValues.contains(_deviceBrightnessRequest._data.mBrightness_val) ) { + checkError(DeviceError::eScripts_Error_Incorrect_Req, _deviceBrightnessResponse); return; } // ----- run the process - _processBrightness.start(script, QStringList() << QString::number(_brightness_val)); + _processBrightness.start(script, QStringList() << QString::number(_deviceBrightnessRequest._data.mBrightness_val)); } /*! @@ -491,12 +492,24 @@ */ void DeviceController::onProcessBrightnessExitCode(int vExitCode) { - Model::MDeviceBrightnessResponse mResponse; - mResponse._data.mBrightnessPercent = _brightness_old * 10; // set to old value in case of error - if ( ! checkError(static_cast(vExitCode), mResponse, Brightness_Set) ) { // has no error - mResponse._data.mBrightnessPercent = _brightness_val * 10; - mResponse._data.mMessage = mResponse.toString(); - LOG_EVENT(mResponse._data.mMessage); - emit didAttributeResponse(mResponse._data); + _deviceBrightnessResponse._data.mBrightnessPercent = _deviceBrightnessRequest._data.mBrightness_old * 10; // set to old value in case of error + if ( ! checkError(static_cast(vExitCode), _deviceBrightnessResponse, _deviceBrightnessResponse.toString()) ) { // has no error + if (_deviceBrightnessRequest._data.mRead) { + bool ok = false; + int brightness = _processBrightness.readLine().toInt(&ok); + if (ok) { + _deviceBrightnessResponse._data.mBrightnessPercent = brightness * 10; + } + else { + checkError(DeviceError::eScripts_Error_Incorrect_Rsp,_deviceBrightnessResponse, _deviceBrightnessResponse.toString()); + return; + } + } + else { + _deviceBrightnessResponse._data.mBrightnessPercent = _deviceBrightnessRequest._data.mBrightness_val * 10; + _deviceBrightnessResponse._data.mMessage = _deviceBrightnessResponse.toString(); + } + LOG_EVENT(_deviceBrightnessResponse._data.mMessage); + emit didAttributeResponse(_deviceBrightnessResponse._data); } } Index: sources/device/DeviceController.h =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceController.h (.../DeviceController.h) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -73,12 +73,6 @@ DEVICE_DEV_DEFINITION_LIST - const quint8 _brightness_min = 2; - const quint8 _brightness_max = 10; - const quint8 _brightness_res = 2; - quint8 _brightness_old = _brightness_min; - quint8 _brightness_val = 10; - public slots: bool init(); bool init(QThread &vThread); Index: sources/device/DeviceError.cpp =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceError.cpp (.../DeviceError.cpp) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceError.cpp (.../DeviceError.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -31,6 +31,7 @@ QT_TR_NOOP("The request is already in progress."), QT_TR_NOOP("The requested value is out of range."), QT_TR_NOOP("The requested value is incorrect."), + QT_TR_NOOP("The response value is incorrect."), }; /*! Index: sources/device/DeviceError.h =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceError.h (.../DeviceError.h) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceError.h (.../DeviceError.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -46,7 +46,8 @@ eScripts_Error_NotExecutable, eScripts_Error_IsRunning , eScripts_Error_OutOfRange , - eScripts_Error_Incorrect , + eScripts_Error_Incorrect_Req, + eScripts_Error_Incorrect_Rsp, eScripts_Error_End Index: sources/device/DeviceGlobals.h =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -54,6 +54,8 @@ emit vATTRIBUTE##Changed ( v##vATTRIBUTE ); \ } \ } \ + public Q_SLOTS : \ + void doInit##vATTRIBUTEFLC ( ); \ Q_SIGNALS: /*! the signals for property bindings(Changed) and communications */ \ void vATTRIBUTE##Changed (const vTYPE & v##vATTRIBUTE ); \ private : /*! the function is called once the property is set in qml as request */ \ @@ -71,6 +73,8 @@ #define DEVICE_DEV_DEFINITION( vATTRIBUTEFLC ) \ QProcess _process##vATTRIBUTEFLC; \ + Model::MDevice##vATTRIBUTEFLC##Response _device##vATTRIBUTEFLC##Response; \ + Model::MDevice##vATTRIBUTEFLC##Request _device##vATTRIBUTEFLC##Request ; \ Q_SIGNALS : void didAttributeResponse (const Device##vATTRIBUTEFLC##ResponseData &); \ private Q_SLOTS : void onAttributeRequest (const Device##vATTRIBUTEFLC##RequestData &vData); \ private Q_SLOTS : void onProcess##vATTRIBUTEFLC##ExitCode(int vExitCode); \ Index: sources/device/DeviceModels.h =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceModels.h (.../DeviceModels.h) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceModels.h (.../DeviceModels.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -79,16 +79,23 @@ // ------------------------------------------------------------------ - +// TODO : I believe the two model can be merged. They have so much in common. +// On the CANBus it was separated since the type of data in send and receive was totally different. +// But here it's the same. class MDeviceBrightnessRequest : public MDeviceRequestBase { public: + static const quint8 mBrightness_min = 2; + static const quint8 mBrightness_max = 10; + static const quint8 mBrightness_res = 2; struct Data { - quint8 mBrightnessPercent = 100; + quint8 mBrightness_old = mBrightness_min ; + quint8 mBrightness_val = 0; + + quint8 mBrightnessPercent = 100; + bool mRead = false; } _data; - explicit MDeviceBrightnessRequest(const Data &vData) : _data(vData) { } - QString toString() { return MDeviceRequestBase::toString("DeviceBrightness", { _data.mBrightnessPercent }); } Index: sources/device/DeviceView.cpp =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -29,6 +29,13 @@ } // developer implementation section +void VDevice::doInitBrightness() { + // DEBUG : qDebug() << "HERE Request" << vValue; + DeviceBrightnessRequestData data; + data.mRead = true; + emit didAttributeRequest(data); +} + void VDevice::brightnessRequest(const quint8 &vValue) { // DEBUG : qDebug() << "HERE Request" << vValue; DeviceBrightnessRequestData data; Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r61f16c988a159401c92730b4cbfca5085c77222f -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 61f16c988a159401c92730b4cbfca5085c77222f) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -35,6 +35,7 @@ #include "VAdjustmentVersions.h" #include "VDateTime.h" #include "VNetworkModel.h" +#include "VAdjustmentAlarmVolume.h" // states data #include "VHDOperationModeData.h" #include "VPreTreatmentStatesData.h" Index: sources/gui/GuiGlobals.h =================================================================== diff -u -ra89b5249df072be403141463d7d88728b66a848e -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision a89b5249df072be403141463d7d88728b66a848e) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -309,7 +309,8 @@ #include "DGDefs.h" Q_ENUM(DG_Op_Modes) - Q_ENUM(DG_Heat_States) + Q_ENUM(DG_Heat_UI_States) + Q_ENUM(DG_Chem_UI_States) // TODO : temporary enum until DG defines one enum DG_Disinfect_States { @@ -385,7 +386,8 @@ // Disinfection Heat States typedef GuiActions::DG_Disinfect_States GuiDisinfectDGStates; - typedef GuiActions::DG_Heat_States GuiDisinfectDGHeatStates; + typedef GuiActions::DG_Heat_UI_States GuiDisinfectDGHeatStates; + typedef GuiActions::DG_Chem_UI_States GuiDisinfectDGChemicalStates; /*! * \brief enumString Index: sources/gui/qml/dialogs/AlarmListDialog.qml =================================================================== diff -u -r2721daffd0af06accf99ed7c9a1b5a7035f8634f -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision 2721daffd0af06accf99ed7c9a1b5a7035f8634f) +++ sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -126,7 +126,7 @@ bottomMargin : Variables.mainMenuHeight + Variables.minVGap horizontalCenter: parent.horizontalCenter } - width : Variables.dialogWidth - Variables.minVGap2 * 2 // * 2 : for each side + width : Variables.dialogWidth - Variables.minVGap * 2 // * 2 : for each side height : Variables.dialogHeight - Variables.minVGap * 2 - _titleBar.height // * 2 : for each side contentWidth : width contentHeight: _alarmGrid.height @@ -138,14 +138,14 @@ colCount : 1 rowCount : vAlarmActiveList.alarmIDs.length itemHeight : 80 - itemWidth : Variables.dialogWidth - Variables.minVGap2 * (2 + 1) // * 2 : for each side & + 1 to not cover the scrollbar + itemWidth : Variables.dialogWidth - Variables.minVGap * (2 + 1) // * 2 : for each side & the +1 to not cover the scrollbar rowSpacing : 0 columnSpacing : 0 lineColor : Colors.backgroundMain itemsText : vAlarmActiveList.alarmIDs itemsValue : vAlarmActiveList.alarmTexts itemsTouchable : [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ] // just kept one touchable as an example - itemsValueLeftMargin : 100 // if decreased maybe covered by title + itemsValueLeftMargin : 80 // if decreased maybe covered by title itemsUnitLeftMargin : 470 // if increased will be covered by chevron if touchable onItemClicked: _root.itemClicked(vIndex) } Index: sources/gui/qml/main.qml =================================================================== diff -u -r78cf0c96836f3fd612e5871a9f48dbb048bd7e99 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/qml/main.qml (.../main.qml) (revision 78cf0c96836f3fd612e5871a9f48dbb048bd7e99) +++ sources/gui/qml/main.qml (.../main.qml) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -32,6 +32,7 @@ import VAdjustmentVersions 0.1 import VDateTime 0.1 import VNetworkModel 0.1 +import VAdjustmentAlarmVolume 0.1 // States views import VHDOperationMode 0.1 @@ -117,6 +118,7 @@ VAdjustmentVersions { id: vAdjustmentVersions } VDateTime { id: vDateTime } VNetworkModel { id: vNetwork } + VAdjustmentAlarmVolume { id: vAdjustmentAlarmVolume } // ---- States VHDOperationMode { id: vHDOperationMode } VPreTreatmentStates { id: vPreTreatmentStates } Index: sources/gui/qml/pages/disinfect/DisinfectStack.qml =================================================================== diff -u -rf93fd4a2a09a2c6d4db43196b9005f324ae7fa82 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/qml/pages/disinfect/DisinfectStack.qml (.../DisinfectStack.qml) (revision f93fd4a2a09a2c6d4db43196b9005f324ae7fa82) +++ sources/gui/qml/pages/disinfect/DisinfectStack.qml (.../DisinfectStack.qml) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -96,7 +96,7 @@ timeCircleTimeTextValue : vDisinfectDGData.heatTimeRemaining * 60 hasCheckList : true - isComplete : vDisinfectStates.complete + isComplete : vDisinfectStates.heatComplete completeText : qsTr("Heat Disinfection Complete!") checkListStepNames : [ qsTr("Pre-Disinfect Flush" ), @@ -127,38 +127,36 @@ timeCircleTimeTextValue : vDisinfectDGData.chemicalTimeRemaining * 60 hasCheckList : true + isComplete : vDisinfectStates.chemicalComplete + completeText : qsTr("Chemical Disinfection Complete!") checkListStepNames : [ - qsTr("Running Pre-Disinfect Flush" ), - qsTr("Running Chemical Disinfect" ), - qsTr("Running Post-Disinfect Flush" ), + qsTr("Pre-Disinfect Flush" ), + qsTr("Mix Water And Acid" ), + qsTr("Remove Acid" ), + qsTr("Chemical Disinfect" ), + qsTr("Post-Disinfect Flush" ), ] } // ----- Checkmarks Connections { target: vDisinfectStates - onStartEntered : {} - onDrainR1Entered : { _disinfectHeat .checkList.setItem(0, true )} - onDrainR2Entered : {} - onFlushDrainEntered : {} - onFlushCirculationEntered : {} - onFlushR1R2Entered : {} - onFlushR2DrainR1Entered : {} - onFlushDrainR2Entered : {} - onFlushDrainR1Entered : { _disinfectHeat .checkList.setItem(0, vflushDrainR1 )} - onFillWithWaterEntered : { _disinfectHeat .checkList.setItem(1, true )} - onDisinfectR1R2Entered : {} - onFillR2WithHotWaterEntered : { _disinfectHeat .checkList.setItem(1, vfillR2WithHotWater )} - onDisinfectR2R1Entered : { _disinfectHeat .checkList.setItem(2, vdisinfectR2R1 )} - onCooldownHeatersEntered : { _disinfectHeat .checkList.setItem(3, true )} - onCooldownRoFilterEntered : { _disinfectHeat .checkList.setItem(3, vcooldownRoFilter )} - onMixDrainR1Entered : { _disinfectHeat .checkList.setItem(4, true )} - onMixDrainR2Entered : {} - onRinseR1ToR2Entered : {} - onRinseR2ToR1DrainR1Entered : {} - onRinseCirculationEntered : { _disinfectHeat .checkList.setItem(4, vrinseCirculation )} - onCancelBasicPathEntered : {} - onCancelWaterPathEntered : {} - onCompleteEntered : {} + onHeatNotRunningEntered : { } + onHeatFlushBeforeDisinfectEntered : { _disinfectHeat .checkList.setItem(0, vheatFlushBeforeDisinfect )} + onHeatWaterHeatUpEntered : { _disinfectHeat .checkList.setItem(1, vheatWaterHeatUp )} + onHeatDisinfectEntered : { _disinfectHeat .checkList.setItem(2, vheatDisinfect )} + onHeatDeviceCoolDownEntered : { _disinfectHeat .checkList.setItem(3, vheatDeviceCoolDown )} + onHeatFlushAfterDisinfectEntered : { _disinfectHeat .checkList.setItem(4, vheatFlushAfterDisinfect )} + onHeatCancelEntered : { } + onHeatCompleteEntered : { } + + onChemicalNotRunningEntered : { } + onChemicalFlushBeforeDisinfectEntered : { _disinfectChemicalProgress .checkList.setItem(0, vchemicalFlushBeforeDisinfect )} + onChemicalMixWaterAndAcidEntered : { _disinfectChemicalProgress .checkList.setItem(1, vchemicalMixWaterAndAcid )} + onChemicalRemoveAcidEntered : { _disinfectChemicalProgress .checkList.setItem(2, vchemicalRemoveAcid )} + onChemicalDisinfectEntered : { _disinfectChemicalProgress .checkList.setItem(3, vchemicalDisinfect )} + onChemicalFlushAfterDisinfectEntered : { _disinfectChemicalProgress .checkList.setItem(4, vchemicalFlushAfterDisinfect )} + onChemicalCancelEntered : { } + onChemicalCompleteEntered : { } } // ----- Commands onDisinfectSkip : { vDisinfectAdjustDisinfect .doFlush ( )} Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -155,6 +155,7 @@ break case SettingsStack.VolumeBrightness: + vDevice.doInitBrightness() push(_settingsVolumeBrightness) break Index: sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml (.../SettingsVolumeBrightness.qml) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml (.../SettingsVolumeBrightness.qml) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -30,8 +30,11 @@ SettingsBase { id: _root readonly property int spacing: 50 - notificationText: vDevice.status + confirmVisible : false + notificationText: "" + + Column { spacing : _root.spacing anchors.centerIn: parent @@ -48,18 +51,16 @@ width : 500 step : 20 // no zero minimum : 20 // 1 - maximum : 100 // 5 + maximum : 100 // 10 height : 5 ticks : true unit : qsTr("%") onReleased : vDevice.brightness = _brightness.value Connections { target: vDevice // in case the value is rejecte it will be set to the previous value // also the init value shall be set when navigate to the screen - onBrightnessChanged: { - console.log(_brightness.value, vDevice.brightness) - _brightness.value = vDevice.brightness - } + onBrightnessChanged : _brightness.value = vbrightness + onStatusChanged : _root.notificationText = vstatus } } Label { @@ -68,6 +69,7 @@ text : vDevice.brightness + _brightness.unit } } + Row { spacing : _root.spacing anchors.horizontalCenter: parent.horizontalCenter @@ -85,14 +87,23 @@ height : 5 ticks : true unit : qsTr("%") + onReleased : vAdjustmentAlarmVolume.doAdjustment( _alarmVolume.value ) + Connections { target: vAdjustmentAlarmVolume + // in case the value is rejecte it will be set to the previous value + // also the init value shall be set when navigate to the screen + onHdAlarmVolumeChanged : _alarmVolume.value = vAdjustmentAlarmVolume.hdAlarmVolume + onStatusChanged : _root.notificationText = vstatus + } } Label { anchors.verticalCenter: parent.verticalCenter width : 100 - text : "0" + _alarmVolume.unit + text : vAdjustmentAlarmVolume.hdAlarmVolume + _alarmVolume.unit } } + Row { + visible : false spacing : _root.spacing anchors.horizontalCenter: parent.horizontalCenter Label { Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 06-Jun-2021 + * \date (last) 07-Jun-2021 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * Index: sources/view/VView.h =================================================================== diff -u -r61f16c988a159401c92730b4cbfca5085c77222f -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/view/VView.h (.../VView.h) (revision 61f16c988a159401c92730b4cbfca5085c77222f) +++ sources/view/VView.h (.../VView.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -108,6 +108,7 @@ REGISTER_TYPE( VAdjustmentVersions ) \ REGISTER_TYPE( VDateTime ) \ REGISTER_TYPE( VNetworkModel ) \ + REGISTER_TYPE( VAdjustmentAlarmVolume ) \ /* Alarm */ \ REGISTER_TYPE( VAlarmStatus ) \ REGISTER_TYPE( VAlarmActiveList ) \ Index: sources/view/dg/data/disinfect/VDisinfectStatesData.cpp =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/view/dg/data/disinfect/VDisinfectStatesData.cpp (.../VDisinfectStatesData.cpp) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/view/dg/data/disinfect/VDisinfectStatesData.cpp (.../VDisinfectStatesData.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -27,51 +27,43 @@ */ void VDisinfectStates::onActionReceive(const DisinfectStatesData &vData) { - subMode ( vData.mSubMode ); - flushState ( vData.mFlushStates ); - heatState ( vData.mHeatStates ); - chemicalState ( vData.mChemicalStates ); + subMode ( vData.mSubMode ); + flushState ( vData.mFlushStates ); + heatState ( vData.mHeatStates ); + chemicalState ( vData.mChemicalStates ); // Flush Mode - bool mFlush = vData.mSubMode == GuiDisinfectDGStates ::DG_DISINFECT_STATE_FLUSH ; + bool mFlush = vData.mSubMode == GuiDisinfectDGStates ::DG_DISINFECT_STATE_FLUSH ; if ( mFlush ) { /* No FW implementation yet */ } flush( mFlush ); // Heat Mode - bool mHeat = vData.mSubMode == GuiDisinfectDGStates ::DG_DISINFECT_STATE_HEAT ; + bool mHeat = vData.mSubMode == GuiDisinfectDGStates ::DG_DISINFECT_STATE_HEAT ; if ( mHeat ) { - start ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_START ); - drainR1 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_DRAIN_R1 ); - drainR2 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_DRAIN_R2 ); - flushDrain ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN ); - flushCirculation ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FLUSH_CIRCULATION ); - flushR1R2 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FLUSH_R1_AND_R2 ); - flushR2DrainR1 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FLUSH_R2_AND_DRAIN_R1 ); - flushDrainR2 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R2 ); - flushDrainR1 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R1 ); - fillWithWater ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FILL_WITH_WATER ); - disinfectR1R2 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2 ); - fillR2WithHotWater ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_FILL_R2_WITH_HOT_WATER ); - disinfectR2R1 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1 ); - cooldownHeaters ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_COOL_DOWN_HEATERS ); - cooldownRoFilter ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER ); - mixDrainR1 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R1 ); - mixDrainR2 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R2 ); - rinseR1ToR2 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_RINSE_R1_TO_R2 ); - rinseR2ToR1DrainR1 ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_RINSE_R2_TO_R1_AND_DRAIN_R1 ); - rinseCirculation ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_RINSE_CIRCULATION ); - cancelBasicPath ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH ); - cancelWaterPath ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH ); - complete ( vData.mHeatStates == GuiDisinfectDGHeatStates ::DG_HEAT_DISINFECT_STATE_COMPLETE ); + heatNotRunning ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_NOT_RUNNING ); + heatFlushBeforeDisinfect ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT ); + heatWaterHeatUp ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_HEAT_UP_WATER ); + heatDisinfect ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_DISINFECT_DEVICE ); + heatDeviceCoolDown ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_COOL_DOWN_DEVICE ); + heatFlushAfterDisinfect ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT ); + heatCancel ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_CANCEL_DISINFECT ); + heatComplete ( vData.mHeatStates == GuiDisinfectDGHeatStates ::HEAT_DISINFECT_UI_STATE_COMPLETE ); } heat( mHeat ); // Chemical Mode - bool mChemical = vData.mSubMode == GuiDisinfectDGStates ::DG_DISINFECT_STATE_CHEM ; + bool mChemical = vData.mSubMode == GuiDisinfectDGStates ::DG_DISINFECT_STATE_CHEM ; if ( mChemical ) { - /* No FW implementation yet */ + chemicalNotRunning ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_NOT_RUNNING ); + chemicalFlushBeforeDisinfect ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT ); + chemicalMixWaterAndAcid ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_MIX_WATER_AND_ACID ); + chemicalRemoveAcid ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_REMOVE_ACID ); + chemicalDisinfect ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_DISINFECT_DEVICE ); + chemicalFlushAfterDisinfect ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT ); + chemicalCancel ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_CANCEL_DISINFECT ); + chemicalComplete ( vData.mChemicalStates == GuiDisinfectDGChemicalStates ::CHEM_DISINFECT_UI_STATE_COMPLETE ); } chemical( mChemical ); Index: sources/view/dg/data/disinfect/VDisinfectStatesData.h =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/view/dg/data/disinfect/VDisinfectStatesData.h (.../VDisinfectStatesData.h) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/view/dg/data/disinfect/VDisinfectStatesData.h (.../VDisinfectStatesData.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -51,30 +51,24 @@ PROPERTY( bool , chemical , false ) ///< /* No FW enumeration yet */ // Heat disinfection state - STATE ( bool , start , false ) ///< DG_HEAT_DISINFECT_STATE_START , Heat disinfect, start mode state - STATE ( bool , drainR1 , false ) ///< DG_HEAT_DISINFECT_STATE_DRAIN_R1 , Heat disinfect, drain R1 state - STATE ( bool , drainR2 , false ) ///< DG_HEAT_DISINFECT_STATE_DRAIN_R2 , Heat disinfect, drain R2 state - STATE ( bool , flushDrain , false ) ///< DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN , Heat disinfect, flush drain state - STATE ( bool , flushCirculation , false ) ///< DG_HEAT_DISINFECT_STATE_FLUSH_CIRCULATION , Heat disinfect, flush circulation state - STATE ( bool , flushR1R2 , false ) ///< DG_HEAT_DISINFECT_STATE_FLUSH_R1_AND_R2 , Heat disinfect, flush R1 and R2 state - STATE ( bool , flushR2DrainR1 , false ) ///< DG_HEAT_DISINFECT_STATE_FLUSH_R2_AND_DRAIN_R1 , Heat disinfect, flush R2 and drain R1 state - STATE ( bool , flushDrainR2 , false ) ///< DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R2 , Heat disinfect, flush drain R2 state - STATE ( bool , flushDrainR1 , false ) ///< DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R1 , Heat disinfect, flush drain R1 state - STATE ( bool , fillWithWater , false ) ///< DG_HEAT_DISINFECT_STATE_FILL_WITH_WATER , Heat disinfect, fill with water state - STATE ( bool , disinfectR1R2 , false ) ///< DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2 , Heat disinfect, disinfect R1 to R2 state - STATE ( bool , fillR2WithHotWater , false ) ///< DG_HEAT_DISINFECT_STATE_FILL_R2_WITH_HOT_WATER , Heat disinfect, fill R2 with hot water state - STATE ( bool , disinfectR2R1 , false ) ///< DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1 , Heat disinfect, disinfect R2 to R1 state - STATE ( bool , cooldownHeaters , false ) ///< DG_HEAT_DISINFECT_STATE_COOL_DOWN_HEATERS , Heat disinfect, cool down heaters state - STATE ( bool , cooldownRoFilter , false ) ///< DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER , Heat disinfect, cool down RO filter state - STATE ( bool , mixDrainR1 , false ) ///< DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R1 , Heat disinfect, mix drain R1 state - STATE ( bool , mixDrainR2 , false ) ///< DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R2 , Heat disinfect, mix drain R2 state - STATE ( bool , rinseR1ToR2 , false ) ///< DG_HEAT_DISINFECT_STATE_RINSE_R1_TO_R2 , Heat disinfect, rinse R1 to R2 state - STATE ( bool , rinseR2ToR1DrainR1 , false ) ///< DG_HEAT_DISINFECT_STATE_RINSE_R2_TO_R1_AND_DRAIN_R1 , Heat disinfect, rinse R2 to R1 and drain R1 state - STATE ( bool , rinseCirculation , false ) ///< DG_HEAT_DISINFECT_STATE_RINSE_CIRCULATION , Heat disinfect, rinse circulation state - STATE ( bool , cancelBasicPath , false ) ///< DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH , Heat disinfect, cancel mode basic path state - STATE ( bool , cancelWaterPath , false ) ///< DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH , Heat disinfect, cancel mode water path state - STATE ( bool , complete , false ) ///< DG_HEAT_DISINFECT_STATE_COMPLETE , Heat disinfect, complete state + STATE ( bool , heatNotRunning , false ) ///< HEAT_DISINFECT_UI_STATE_NOT_RUNNING , Heat disinfect UI, not running state + STATE ( bool , heatFlushBeforeDisinfect , false ) ///< HEAT_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT , Heat disinfect UI, flush before disinfect state + STATE ( bool , heatWaterHeatUp , false ) ///< HEAT_DISINFECT_UI_STATE_HEAT_UP_WATER , Heat disinfect UI, heat up water state + STATE ( bool , heatDisinfect , false ) ///< HEAT_DISINFECT_UI_STATE_DISINFECT_DEVICE , Heat disinfect UI, disinfect device state + STATE ( bool , heatDeviceCoolDown , false ) ///< HEAT_DISINFECT_UI_STATE_COOL_DOWN_DEVICE , Heat disinfect UI, cool down device state + STATE ( bool , heatFlushAfterDisinfect , false ) ///< HEAT_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT , Heat disinfect UI, flush after disinfect state + STATE ( bool , heatCancel , false ) ///< HEAT_DISINFECT_UI_STATE_CANCEL_DISINFECT , Heat disinfect UI, cancel disinfect state + STATE ( bool , heatComplete , false ) ///< HEAT_DISINFECT_UI_STATE_COMPLETE , Heat disinfect UI, complete state + STATE ( bool , chemicalNotRunning , false ) ///< CHEM_DISINFECT_UI_STATE_NOT_RUNNING , Chemical disinfect UI, not running state + STATE ( bool , chemicalFlushBeforeDisinfect , false ) ///< CHEM_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT , Chemical disinfect UI, flush before disinfect state + STATE ( bool , chemicalMixWaterAndAcid , false ) ///< CHEM_DISINFECT_UI_STATE_MIX_WATER_AND_ACID , Chemical disinfect UI, mix water and acid state + STATE ( bool , chemicalRemoveAcid , false ) ///< CHEM_DISINFECT_UI_STATE_REMOVE_ACID , Chemical disinfect UI, remove acid state + STATE ( bool , chemicalDisinfect , false ) ///< CHEM_DISINFECT_UI_STATE_DISINFECT_DEVICE , Chemical disinfect UI, disinfect device state + STATE ( bool , chemicalFlushAfterDisinfect , false ) ///< CHEM_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT , Chemical disinfect UI, flush after disinfect state + STATE ( bool , chemicalCancel , false ) ///< CHEM_DISINFECT_UI_STATE_CANCEL_DISINFECT , Chemical disinfect UI, cancel disinfect state + STATE ( bool , chemicalComplete , false ) ///< CHEM_DISINFECT_UI_STATE_COMPLETE , Chemical disinfect UI, complete state + VIEW_DEC(VDisinfectStates, DisinfectStatesData) }; } Index: sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp =================================================================== diff -u -re125bd5cf13750eaf241d518b9c846139afaa81c -rf38edd22f7b63694c21b83d6f4b69ea618390126 --- sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp (.../VDisinfectAdjustDisinfect.cpp) (revision e125bd5cf13750eaf241d518b9c846139afaa81c) +++ sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp (.../VDisinfectAdjustDisinfect.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -19,8 +19,9 @@ VIEW_DEF_CLASS_ADJUSTMENT(VDisinfectAdjustDisinfect) -/*! \brief Connection Initializer - \details All the class signal/slot connections are defined here. +/*! + * \brief Connection Initializer + * \details All the class signal/slot connections are defined here. */ void View::VDisinfectAdjustDisinfect::initConnections() { ADJUST_VIEW_CONNECTION(AdjustDisinfectRequestData); Index: sources/view/settings/VAdjustmentAlarmVolume.cpp =================================================================== diff -u --- sources/view/settings/VAdjustmentAlarmVolume.cpp (revision 0) +++ sources/view/settings/VAdjustmentAlarmVolume.cpp (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -0,0 +1,63 @@ +/*! + * + * Copyright (c) 2019-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 VAdjustmentAlarmVolume.h + * \author (last) Behrouz NematiPour + * \date (last) 06-Jun-2021 + * \author (original) Behrouz NematiPour + * \date (original) 06-Jun-2021 + * + */ +#include "VAdjustmentAlarmVolume.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VAdjustmentAlarmVolume) + +/*! + * \brief Connection Initializer + * \details All the class signal/slot connections are defined here. +*/ +void View::VAdjustmentAlarmVolume::initConnections() { + ADJUST_VIEW_CONNECTION(AdjustHDAlarmVolumeRequestData ); + ACTION_VIEW_CONNECTION(AdjustHDAlarmVolumeResponseData ); +} + +void View::VAdjustmentAlarmVolume::onActionReceive(const AdjustHDAlarmVolumeResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + // TODO : Value + // in the correct/standard design (like all the other MVCs) there should always be the FW preferred (or old value) for the requested value to change. + // a line like : hdAlarmVolume( vData.volume ); // please give attention to the vData(received) instead of _data(private). + // but is has not been provided !!! + // at this moment the only thing that can be done is to use _data.volume(accepted)/_hdAlarmVolume(rejected) to revert back to the old private value the view has. + // Please notice that it works but we are just predicting what the FW has and the GUI is totally agnostic about the FW current value, + // so we get easily out of sync with FW. + if (vData.mAccepted) { + hdAlarmVolume( _data.volume ); + status(""); + } + else { + hdAlarmVolumeChanged(_hdAlarmVolume); + // TODO : Rejection Reason (status) + // Same thing which has been done for the alarmMapping has to be done for the Reason returning by each response. + status(tr("The alarm volume change request has been rejected [%1]").arg(vData.mReason)); + } + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the previous values before being set. *** + adjustment(true); +} + +void View::VAdjustmentAlarmVolume::doAdjustment(quint8 vVolume) +{ + _data.volume = vVolume; + emit didAdjustment(_data); +} Index: sources/view/settings/VAdjustmentAlarmVolume.h =================================================================== diff -u --- sources/view/settings/VAdjustmentAlarmVolume.h (revision 0) +++ sources/view/settings/VAdjustmentAlarmVolume.h (revision f38edd22f7b63694c21b83d6f4b69ea618390126) @@ -0,0 +1,67 @@ +/*! + * + * Copyright (c) 2019-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 VAdjustmentAlarmVolume.h + * \author (last) Behrouz NematiPour + * \date (last) 06-Jun-2021 + * \author (original) Behrouz NematiPour + * \date (original) 06-Jun-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : don't remove +#include "VAdjustmentResponseBase.h" +#include "MAdjustHDRequests.h" +#include "MAdjustHDAlarmVolumeResponse.h" + +namespace View { + +/*! + * \brief The VAdjustmentAlarmVolume class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustAlarmVolumeResponse + * + */ +class VAdjustmentAlarmVolume : public VAdjustmentResponseBase { + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustHDAlarmVolumeRequestData _data; + + // coco begin validated: + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + // has been manually tested that it works perfectly fine + TRIGGER( bool , adjustment , 0) + // coco end + + // HD AlarmVolume data + PROPERTY( quint8 , hdAlarmVolume , 0) + PROPERTY( QString , status , "") + + VIEW_DEC_CLASS_ADJUSTMENT(VAdjustmentAlarmVolume, AdjustHDAlarmVolumeResponseData) + +// ---------- Alarm Volume +public slots: + void doAdjustment(quint8 vVolume); + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to send the user's Request + * \param vData - data model includes request information + */ + void didAdjustment(const AdjustHDAlarmVolumeRequestData &vData); +}; +}