CProcessorControlGuiComp.h
Go to the documentation of this file.
1 #ifndef iprocgui_CProcessorControlGuiComp_included
2 #define iprocgui_CProcessorControlGuiComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QTimer>
7 
8 // ACF includes
10 
11 #include "imod/IModel.h"
12 #include "imod/IObserver.h"
13 
14 #include "iprm/IParamsSet.h"
15 
16 #include "iqtgui/IGuiObject.h"
18 
19 #include "iproc/IProcessor.h"
20 
21 #include "GeneratedFiles/iprocgui/ui_CProcessorControlGuiComp.h"
22 
23 
24 namespace iprocgui
25 {
26 
27 
28 class CProcessorControlGuiComp: public iqtgui::TDesignerGuiCompBase<Ui::CProcessorControlGuiComp>
29 {
30  Q_OBJECT
31 
32 public:
34 
35  I_BEGIN_COMPONENT(CProcessorControlGuiComp);
36  I_ASSIGN(m_inputDataCompPtr, "InputData", "Input data that will be processed", false, "InputData");
37  I_ASSIGN(m_outputDataCompPtr, "OutputData", "Output data object", true, "OutputData");
38  I_ASSIGN(m_outputDataLoaderCompPtr, "OutputDataLoader", "Saves processing data to file", false, "OutputDataLoader");
39  I_ASSIGN(m_processorCompPtr, "Processor", "Processor object used to convert input to output data", true, "Processor");
40  I_ASSIGN(m_paramsSetCompPtr, "ParamsSet", "Parameters set", false, "ParamsSet");
41  I_ASSIGN(m_paramsSetModelCompPtr, "ParamsSet", "Parameters set", false, "ParamsSet");
42  I_ASSIGN(m_paramsLoaderCompPtr, "ParamsLoader", "Loads and saves parameters from and to file", false, "ParamsLoader");
43  I_ASSIGN(m_paramsSetGuiCompPtr, "ParamsSetGui", "Shows parameter set", false, "ParamsSetGui");
44  I_ASSIGN_TO(m_paramsSetObserverCompPtr, m_paramsSetGuiCompPtr, false);
45  I_ASSIGN(m_liveIntervalAttrPtr, "LiveInterval", "Interval (in seconds) of acquisition in continuous mode", true, 0.04);
46  I_END_COMPONENT;
47 
49 
50 protected:
51  // reimplemented (icomp::CComponentBase)
52  virtual void OnComponentCreated();
53 
54 protected Q_SLOTS:
56  void on_LiveDataAcquisitionButton_toggled(bool checked);
60  void OnTimerReady();
61 
62 protected:
63  bool DoDataAcquisition();
64 
65  // reimplemented (iqtgui::CGuiComponentBase)
66  virtual void OnGuiCreated();
67  virtual void OnGuiDestroyed();
68 
69 private:
70  I_REF(istd::IChangeable, m_inputDataCompPtr);
71  I_REF(istd::IChangeable, m_outputDataCompPtr);
72  I_REF(ifile::IFilePersistence, m_outputDataLoaderCompPtr);
73 
74  I_REF(iproc::IProcessor, m_processorCompPtr);
75 
76  I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
77  I_REF(imod::IModel, m_paramsSetModelCompPtr);
78  I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
79 
80  I_REF(iqtgui::IGuiObject, m_paramsSetGuiCompPtr);
81  I_REF(imod::IObserver, m_paramsSetObserverCompPtr);
82 
83  I_ATTR(double, m_liveIntervalAttrPtr);
84 
85  QTimer m_timer;
86 };
87 
88 
89 } // namespace iprocgui
90 
91 
92 #endif // !iprocgui_CProcessorControlGuiComp_included
93 
94 
void on_LiveDataAcquisitionButton_toggled(bool checked)
iqtgui::TDesignerGuiCompBase< Ui::CProcessorControlGuiComp, QWidget > BaseClass
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
I_ASSIGN_TO(m_paramsSetObserverCompPtr, m_paramsSetGuiCompPtr, false)

© 2007-2011 Witold Gantzke and Kirill Lepskiy