/*! * * Copyright (c) 2021-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 VTreatmentAdjustmentUltrafiltrationConfirm.cpp * \author (last) Behrouz NematiPour * \date (last) 11-Apr-2021 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * */ #include "VTreatmentAdjustmentUltrafiltrationConfirm.h" // Project #include "GuiController.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationConfirm) /*! \brief Connection Initializer \details All the class signal/slot connections are defined here. */ void VTreatmentAdjustmentUltrafiltrationConfirm::initConnections() { ACTION_VIEW_CONNECTION(AdjustUltrafiltrationConfirmResponseData); ADJUST_VIEW_CONNECTION( AdjustUltrafiltrationConfirmRequestData); } /*! * \brief VTreatmentAdjustmentUltrafiltrationEdit::onActionReceive * \details received response model data handler * \param vData - model data */ void VTreatmentAdjustmentUltrafiltrationConfirm::onActionReceive(const AdjustUltrafiltrationConfirmResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); volume ( vData.mVolume / 1000 ); // mL => L duration ( vData.mDuration ); rate ( vData.mRate ); // *** 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 ); } /*! * \brief View::VTreatmentAdjustmentUltrafiltrationConfirm::doOptionRate * \details the invocable slot to adjust the ultrafiltration set volume * \param vVolume - the new ultrafiltration volume */ void View::VTreatmentAdjustmentUltrafiltrationConfirm::doConfirm(float vVolume) { _data.volume = int(vVolume * 1000); // cast to int to truncate the float after convert to mL emit didAdjustment(_data); }