Generic ECG machine to assess the heart rhythm. More...

#include <ECG.h>

Inherits SEElectroCardioGram, PulseElectroCardioGram, and PulseSystem.

Public Member Functions

virtual ~ECG ()
 
void Clear ()
 Cleans up any memory this class is responsible for. More...
 
- Public Member Functions inherited from SEElectroCardioGram
 SEElectroCardioGram (Logger *logger)
 
virtual ~SEElectroCardioGram ()
 
virtual const SEScalarGetScalar (const std::string &name)
 
virtual bool HasLead1ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead1ElectricPotential ()
 
virtual double GetLead1ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead2ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead2ElectricPotential ()
 
virtual double GetLead2ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead3ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead3ElectricPotential ()
 
virtual double GetLead3ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead4ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead4ElectricPotential ()
 
virtual double GetLead4ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead5ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead5ElectricPotential ()
 
virtual double GetLead5ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead6ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead6ElectricPotential ()
 
virtual double GetLead6ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead7ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead7ElectricPotential ()
 
virtual double GetLead7ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead8ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead8ElectricPotential ()
 
virtual double GetLead8ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead9ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead9ElectricPotential ()
 
virtual double GetLead9ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead10ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead10ElectricPotential ()
 
virtual double GetLead10ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead11ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead11ElectricPotential ()
 
virtual double GetLead11ElectricPotential (const ElectricPotentialUnit &unit) const
 
virtual bool HasLead12ElectricPotential () const
 
virtual SEScalarElectricPotentialGetLead12ElectricPotential ()
 
virtual double GetLead12ElectricPotential (const ElectricPotentialUnit &unit) const
 
- Public Member Functions inherited from SESystem
 SESystem (Logger *logger)
 
virtual ~SESystem ()
 
- 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

 ECG (PulseController &pc)
 
void Initialize ()
 Initializes the ECG specific quantities. More...
 
void SetUp ()
 
void PreProcess ()
 Prepares the ECG machine for the circuit solver. More...
 
void Process ()
 Process creates the ECG output. More...
 
void PostProcess ()
 Post process updates the math after the circuit calculation are done. More...
 
- Protected Member Functions inherited from PulseSystem
virtual void AtSteadyState ()
 Notify systems that steady state has been achieved. More...
 

Protected Attributes

PulseControllerm_data
 
double m_heartRhythmTime_s
 
double m_heartRhythmPeriod_s
 
SEElectroCardioGramWaveformInterpolatorm_interpolator
 
double m_dt_s
 
- Protected Attributes inherited from SEElectroCardioGram
SEScalarElectricPotentialm_Lead1ElectricPotential
 
SEScalarElectricPotentialm_Lead2ElectricPotential
 
SEScalarElectricPotentialm_Lead3ElectricPotential
 
SEScalarElectricPotentialm_Lead4ElectricPotential
 
SEScalarElectricPotentialm_Lead5ElectricPotential
 
SEScalarElectricPotentialm_Lead6ElectricPotential
 
SEScalarElectricPotentialm_Lead7ElectricPotential
 
SEScalarElectricPotentialm_Lead8ElectricPotential
 
SEScalarElectricPotentialm_Lead9ElectricPotential
 
SEScalarElectricPotentialm_Lead10ElectricPotential
 
SEScalarElectricPotentialm_Lead11ElectricPotential
 
SEScalarElectricPotentialm_Lead12ElectricPotential
 
- Protected Attributes inherited from SESystem
std::stringstream m_ss
 
- Protected Attributes inherited from Loggable
Loggerm_Logger
 

Friends

class PBPulseEquipment
 
class PulseController
 
class PulseEngineTest
 

Additional Inherited Members

- Static Public Member Functions inherited from SESystem
static const SEScalarGetScalar (const std::string &name, std::vector< SESystem *> *systems)
 
- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

Generic ECG machine to assess the heart rhythm.

Constructor & Destructor Documentation

◆ ECG()

ECG::ECG ( PulseController pc)
protected

◆ ~ECG()

ECG::~ECG ( )
virtual

Member Function Documentation

◆ Clear()

void ECG::Clear ( )
virtual

Cleans up any memory this class is responsible for.

Reimplemented from SEElectroCardioGram.

◆ Initialize()

void ECG::Initialize ( )
protectedvirtual

Initializes the ECG specific quantities.

Local member variables used in the ECG class are initialized here. These variables are used to keep track of the heart cycle and to create the ECG machine's output. SEElectrocardioGramInterpolater also loads in the data needed to create the output and interpolates it to match our time step. Placing the variables in this function allows for the system to be easy initialized at the beginning of a simulation or after a crash.

Reimplemented from PulseSystem.

◆ PostProcess()

void ECG::PostProcess ( )
protectedvirtual

Post process updates the math after the circuit calculation are done.

At this time, we do not have a circuit model for the ECG machine so this function is left empty. The PostProcess function is included to preserve our system methodology and as a placeholder for models developed in the future.

Implements PulseSystem.

◆ PreProcess()

void ECG::PreProcess ( )
protectedvirtual

Prepares the ECG machine for the circuit solver.

At this time, we do not have a circuit model for the ECG machine so this function is left empty. The PreProcess function is included to preserve our system methodology and as a placeholder for models developed in the future.

Implements PulseSystem.

◆ Process()

void ECG::Process ( )
protectedvirtual

Process creates the ECG output.

The process function queries the heart rhythm and heart rate from the cardiovascular system. The time period of the heart beat is determined from the heart rate and a new iterator on the waveform is initialized if the queried rhythm is Normal Sinus. The iterator holds the value of the waveform data at a specific time point on the interpolated waveform data. Process increments the time point and sums up the value of any active iterators. The iterators continue being incremented until they reach the end of the interpolated waveform data. If there are no active iterators, the output defaults to 0 mV.

Implements PulseSystem.

◆ SetUp()

void ECG::SetUp ( )
protectedvirtual

Implements PulseSystem.

Friends And Related Function Documentation

◆ PBPulseEquipment

friend class PBPulseEquipment
friend

◆ PulseController

friend class PulseController
friend

◆ PulseEngineTest

friend class PulseEngineTest
friend

Member Data Documentation

◆ m_data

PulseController& ECG::m_data
protected

◆ m_dt_s

double ECG::m_dt_s
protected

◆ m_heartRhythmPeriod_s

double ECG::m_heartRhythmPeriod_s
protected

◆ m_heartRhythmTime_s

double ECG::m_heartRhythmTime_s
protected

◆ m_interpolator

SEElectroCardioGramWaveformInterpolator* ECG::m_interpolator
protected