Manages and controls execution of all data/systems in Pulse. More...

#include <Controller.h>

Inherits Loggable, and LoggerForward.

Inherited by PulseEngine.

Public Member Functions

 PulseController (Logger *logger, const std::string &data_dir=".")
 
 PulseController (const std::string &logfileName, const std::string &data_dir=".")
 
virtual ~PulseController ()
 
EngineState GetState ()
 
DataTrackGetDataTrack ()
 
SaturationCalculatorGetSaturationCalculator ()
 
PulseSubstancesGetSubstances ()
 
SEPatientGetPatient ()
 
bool GetPatientAssessment (SEPatientAssessment &assessment) const
 
SEBloodChemistrySystemGetBloodChemistry ()
 
SECardiovascularSystemGetCardiovascular ()
 
SEDrugSystemGetDrugs ()
 
SEEndocrineSystemGetEndocrine ()
 
SEEnergySystemGetEnergy ()
 
SEGastrointestinalSystemGetGastrointestinal ()
 
SEHepaticSystemGetHepatic ()
 
SENervousSystemGetNervous ()
 
SERenalSystemGetRenal ()
 
SERespiratorySystemGetRespiratory ()
 
SETissueSystemGetTissue ()
 
SEEnvironmentGetEnvironment ()
 
SEAnesthesiaMachineGetAnesthesiaMachine ()
 
SEElectroCardioGramGetECG ()
 
SEInhalerGetInhaler ()
 
SEActionManagerGetActions ()
 
SEConditionManagerGetConditions ()
 
PulseCircuitsGetCircuits ()
 
PulseCompartmentsGetCompartments ()
 
const PulseConfigurationGetConfiguration ()
 
const SEScalarTimeGetEngineTime ()
 
const SEScalarTimeGetSimulationTime ()
 
const SEScalarTimeGetTimeStep ()
 
eAirwayMode GetAirwayMode ()
 
void SetAirwayMode (eAirwayMode mode)
 
eSwitch GetIntubation ()
 
void SetIntubation (eSwitch s)
 
bool CreateCircuitsAndCompartments ()
 
virtual void AdvanceCallback (double time_s)
 
- Public Member Functions inherited from Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Protected Member Functions

void SetupCardiovascular ()
 
void SetupRenal ()
 
void SetupTissue ()
 
void SetupGastrointestinal ()
 
void SetupRespiratory ()
 
void SetupAnesthesiaMachine ()
 
void SetupInhaler ()
 
void SetupMechanicalVentilator ()
 
void SetupExternalTemperature ()
 
void SetupInternalTemperature ()
 
bool Initialize (const PulseConfiguration *config)
 
bool SetupPatient ()
 
virtual void AtSteadyState (EngineState state)
 
void PreProcess ()
 
void Process ()
 
void PostProcess ()
 
void ForwardFatal (const std::string &msg, const std::string &origin)
 
- Protected Member Functions inherited from LoggerForward
virtual void ForwardDebug (std::string const &msg, std::string const &origin)
 
virtual void ForwardInfo (std::string const &msg, std::string const &origin)
 
virtual void ForwardWarning (std::string const &msg, std::string const &origin)
 
virtual void ForwardError (std::string const &msg, std::string const &origin)
 

Protected Attributes

EngineState m_State
 
DataTrackm_DataTrack
 
std::unique_ptr< SEScalarTimem_CurrentTime
 
std::unique_ptr< SEScalarTimem_SimulationTime
 
eAirwayMode m_AirwayMode
 
eSwitch m_Intubation
 
std::unique_ptr< PulseConfigurationm_Config
 
std::unique_ptr< SaturationCalculatorm_SaturationCalculator
 
std::unique_ptr< PulseSubstancesm_Substances
 
std::unique_ptr< SEActionManagerm_Actions
 
std::unique_ptr< SEConditionManagerm_Conditions
 
std::unique_ptr< PulseCircuitsm_Circuits
 
std::unique_ptr< PulseCompartmentsm_Compartments
 
std::unique_ptr< Environmentm_Environment
 
std::unique_ptr< BloodChemistrym_BloodChemistrySystem
 
std::unique_ptr< Cardiovascularm_CardiovascularSystem
 
std::unique_ptr< Endocrinem_EndocrineSystem
 
std::unique_ptr< Energym_EnergySystem
 
std::unique_ptr< Gastrointestinalm_GastrointestinalSystem
 
std::unique_ptr< Hepaticm_HepaticSystem
 
std::unique_ptr< Nervousm_NervousSystem
 
std::unique_ptr< Renalm_RenalSystem
 
std::unique_ptr< Respiratorym_RespiratorySystem
 
std::unique_ptr< Drugsm_DrugSystem
 
std::unique_ptr< Tissuem_TissueSystem
 
std::unique_ptr< ECGm_ECG
 
std::unique_ptr< AnesthesiaMachinem_AnesthesiaMachine
 
std::unique_ptr< Inhalerm_Inhaler
 
std::unique_ptr< SEPatientm_Patient
 
bool myLogger
 
SEEventHandlerm_EventHandler
 
SEAdvanceHandlerm_AdvanceHandler
 
std::string m_DataDir
 
- Protected Attributes inherited from Loggable
Loggerm_Logger
 

Friends

class PulseEngineTest
 
class PulseScenarioExec
 

Additional Inherited Members

- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

Manages and controls execution of all data/systems in Pulse.

Constructor & Destructor Documentation

◆ PulseController() [1/2]

PulseController::PulseController ( Logger logger,
const std::string &  data_dir = "." 
)

◆ PulseController() [2/2]

PulseController::PulseController ( const std::string &  logfileName,
const std::string &  data_dir = "." 
)

◆ ~PulseController()

PulseController::~PulseController ( )
virtual

Member Function Documentation

◆ AdvanceCallback()

virtual void PulseController::AdvanceCallback ( double  time_s)
inlinevirtual

Reimplemented in PulseEngine.

◆ AtSteadyState()

void PulseController::AtSteadyState ( EngineState  state)
protectedvirtual

◆ CreateCircuitsAndCompartments()

bool PulseController::CreateCircuitsAndCompartments ( )

◆ ForwardFatal()

void PulseController::ForwardFatal ( const std::string &  msg,
const std::string &  origin 
)
protectedvirtual

Reimplemented from LoggerForward.

◆ GetActions()

SEActionManager & PulseController::GetActions ( )

◆ GetAirwayMode()

eAirwayMode PulseController::GetAirwayMode ( )

◆ GetAnesthesiaMachine()

SEAnesthesiaMachine & PulseController::GetAnesthesiaMachine ( )

◆ GetBloodChemistry()

SEBloodChemistrySystem & PulseController::GetBloodChemistry ( )

◆ GetCardiovascular()

SECardiovascularSystem & PulseController::GetCardiovascular ( )

◆ GetCircuits()

PulseCircuits & PulseController::GetCircuits ( )

◆ GetCompartments()

PulseCompartments & PulseController::GetCompartments ( )

◆ GetConditions()

SEConditionManager & PulseController::GetConditions ( )

◆ GetConfiguration()

const PulseConfiguration & PulseController::GetConfiguration ( )

◆ GetDataTrack()

DataTrack & PulseController::GetDataTrack ( )

◆ GetDrugs()

SEDrugSystem & PulseController::GetDrugs ( )

◆ GetECG()

SEElectroCardioGram & PulseController::GetECG ( )

◆ GetEndocrine()

SEEndocrineSystem & PulseController::GetEndocrine ( )

◆ GetEnergy()

SEEnergySystem & PulseController::GetEnergy ( )

◆ GetEngineTime()

const SEScalarTime & PulseController::GetEngineTime ( )

◆ GetEnvironment()

SEEnvironment & PulseController::GetEnvironment ( )

◆ GetGastrointestinal()

SEGastrointestinalSystem & PulseController::GetGastrointestinal ( )

◆ GetHepatic()

SEHepaticSystem & PulseController::GetHepatic ( )

◆ GetInhaler()

SEInhaler & PulseController::GetInhaler ( )

◆ GetIntubation()

eSwitch PulseController::GetIntubation ( )

◆ GetNervous()

SENervousSystem & PulseController::GetNervous ( )

◆ GetPatient()

SEPatient & PulseController::GetPatient ( )

◆ GetPatientAssessment()

bool PulseController::GetPatientAssessment ( SEPatientAssessment assessment) const

◆ GetRenal()

SERenalSystem & PulseController::GetRenal ( )

◆ GetRespiratory()

SERespiratorySystem & PulseController::GetRespiratory ( )

◆ GetSaturationCalculator()

SaturationCalculator & PulseController::GetSaturationCalculator ( )

◆ GetSimulationTime()

const SEScalarTime & PulseController::GetSimulationTime ( )

◆ GetState()

EngineState PulseController::GetState ( )

◆ GetSubstances()

PulseSubstances & PulseController::GetSubstances ( )

◆ GetTimeStep()

const SEScalarTime & PulseController::GetTimeStep ( )

◆ GetTissue()

SETissueSystem & PulseController::GetTissue ( )

◆ Initialize()

bool PulseController::Initialize ( const PulseConfiguration config)
protected

◆ PostProcess()

void PulseController::PostProcess ( )
protected

◆ PreProcess()

void PulseController::PreProcess ( )
protected

◆ Process()

void PulseController::Process ( )
protected

◆ SetAirwayMode()

void PulseController::SetAirwayMode ( eAirwayMode  mode)

◆ SetIntubation()

void PulseController::SetIntubation ( eSwitch  s)

◆ SetupAnesthesiaMachine()

void PulseController::SetupAnesthesiaMachine ( )
protected

◆ SetupCardiovascular()

void PulseController::SetupCardiovascular ( )
protected
Todo:
Make these a function of the systolic and diastolic pressure by fitting a curve to the data from the variations test

◆ SetupExternalTemperature()

void PulseController::SetupExternalTemperature ( )
protected

◆ SetupGastrointestinal()

void PulseController::SetupGastrointestinal ( )
protected

◆ SetupInhaler()

void PulseController::SetupInhaler ( )
protected

◆ SetupInternalTemperature()

void PulseController::SetupInternalTemperature ( )
protected

◆ SetupMechanicalVentilator()

void PulseController::SetupMechanicalVentilator ( )
protected

◆ SetupPatient()

bool PulseController::SetupPatient ( )
protected

[86]

[194]

[182]

[249] [26]

[92]

[94]

[219]

cite ganong1995review

[60]

[232]

◆ SetupRenal()

void PulseController::SetupRenal ( )
protected
Todo:
The bladder is currently not being modeled as a compliance
Todo:
Use a compliance here - make sure you remove the current handling of bladder volume in the renal system as a pressure source

◆ SetupRespiratory()

void PulseController::SetupRespiratory ( )
protected

◆ SetupTissue()

void PulseController::SetupTissue ( )
protected
Todo:
Put Initial Circuit/Compartment data values into the configuration file.

Friends And Related Function Documentation

◆ PulseEngineTest

friend class PulseEngineTest
friend

◆ PulseScenarioExec

friend class PulseScenarioExec
friend

Member Data Documentation

◆ m_Actions

std::unique_ptr<SEActionManager> PulseController::m_Actions
protected

◆ m_AdvanceHandler

SEAdvanceHandler* PulseController::m_AdvanceHandler
protected

◆ m_AirwayMode

eAirwayMode PulseController::m_AirwayMode
protected

◆ m_AnesthesiaMachine

std::unique_ptr<AnesthesiaMachine> PulseController::m_AnesthesiaMachine
protected

◆ m_BloodChemistrySystem

std::unique_ptr<BloodChemistry> PulseController::m_BloodChemistrySystem
protected

◆ m_CardiovascularSystem

std::unique_ptr<Cardiovascular> PulseController::m_CardiovascularSystem
protected

◆ m_Circuits

std::unique_ptr<PulseCircuits> PulseController::m_Circuits
protected

◆ m_Compartments

std::unique_ptr<PulseCompartments> PulseController::m_Compartments
protected

◆ m_Conditions

std::unique_ptr<SEConditionManager> PulseController::m_Conditions
protected

◆ m_Config

std::unique_ptr<PulseConfiguration> PulseController::m_Config
protected

◆ m_CurrentTime

std::unique_ptr<SEScalarTime> PulseController::m_CurrentTime
protected

◆ m_DataDir

std::string PulseController::m_DataDir
protected

◆ m_DataTrack

DataTrack* PulseController::m_DataTrack
protected

◆ m_DrugSystem

std::unique_ptr<Drugs> PulseController::m_DrugSystem
protected

◆ m_ECG

std::unique_ptr<ECG> PulseController::m_ECG
protected

◆ m_EndocrineSystem

std::unique_ptr<Endocrine> PulseController::m_EndocrineSystem
protected

◆ m_EnergySystem

std::unique_ptr<Energy> PulseController::m_EnergySystem
protected

◆ m_Environment

std::unique_ptr<Environment> PulseController::m_Environment
protected

◆ m_EventHandler

SEEventHandler* PulseController::m_EventHandler
protected

◆ m_GastrointestinalSystem

std::unique_ptr<Gastrointestinal> PulseController::m_GastrointestinalSystem
protected

◆ m_HepaticSystem

std::unique_ptr<Hepatic> PulseController::m_HepaticSystem
protected

◆ m_Inhaler

std::unique_ptr<Inhaler> PulseController::m_Inhaler
protected

◆ m_Intubation

eSwitch PulseController::m_Intubation
protected

◆ m_NervousSystem

std::unique_ptr<Nervous> PulseController::m_NervousSystem
protected

◆ m_Patient

std::unique_ptr<SEPatient> PulseController::m_Patient
protected

◆ m_RenalSystem

std::unique_ptr<Renal> PulseController::m_RenalSystem
protected

◆ m_RespiratorySystem

std::unique_ptr<Respiratory> PulseController::m_RespiratorySystem
protected

◆ m_SaturationCalculator

std::unique_ptr<SaturationCalculator> PulseController::m_SaturationCalculator
protected

◆ m_SimulationTime

std::unique_ptr<SEScalarTime> PulseController::m_SimulationTime
protected

◆ m_State

EngineState PulseController::m_State
protected

◆ m_Substances

std::unique_ptr<PulseSubstances> PulseController::m_Substances
protected

◆ m_TissueSystem

std::unique_ptr<Tissue> PulseController::m_TissueSystem
protected

◆ myLogger

bool PulseController::myLogger
protected