-
Notifications
You must be signed in to change notification settings - Fork 38
/
ECGController.h
104 lines (92 loc) · 2.76 KB
/
ECGController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma once
#include "ECGSignal.h"
#include "ECGRs.h"
#include "ECGWaves.h"
#include "ECGHRV1.h"
#include "ECGHRV2.h"
#include "ECGHRVDFA.h"
#include "QRSClass.h"
#include "ECGHRT.h"
#include "ECGST.h"
#include "ECGTWave.h"
#include "ECGChannelInfo.h"
#include "ModulesInterfaces.h"
#include "ModulesMethods.h"
#include <boost/scoped_ptr.hpp>
namespace boost
{
class thread;
}
/**
* @class Class which controls executing all modules.
*/
class ECGController
{
public:
ECGController (void);
~ECGController (void);
bool readFile(std::string filename);
//methods for setting parameters
void setParamsECGBaseline(ParametersTypes & params);
void setParamsRPeaks(ParametersTypes & params);
void setParamsnWaves(ParametersTypes & params);
void setParamsHRV1(ParametersTypes & params);
void setParamsHRV2(ParametersTypes & params);
void setParamsHRVDFA(ParametersTypes & params);
void setParamsQRSClass(ParametersTypes & params);
void setParamsSTInterval(ParametersTypes & params);
void setParamsTwaveAlt(ParametersTypes & params);
void setParamsHRT(ParametersTypes & params);
void rerunAnalysis(std::function<void(std::string)> statusUpdate, std::function<void()> analysisComplete); //if analysis is running, then it's interrupted
//methods for running modules
void runECGBaseline();
void runRPeaks();
void runWaves();
void runHRV1();
void runHRV2();
void runHRVDFA();
void runQRSClass();
void runSTInterval();
void runTwaveAlt();
void runHRT();
//data
ECGInfo ecg_info;
ECGSignal raw_signal;
ECGSignalChannel filtered_signal;
ECGRs r_peaks_data;
ECGWaves waves_data;
ECGHRV1 hrv1_data;
ECGHRV2 hrv2_data;
ECGHRVDFA hrv_dfa_data;
QRSClass classes_data;
QRSClass qrsclass_data;
ECGST st_data;
ECGTWave twave_data;
ECGHRT hrt_data;
private:
//method for setting not run
void setECGBaselineNotRun();
void setRPeaksNotRun();
void setWavesNotRun();
void setHRV1NotRun();
void setHRV2NotRun();
void setHRVDFANotRun();
void setQRSClassNotRun();
void setSTIntervalNotRun();
void setTwaveAltNotRun();
void setHRTNotRun();
//modules
boost::scoped_ptr<ECGBaselineModule> ecg_baseline_module;
boost::scoped_ptr<RPeaksModule> rpeaks_module;
boost::scoped_ptr<WavesModule> waves_module;
boost::scoped_ptr<HRV1Module> hrv1_module;
boost::scoped_ptr<HRV2Module> hrv2_module;
boost::scoped_ptr<HRVDFAModule> hrv_dft_module;
boost::scoped_ptr<QRSClassModule> qrs_class_module;
boost::scoped_ptr<STIntervalModule> st_interval_module;
boost::scoped_ptr<TWaveAltModule> t_wave_alt_module;
boost::scoped_ptr<HRTModule> hrt_module;
//computing thread
boost::thread * computation;
bool analysisCompl;
};