/*! * * 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 VTreatmentAdjustmentRecirculate.cpp * \author (last) Behrouz NematiPour * \date (last) 23-Apr-2023 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * */ #include "VTreatmentAdjustmentRecirculate.h" // Project #include "GuiController.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentRecirculate) 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 () { // 0 doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_RECONNECT ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doConfirmReconnect * \details User confirms patient connected, lines un-shunted to return to treatment */ void View::VTreatmentAdjustmentRecirculate::doConfirmReconnect () { // 1 doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_CONFIRM_RECONNECT ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doResume * \details User requests to resume re-circulation */ void View::VTreatmentAdjustmentRecirculate::doResume () { // 2 doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_RESUME_RC ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doTreatmentEnd * \details User requests to end treatment */ void View::VTreatmentAdjustmentRecirculate::doTreatmentEnd () { // 3 doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_END_TREATMENT ); } /*! * \brief View::VTreatmentAdjustmentRecirculate::doConfirmDisconnect * \details User confirms patient disconnected, lines shunted to begin re-circulation */ void View::VTreatmentAdjustmentRecirculate::doConfirmDisconnect () { // 4 doAdjustment( GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_CONFIRM_DISCONNECT ); }