/*! * * 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 VTreatmentAdjustmentSaline.cpp * \author (last) Behrouz NematiPour * \date (last) 11-Apr-2021 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * */ #include "VTreatmentAdjustmentSaline.h" // Project #include "GuiController.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentSaline) void VTreatmentAdjustmentSaline::initConnections() { ACTION_VIEW_CONNECTION(AdjustSalineResponseData); ADJUST_VIEW_CONNECTION(AdjustSalineRequestData ); } void VTreatmentAdjustmentSaline::onActionReceive(const AdjustSalineResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); target ( vData.mTarget ); // *** 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::VTreatmentAdjustmentSaline::doAdjustment * \details the invocable slot to adjust(start/stop) the treatment saline bolus state * \param vStart - if true sets the requestedState to 1(SALINE_CMD_START) otherwise to 0(SALINE_CMD_STOP) */ /*! * \brief View::VTreatmentAdjustmentSaline::doStart * \details sends the start saline request */ void View::VTreatmentAdjustmentSaline::doStart() { _data.requestedState = GuiSalineCommands::SALINE_CMD_START; emit didAdjustment(_data); } /*! * \brief View::VTreatmentAdjustmentSaline::doStop * \details sends the stop saline request */ void View::VTreatmentAdjustmentSaline::doStop() { _data.requestedState = GuiSalineCommands::SALINE_CMD_STOP; emit didAdjustment(_data); }