/*! * * 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 * * \startuml * actor User as US * participant UI as UI * participant DG as DG * participant FS as FS * * == REQUEST == * group DG POST * DG -> UI : Water Input Mode Status [0xC3] * UI -> DG : Water Mode Set [0xBC] * end * * group UI POST * UI -> DG : Water Mode Set [0xBC] * end * * group Settings * US -> UI : Water Input Mode Adjust * UI -> DG : Water Mode Set [0xBC] * end * * == RESPONSE == * * DG --> UI : Water Mode Set [0xC4] * alt Accept * UI -> FS : Water Mode Store * UI -> US : Pass Notification * else Reject * UI -> UI : Revert the Water Mode * UI -> US : Fail Notification * end * \enduml * \note UI Init update sequence: * Settings -> status -> checked -> doAdjustment -> DG */ 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); }; }