BagValveMaskModel.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6#include "engine/common/system/Model.h"
7#include "engine/common/system/Systems.h"
8
15
16namespace pulse
17{
18 class PBEquipment;
19 class EngineTest;
24 class PULSE_DECL BagValveMaskModel : public BagValveMaskSystem, public Model
25 {
26 friend PBEquipment;//friend the serialization class
27 friend EngineTest;
28 public:
29 BagValveMaskModel(Data& pc);
30 virtual ~BagValveMaskModel();
31
32 void Clear() override;
33
34 // Set members to a stable homeostatic state
35 void Initialize() override;
36 // Set pointers and other member varialbes common to both homeostatic initialization and loading a state
37 void SetUp() override;
38
39 void StateChange() override;
40
41 void AtSteadyState() override {}
42 void PreProcess() override;
43 void Process(bool solve_and_transport = true) override;
44 void PostProcess(bool solve_and_transport = true) override;
45
46 protected:
47 void CheckLastAction(SEBagValveMaskAction* a);
48 void ComputeExposedModelParameters() override;
49
50 void UpdateAirwayMode();
51 void UpdateConnection();
52 void InvalidateConnection();
53
54 void CalculateInspiration();
55 void CalculateExpiration();
56 void SetSqeezeDriver();
57 void CycleMode();
58 void SetResistances();
59 void SetVolumes();
60
61 // Serializable member variables (Set in Initialize and in schema)
62 double m_CurrentPeriodTime_s;
63 double m_SqueezeFlow_L_Per_s;
64 double m_SqueezePressure_cmH2O;
65
66 // Stateless member variable (Set in SetUp())
67 SEScalarFrequency* m_BreathFrequency;
68 SEScalar* m_InspiratoryExpiratoryRatio;
69 SEScalarPressure* m_SqueezePressure;
70 SEScalarVolume* m_SqueezeVolume;
71 SEScalarTime* m_ExpiratoryPeriod;
72 SEScalarTime* m_InspiratoryPeriod;
73 SEBagValveMaskAction* m_LastAction;
74
75 SEGasCompartment* m_Environment;
76 SEGasCompartment* m_Reservoir;
77 SELiquidCompartment* m_ReservoirAerosol;
78 SEFluidCircuitNode* m_FilterNode;
79 SEFluidCircuitNode* m_ConnectionNode;
80 SEFluidCircuitNode* m_ValveNode;
81 SEFluidCircuitPath* m_ReservoirToBag;
82 SEFluidCircuitPath* m_BagToValve;
83 SEFluidCircuitPath* m_ValveToFilter;
84 SEFluidCircuitPath* m_FilterToConnection;
85 SEFluidCircuitPath* m_ConnectionToEnvironment;
86 double m_DefaultClosedFlowResistance_cmH2O_s_Per_L;
87 };
88END_NAMESPACE
Definition: SEBagValveMaskAction.h:7
Definition: SEFluidCircuitNode.h:10
Definition: SEFluidCircuitPath.h:9
Definition: SEGasCompartment.h:14
Definition: SEGasSubstanceQuantity.h:10
Definition: SELiquidCompartment.h:11
Definition: SEScalarFrequency.h:26
Definition: SEScalar.h:19
Definition: SEScalarPressure.h:29
Definition: SEScalarTime.h:28
Definition: SEScalarVolume.h:28
Definition: Logger.h:14

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.