/*! * * Copyright (c) 2021-2023 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 VDuetRoWaterDG.h * \author (last) Behrouz NematiPour * \date (last) 10-Aug-2021 * \author (original) Behrouz NematiPour * \date (original) 18-Apr-2021 * */ #pragma once // Qt #include // Project #include "main.h" // Doxygen : do not remove #include "VAdjustmentResponseBase.h" #include "MDuetRoWaterDG.h" #include "MSettings.h" // namespace namespace View { /*! * \brief The VTreatmentTime class * \details View for Model's data representation. * * \sa Model::MTreatmentTime * * \link http://www.plantuml.com/ \startuml actor User as US participant UI as UI participant DG as DG participant FS as FS group POST group UI POST FS -> UI : Water Mode Store UI -> UI : Update Settings UI -> DG : Water Mode Set [0xBC] DG --> UI : Water Mode Set [0xC4] end group DG POST DG -> UI : Water Mode Status [0xC3] UI -> DG : Water Mode Set [0xBC] DG --> UI : Water Mode Set [0xC4] end alt Accept UI -> US : Pass Notification [empty] else Reject UI -> UI : Toggle Water Mode UI -> FS : Water Mode Store UI -> US : Fail Notification end end group Settings US -> UI : "New" Water Mode [Toggled] UI -> DG : Water Mode Set [0xBC] DG --> UI : Water Mode Set [0xC4] alt Accept UI -> FS : "New" Water Mode Store UI -> US : Pass Notification [empty] else Reject UI -> UI : "Old" Water Mode [NonToggled] UI -> US : Fail Notification end end \enduml */ class VDuetRoWaterDG : public VAdjustmentResponseBase { Q_OBJECT DuetRoWaterModeUIiData _data; bool _post = true; // 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) TRIGGER ( bool , status , 0) PROPERTY( QString , notification , 0) VIEW_DEC_CLASS(VDuetRoWaterDG) VIEW_DEC_SLOT(DuetRoWaterStatDGqData) VIEW_DEC_SLOT(DuetRoWaterModeDGrData) VIEW_DEC_SLOT(SettingsData) public slots: void doAdjustment(bool vStatus); signals: /*! * \brief didAdjustment * \details the notification signal to send the user's Request * \param vData - data model includes request information */ void didAdjustment(const DuetRoWaterModeUIiData &vData); }; }