/*! * * 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 VTreatmentAdjustmentRecirculate.cpp * \author (last) Behrouz NematiPour * \date (last) 07-Feb-2021 * \author (original) Behrouz NematiPour * \date (original) 20-Nov-2020 * */ #include "VTreatmentAdjustmentRecirculate.h" // Project #include "GuiController.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentRecirculate, AdjustRecirculateResponseData) void VTreatmentAdjustmentRecirculate::initConnections() { ACTION_VIEW_CONNECTION(AdjustRecirculateResponseData); ADJUST_VIEW_CONNECTION(AdjustRecirculateRequestData ); } void VTreatmentAdjustmentRecirculate::onActionReceive(const AdjustRecirculateResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); // *** 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::VTreatmentAdjustmentRecirculate::doAdjustment * \details the invocable slot to adjust recirculate requested state */ void View::VTreatmentAdjustmentRecirculate::doAdjustment(const Gui::GuiRecirculateCommands &vRequestedState) { _data.requestedState = vRequestedState; emit didAdjustment(_data); // notify the controllers to do the adjustment } /*! * \brief View::VTreatmentAdjustmentRecirculate::doReconnect * \details User requests to re-connect to system (stop re-circulating, clamp arterial and venous lines) */ void View::VTreatmentAdjustmentRecirculate::doReconnect() { doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_RECONNECT ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doConfirm * \details User confirms patient connected, lines un-shunted to return to treatment */ void View::VTreatmentAdjustmentRecirculate::doConfirm() { doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_CONFIRM_RECONNECT ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doResume * \details User requests to resume re-circulation */ void View::VTreatmentAdjustmentRecirculate::doResume() { doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_RESUME_RC ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doTreatmentEnd * \details User requests to end treatment */ void View::VTreatmentAdjustmentRecirculate::doTreatmentEnd() { doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_END_TREATMENT ); }