/*! * * Copyright (c) 2022-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 VAdjustmentServiceDates.cpp * \author (last) Behrouz NematiPour * \date (last) 01-Jun-2022 * \author (original) Behrouz NematiPour * \date (original) 01-Jun-2022 * */ #include "VAdjustmentServiceDates.h" // Project #include "GuiController.h" #include "format.h" VIEW_DEF_CLASS_ADJUSTMENT(VAdjustmentServiceDates) void View::VAdjustmentServiceDates::initConnections() { ADJUST_VIEW_CONNECTION( AdjustServiceDatesRequestData) ACTION_VIEW_CONNECTION(AdjustServiceDatesHDResponseData) ACTION_VIEW_CONNECTION(AdjustServiceDatesDGResponseData) } void View::VAdjustmentServiceDates::onActionReceive(const AdjustServiceDatesHDResponseData &vData) { // HD Service data hdLastServiceEpoch (vData.mLastServiceDateEpoch ); hdServiceInterval (vData.mServiceIntervalSeconds ); hdLastServiceDate (Format::fromEpoch(vData.mLastServiceDateEpoch , _serviceDateFormat)); hdNextServiceDate (Format::fromEpoch(vData.mLastServiceDateEpoch + vData.mServiceIntervalSeconds , _serviceDateFormat)); // *** 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. *** adjustmentHD(true); // set here only because adjustment parent needs it, but HD Service does not } void View::VAdjustmentServiceDates::onActionReceive(const AdjustServiceDatesDGResponseData &vData) { // DG Service data dgLastServiceEpoch (vData.mLastServiceDateEpoch ); dgServiceInterval (vData.mServiceIntervalSeconds ); dgLastServiceDate (Format::fromEpoch(vData.mLastServiceDateEpoch , _serviceDateFormat)); dgNextServiceDate (Format::fromEpoch(vData.mLastServiceDateEpoch + vData.mServiceIntervalSeconds , _serviceDateFormat)); // *** 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. *** adjustmentDG(true); // set here only because adjustment parent needs it, but HD Service does not }