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 {
22 static constexpr
int INITIAL_INTERVAL = 100;
23 static constexpr
int INITIAL_SAMPLES = 100;
31 Q_PROPERTY(
int interval READ interval WRITE setInterval NOTIFY intervalChanged)
39 Q_PROPERTY(
int samples READ samples WRITE setSamples NOTIFY samplesChanged)
45 void setInterval(
int interval);
49 void setSamples(
int samples);
74 void intervalChanged();
76 void samplesChanged();
83 CUTEHMI_PROTECTED_SIGNALS:
86 void samplingTimerStarted();
88 void samplingTimerStopped();
90 void schemaValidatedTrue();
92 void schemaValidatedFalse();
94 void insertValuesBegan();
97 void onSchemaChanged();
101 void adjustSamplingTimer();
103 void startSamplingTimer();
105 void stopSamplingTimer();
110 void addIntSample(const
QString & tagName,
int value);
112 void addBoolSample(const
QString & tagName,
bool value);
114 void addRealSample(const
QString & tagName,
double value);
118 template <typename T>
119 void addSample(T value, typename internal::HistoryTable<T>::Tuple & tuple);
133 interval(INITIAL_INTERVAL),
134 samples(INITIAL_SAMPLES),