1 #ifndef H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_HISTORYWRITER_HPP
2 #define H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_HISTORYWRITER_HPP
4 #include "internal/common.hpp"
5 #include "internal/HistoryCollective.hpp"
6 #include "AbstractWriter.hpp"
8 #include <cutehmi/services/Serviceable.hpp>
13 namespace dataacquisition {
25 static constexpr
int INITIAL_INTERVAL = 100;
26 static constexpr
int INITIAL_SAMPLES = 100;
34 Q_PROPERTY(
int interval READ interval WRITE setInterval NOTIFY intervalChanged)
42 Q_PROPERTY(
int samples READ samples WRITE setSamples NOTIFY samplesChanged)
48 void setInterval(
int interval);
52 void setSamples(
int samples);
77 void intervalChanged();
79 void samplesChanged();
86 CUTEHMI_PROTECTED_SIGNALS:
89 void samplingTimerStarted();
91 void samplingTimerStopped();
93 void schemaValidatedTrue();
95 void schemaValidatedFalse();
97 void insertValuesBegan();
99 void collectiveFinished();
102 void onSchemaChanged();
106 void adjustSamplingTimer();
108 void startSamplingTimer();
110 void stopSamplingTimer();
112 void confirmCollectiveFinished();
119 template <typename T>
120 void addSample(T value, internal::HistoryCollective::Tuple & tuple);
132 interval(INITIAL_INTERVAL),
133 samples(INITIAL_SAMPLES),