/*! * * 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 VHDUsageInfo.cpp * \author (last) Behrouz NematiPour * \date (last) 11-Sep-2023 * \author (original) Vy * \date (original) 08-Sep-2023 * */ #include "VHDUsageInfo.h" // Project #include "GuiController.h" #include "format.h" VIEW_DEF_CLASS_ADJUSTMENT(VHDUsageInfo) void View::VHDUsageInfo::initConnections() { ADJUST_VIEW_CONNECTION( HDUsageInfoRequestData) ACTION_VIEW_CONNECTION(HDUsageInfoResponseData) ACTION_VIEW_CONNECTION(SettingsData) } /*! * \brief VHDUsageInfo::onActionReceive * \details received response model data handler * \param vData - model data */ void View::VHDUsageInfo::onActionReceive(const HDUsageInfoResponseData &vData) { QString timeFormatted = QString("%1").arg(vData.mTotalTxHours); totalTxHours(timeFormatted); timeFormatted = QString("%1").arg(vData.mTotalTxHoursSinceLastService); totalTxHoursSinceLastService(timeFormatted); epochOfStartOfLastTx (Format::fromEpoch(vData.mEpochOfStartOfLastTx, _dateFormat)); // *** 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 ); } void View::VHDUsageInfo::onActionReceive(const SettingsData &) { _dateFormat = _Settings.dateFormat(); }