SEElectroCardioGramInterpolator.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/CommonDataModel.h>
15 #include <biogears/exports.h>
16 #include <biogears/schema/cdm/ElectroCardioGram.hxx>
17 
18 CDM_BIND_DECL(ElectroCardioGramWaveformInterpolatorData)
19 
20 namespace biogears {
21 class SEElectroCardioGramInterpolatorWaveform;
22 class SEScalarElectricPotential;
23 
24 class BIOGEARS_API SEElectroCardioGramInterpolator : public Loggable {
25 public:
28 
29  virtual void Clear(); // Deletes all members
30 
31  virtual bool LoadWaveforms(const char* file, const SEScalarTime* timeStep = nullptr);
32  virtual bool LoadWaveforms(const std::string& file, const SEScalarTime* timeStep = nullptr);
33  virtual bool Load(const CDM::ElectroCardioGramWaveformInterpolatorData& in);
34  virtual CDM::ElectroCardioGramWaveformInterpolatorData* Unload() const;
35 
36 protected:
37  virtual void Unload(CDM::ElectroCardioGramWaveformInterpolatorData& data) const;
38 
39 public:
40  virtual void Interpolate(const SEScalarTime& timeStep);
41  virtual bool StartNewCycle(CDM::enumHeartRhythm::value rhythm);
42  virtual void CalculateWaveformsElectricPotential();
43 
44  // These are where the interpolator will put the interpolated electric potential data for each lead when you call CalculateWaveformsElectricPotential
45  // You must have a waveform for the lead of the current rhythm for these scalars to be populated
46  virtual bool CanInterpolateLeadPotential(CDM::ElectroCardioGramWaveformLeadNumber lead, CDM::enumHeartRhythm::value rhythm) const;
47  virtual void SetLeadElectricPotential(CDM::ElectroCardioGramWaveformLeadNumber lead, SEScalarElectricPotential& ep);
48 
49  virtual bool HasWaveform(CDM::ElectroCardioGramWaveformLeadNumber lead, CDM::enumHeartRhythm::value rhythm) const;
52  virtual void RemoveWaveform(CDM::ElectroCardioGramWaveformLeadNumber lead, CDM::enumHeartRhythm::value rhythm);
53 
54 protected:
55  virtual void Interpolate(SEElectroCardioGramInterpolatorWaveform& waveform, const SEScalarTime& timeStep);
56 
57  std::map<CDM::ElectroCardioGramWaveformLeadNumber, SEScalarElectricPotential*> m_Leads;
58  std::map<CDM::ElectroCardioGramWaveformLeadNumber, std::map<CDM::enumHeartRhythm, SEElectroCardioGramInterpolatorWaveform*>> m_Waveforms;
59 };
60 }
Definition: SEElectroCardioGramInterpolator.h:24
std::map< CDM::ElectroCardioGramWaveformLeadNumber, SEScalarElectricPotential * > m_Leads
Definition: SEElectroCardioGramInterpolator.h:57
Class corresponding to the ElectroCardioGramWaveformInterpolatorData schema type. ...
Definition: ElectroCardioGram.hxx:2250
value
Underlying enum type.
Definition: Physiology.hxx:5643
Definition: Logger.h:27
Definition: Logger.h:75
Definition: SEScalarTime.h:37
Class corresponding to the ElectroCardioGramWaveformLeadNumber schema type.
Definition: ElectroCardioGram.hxx:1702
Definition: SEScalarElectricPotential.h:34
Definition: SEElectricalCircuit.h:18
Definition: SEElectroCardioGramInterpolatorWaveform.h:21
std::map< CDM::ElectroCardioGramWaveformLeadNumber, std::map< CDM::enumHeartRhythm, SEElectroCardioGramInterpolatorWaveform * > > m_Waveforms
Definition: SEElectroCardioGramInterpolator.h:58