/*! * * Copyright (c) 2023-2024 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 VAdjustmentDGCleaningUsage.cpp * \author (last) Behrouz NematiPour * \date (last) 28-May-2023 * \author (original) Behrouz NematiPour * \date (original) 27-May-2023 * */ #include "VAdjustmentDGCleaningUsage.h" // Project #include "GuiController.h" #include "format.h" VIEW_DEF_CLASS_ADJUSTMENT(VAdjustDGCleaningUsage) void View::VAdjustDGCleaningUsage::initConnections() { ADJUST_VIEW_CONNECTION( AdjustDGCleaningUsageRequestData) ACTION_VIEW_CONNECTION(AdjustDGCleaningUsageResponseData) ACTION_VIEW_CONNECTION(SettingsData) } void View::VAdjustDGCleaningUsage::onActionReceive(const AdjustDGCleaningUsageResponseData &vData) { // DG Cleaning Usage roWaterGenTotalL ( vData.mRoWaterGenTotalL ); roWaterGenSinceLastServiceL ( vData.mRoWaterGenSinceLastServiceL ); lastBasicFlushCompleteDate ( Format::fromEpoch(vData.mLastBasicFlushCompleteDateEpoch , _dateFormat )); lastChemDisStartDate ( Format::fromEpoch(vData.mLastChemDisStartDateEpoch , _dateFormat )); lastChemDisCompleteDate ( Format::fromEpoch(vData.mLastChemDisCompleteDateEpoch , _dateFormat )); lastChemDisFlushCompleteDate ( Format::fromEpoch(vData.mLastChemDisFlushCompleteDateEpoch , _dateFormat )); lastHeatDisCompleteDate ( Format::fromEpoch(vData.mLastHeatDisCompleteDateEpoch , _dateFormat )); lastHeatActiveCoolCompleteDate ( Format::fromEpoch(vData.mLastHeatActiveCoolCompleteDateEpoch , _dateFormat )); lastFilterFlushCompleteDate ( Format::fromEpoch(vData.mLastFilterFlushCompleteDateEpoch , _dateFormat )); lastBasicFlushCompleteTime ( Format::fromEpoch(vData.mLastBasicFlushCompleteDateEpoch , _timeFormat )); lastChemDisStartTime ( Format::fromEpoch(vData.mLastChemDisStartDateEpoch , _timeFormat )); lastChemDisCompleteTime ( Format::fromEpoch(vData.mLastChemDisCompleteDateEpoch , _timeFormat )); lastChemDisFlushCompleteTime ( Format::fromEpoch(vData.mLastChemDisFlushCompleteDateEpoch , _timeFormat )); lastHeatDisCompleteTime ( Format::fromEpoch(vData.mLastHeatDisCompleteDateEpoch , _timeFormat )); lastHeatActiveCoolCompleteTime ( Format::fromEpoch(vData.mLastHeatActiveCoolCompleteDateEpoch , _timeFormat )); lastFilterFlushCompleteTime ( Format::fromEpoch(vData.mLastFilterFlushCompleteDateEpoch , _timeFormat )); lastResetTime ( Format::fromEpoch(vData.mLastResetTimeEpoch , _dateFormat + " " +_timeFormat)); // *** 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); // set here only because adjustment parent needs it, but HD Service does not } void View::VAdjustDGCleaningUsage::onActionReceive(const SettingsData &) { _dateFormat = _Settings.dateFormat(); _timeFormat = _Settings.timeFormat(); }