Index: sources/view/hd/data/VHDOperationModeData.cpp =================================================================== diff -u -r65558208e4968de9a5470ff5fda1ee2a9d00c793 -r1da89b0452b8ef9448847618e75c118f3f58bd0c --- sources/view/hd/data/VHDOperationModeData.cpp (.../VHDOperationModeData.cpp) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) +++ sources/view/hd/data/VHDOperationModeData.cpp (.../VHDOperationModeData.cpp) (revision 1da89b0452b8ef9448847618e75c118f3f58bd0c) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-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 VHDOperationModeData.cpp * \author (last) Behrouz NematiPour - * \date (last) 19-Apr-2021 + * \date (last) 28-Sep-2022 * \author (original) Behrouz NematiPour - * \date (original) 19-Apr-2021 + * \date (original) 13-Aug-2020 * */ #include "VHDOperationModeData.h" @@ -38,20 +38,21 @@ standbyStart ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_START_STATE ); standbyWaitTreatment ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_WAIT_FOR_TREATMENT_STATE ); standbyWaitDisinfect ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_WAIT_FOR_DISINFECT_STATE ); - standbyDGFlush ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_DG_FLUSH_IN_PROGRESS_STATE ); - standbyDGDisinfectHeat ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_DG_HEAT_DISINFECT_IN_PROGRESS_STATE ); - standbyDGDisinfectChemical ( vData.mSubMode == GuiHDStandbyStates ::STANDBY_DG_CHEM_DISINFECT_IN_PROGRESS_STATE ); } + // isTreatment ( ! _service ); // if enabled goes to home, fault from service, which shouldn't since the service is dead end. Maybe later investigate more when fault enabled. + isSettings ( _service ); + // isManager ( false ); // Always false, not used/implemented for now. + // Go to home is kind of tricky and needs to be managed here in the backend. // It seems we need more states. // It can be handled in the QML but two things will happen that none of which are good. - // Problem : The issue is for example FW may changed the opMode state to TPAR <=> INIT but during that subMode is not changing. - // and when it comes back to the opMode Init again only opMode is changing which is not enough, - // because we still need to know when we are in INIT what subMode of INIT we need to be in - // and because that doesn't change QML since FW change opMode INIT <=> TPAR then UI is doing nothing. + // Problem : The issue is for example FW may change the opMode state to TPAR <=> STAN but during that, subMode is not changing. + // and when it comes back to the opMode STAN again only opMode is changing which is not enough, + // because we still need to know when we are in STAN what subMode of STAN we need to be in + // and because that does not change QML, since FW change opMode STAN <=> TPAR then UI is doing nothing. // The solutions on QML side are: - // 1 - On each standby change INIT <=> TPAR which is not good because if in INIT we need to the go to the anything other than Start/waitTreatment. + // 1 - On each standby change STAN <=> TPAR which is not good because if in STAN we need to go to anything other than Start/waitTreatment. // Issue : But then the home screen would jump. // 2 - And we can also check that if subMode is Start/WaitTreatment go to home in QML. // 3 - Make the sub PROPERTY as TRIGGER and if standby is true trigger them. @@ -60,7 +61,12 @@ // Final Solution: # - The solution though is to have a special state in backend C++ that checks if opMode is standby and subMode is state/waitTreatment // and if these conditions changed since the last time then signal emits. // Brief : *** So actually we have a mixed condition property *** - home ( _standby && ( _standbyStart || _standbyWaitTreatment ) ); + home ( _standby && + ( // op_mode of standby is a must for the home screen + ( _standbyStart || _standbyWaitTreatment ) // actual standby and ready to start a treatment + // disinfection state but getting to home screen to do what allowed in disinfection + ) + ); } QString View::VHDOperationMode::text()