/*! * * Copyright (c) 2019-2020 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 VAdjustmentService.cpp * \author (last) Peman Montazemi * \date (last) 6-Nov-2020 * \author (original) Peman Montazemi * \date (original) 6-Nov-2020 * */ #include "VAdjustmentService.h" // Project #include "GuiController.h" #include "format.h" VIEW_DEF_CLASS_ADJUSTMENT(VAdjustmentService) void View::VAdjustmentService::initConnections() { ADJUST_VIEW_CONNECTION( AdjustServiceRequestData); ACTION_VIEW_CONNECTION(AdjustServiceHDResponseData); ACTION_VIEW_CONNECTION(AdjustServiceDGResponseData); } void View::VAdjustmentService::onActionReceive(const AdjustServiceHDResponseData &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::VAdjustmentService::onActionReceive(const AdjustServiceDGResponseData &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 }