CSampleAcquisitionGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtsig_CSampleAcquisitionGuiComp_included
2 #define iqtsig_CSampleAcquisitionGuiComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QTimer>
7 
9 
10 #include "imod/IModel.h"
11 #include "imod/IObserver.h"
12 #include "imod/TModelWrap.h"
13 
14 #include "iprm/IParamsSet.h"
15 
16 #include "iproc/IProcessor.h"
17 
19 
20 #include "iqtgui/IGuiObject.h"
22 
24 
25 #include "GeneratedFiles/iqtsig/ui_CSampleAcquisitionGuiComp.h"
26 
27 
28 namespace iqtsig
29 {
30 
31 
32 class CSampleAcquisitionGuiComp: public iqtgui::TDesignerGuiCompBase<Ui::CSampleAcquisitionGuiComp, QWidget>
33 {
34  Q_OBJECT
35 
36 public:
38 
39  I_BEGIN_COMPONENT(CSampleAcquisitionGuiComp);
40  I_ASSIGN(m_sampleAcquisitionCompPtr, "SampleAcquisition", "Sample acquisiotion object used to fill sample container", true, "SampleAcquisition");
41  I_ASSIGN(m_sampleLoaderCompPtr, "SampleLoader", "Saves sample to file", false, "SampleLoader");
42  I_ASSIGN(m_paramsLoaderCompPtr, "ParamsLoader", "Loads and saves parameters from and to file", false, "ParamsLoader");
43  I_ASSIGN(m_paramsSetCompPtr, "ParamsSet", "Parameters set", false, "ParamsSet");
44  I_ASSIGN_TO(m_paramsSetModelCompPtr, m_paramsSetCompPtr, false);
45  I_ASSIGN(m_paramsSetGuiCompPtr, "ParamsSetGui", "Shows parameter set", false, "ParamsSetGui");
46  I_ASSIGN_TO(m_paramsSetObserverCompPtr, m_paramsSetGuiCompPtr, false);
47  I_ASSIGN(m_minDisplayedValueAttrPtr, "MinDispValue", "Minimal displayed value", true, 0);
48  I_ASSIGN(m_maxDisplayedValueAttrPtr, "MaxDispValue", "Maximal displayed value", true, 100);
49  I_ASSIGN(m_liveIntervalAttrPtr, "LiveInterval", "Interval (in seconds) of acquisition in continuous mode", true, 0.04);
50  I_ASSIGN(m_acquisitionTimeoutAttrPtr, "AcquisitionTimeout", "Timeout of single acquisition in seconds", false, 1);
51  I_ASSIGN(m_startOnInitAttrPtr, "StartOnInit", "If it true acquisition start on initialization", true, false);
52  I_END_COMPONENT;
53 
55 
56 protected:
57  bool AcquireSample();
58 
59  // reimplemented (iqtgui::CGuiComponentBase)
60  virtual void OnGuiCreated();
61  virtual void OnGuiDestroyed();
62 
63  // reimplemented (icomp::CComponentBase)
64  virtual void OnComponentCreated();
65 
66 protected Q_SLOTS:
67  void on_StartButton_toggled(bool checked);
71  void OnTimerReady();
72 
73 private:
74  I_REF(iproc::IProcessor, m_sampleAcquisitionCompPtr);
75 
76  I_REF(ifile::IFilePersistence, m_sampleLoaderCompPtr);
77  I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
78 
79  I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
80  I_REF(imod::IModel, m_paramsSetModelCompPtr);
81  I_REF(iqtgui::IGuiObject, m_paramsSetGuiCompPtr);
82  I_REF(imod::IObserver, m_paramsSetObserverCompPtr);
83 
84  I_ATTR(double, m_minDisplayedValueAttrPtr);
85  I_ATTR(double, m_maxDisplayedValueAttrPtr);
86  I_ATTR(double, m_liveIntervalAttrPtr);
87  I_ATTR(double, m_acquisitionTimeoutAttrPtr);
88  I_ATTR(bool, m_startOnInitAttrPtr);
89 
91  CSampleContainerView m_samplesView;
92 
93  QTimer m_timer;
94 };
95 
96 
97 } // namespace iqtsig
98 
99 
100 #endif // !iqtsig_CSampleAcquisitionGuiComp_included
101 
102 
iqtgui::TDesignerGuiCompBase< Ui::CSampleAcquisitionGuiComp, QWidget > BaseClass
void on_StartButton_toggled(bool checked)
I_ASSIGN_TO(m_paramsSetModelCompPtr, m_paramsSetCompPtr, false)
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24

© 2007-2011 Witold Gantzke and Kirill Lepskiy