/*! * * 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 VHDTreatmentStatesData.h * \author (last) Behrouz NematiPour * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour * \date (original) 13-Aug-2020 * */ #pragma once // Qt #include // Project #include "main.h" // Doxygen : don't remove #include "MModel.h" #include "VView.h" #include "GuiGlobals.h" // namespace using namespace Gui; namespace View { /*! * \brief The VHDTreatmentStates class * \details View for Model's data representation. * * \sa Model::MTreatmentStates * */ class VHDTreatmentStates : public QObject { Q_OBJECT // coco begin validated: Manually tested // This property should not be used in QML since it need exposed enum // exposed enum usage in QML is not suggested since QML will not error out on any issue // kept for consistency and debugging use cases PROPERTY( quint32, subMode , 0) PROPERTY( quint32, ufState , 0) PROPERTY( quint32, salineState , 0) // coco end // these properties are mutually exclusive // and if one becomes true the other ones become false at the same time // so on each change we were going to have multiple signal emits. // but since it is not happening more often Property is used. // otherwise it should be implemented as a single signal with these properties as parameters.\n // also start UF_START_STATE should not be used often // because it's only useful in FW implementation and it immediately changes to another state. // ---- Ultrafiltration states // coco begin validated: Manually tested // not useful for UI more FW state entry // kept for consistency PROPERTY( bool , ufStart , false) ///< UF_START_STATE Start state of the ultrafiltration state machine // coco end PROPERTY( bool , ufPaused , false) ///< UF_PAUSED_STATE Paused state of the ultrafiltration state machine PROPERTY( bool , ufRunning , false) ///< UF_RUNNING_STATE Running state of the ultrafiltration state machine PROPERTY( bool , ufOff , true ) ///< UF_OFF_STATE Completed/off state of the ultrafiltration state machine (default state) PROPERTY( bool , ufCompleted , false) ///< UF_COMPLETED_STATE Completed state of ultrafiltration state machine // ---- Saline Bolus states PROPERTY( bool , sbIdle , true ) ///< SALINE_BOLUS_STATE_IDLE No saline bolus delivery is in progress (default state) PROPERTY( bool , sbWaitPump , false) ///< SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP Wait for pumps to stop before starting bolus PROPERTY( bool , sbRunning , false) ///< SALINE_BOLUS_STATE_IN_PROGRESS A saline bolus delivery is in progress PROPERTY( bool , sbMaxReached , false) ///< SALINE_BOLUS_STATE_MAX_DELIVERED Maximum saline bolus volume reached - no more saline bolus deliveries allowed // ---- Treatment states // ---- Treatment states - Basics // coco begin validated: Manually tested // not used yet since the Treatment Start/stop/end has not been implemented yet. PROPERTY( bool , txStart , false) ///< TREATMENT_START_STATE Start treatment, prime blood side with gradual ramp for 1 min. while dialyzer is bypassed. No dialysis or UF taking place PROPERTY( bool , txStop , false) ///< TREATMENT_STOP_STATE Treatment stopped. All pumps off. Dializer bypassed PROPERTY( bool , txEnd , false) ///< TREATMENT_END_STATE Treatment has ended. All pumps off. Dialyzer is bypassed. Blood lines are closed. User to disconnect // coco end // ---- Treatment states - Dialysis PROPERTY( bool , txDialysis_Running , false) ///< TREATMENT_DIALYSIS_STATE Perform dialysis. Deliver Heparin as prescribed. Deliver UF as prescribed. Handle saline boluses as requested // coco begin validated: Manually tested // not used yet since the Treatment Start/stop/end has not been implemented yet. PROPERTY( bool , txDialysis_End , false) ///< TREATMENT_DIALYSIS_END_STATE Dialysis has ended. Blood pump slowed. Dialyzer is bypassed. Dialysate is recirculated. User can rinseback // coco end // ---- Treatment states - Rinse back // coco begin validated: Manually tested // not used yet since the rinse back and recirculate has not bin implemented yet. PROPERTY( bool , txRinseback_Running , false) ///< TREATMENT_RINSEBACK_STATE Perform rinseback with saline. Dialyzer bypassed. Dialysate recirculating PROPERTY( bool , txRinseback_Pause , false) ///< TREATMENT_RINSEBACK_PAUSE_STATE Rinseback paused. Blood pump off. Dialyzer bypassed. Dialysate recirculating // ---- Treatment states - Recirculate PROPERTY( bool , txRecirculate_Setup , false) ///< TREATMENT_RECIRC_SETUP_STATE Rinseback complete. Blood pump off. Blood lines closed. User to disconnect and shunt blood lines PROPERTY( bool , txRecirculate_Running , false) ///< TREATMENT_RECIRC_STATE Recirculate saline and dialysate while patient disconnected. Blood lines open and shunted. Dialyzer is bypassed PROPERTY( bool , txRecirculate_Pause , false) ///< TREATMENT_RECIRC_PAUSE_STATE Recirculate paused. Blood pump off. Blood lines closed and shunted. Dialyzer is bypassed PROPERTY( bool , txRecirculate_Stop , false) ///< TREATMENT_RECIRC_STOP_STATE Recirculate stopped. Blood pump off. Blood lines open. Waiting for patient to unshunt and connect and resume treatment // coco end // class definition VIEW_DEC_CLASS(VHDTreatmentStates) // slots for received data messages (onActionReceive) VIEW_DEC_SLOT (TreatmentStatesData ) // Treatment States broadcast messages (This class original receiver) VIEW_DEC_SLOT (AdjustSalineResponseData ) // Saline Bolus Adjustment response message VIEW_DEC_SLOT (AdjustUltrafiltrationStateResponseData ) // Ultrafiltration state adjustment response message public slots: }; }