CSnapImageGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtcam_CSnapImageGuiComp_included
2 #define iqtcam_CSnapImageGuiComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QTimer>
7 
8 // ACF includes
10 #include "imod/IModel.h"
11 #include "imod/IObserver.h"
12 #include "iimg/IBitmap.h"
14 #include "iprm/IParamsSet.h"
15 #include "iqtgui/IGuiObject.h"
18 
19 // ACF-Solutions includes
21 
22 #include "iqtcam/iqtcam.h"
23 
24 #include "GeneratedFiles/iqtcam/ui_CSnapImageGuiComp.h"
25 
26 
27 namespace iqtcam
28 {
29 
30 
31 class CSnapImageGuiComp: public iqt2d::TViewExtenderCompBase<iqtgui::TDesignerGuiCompBase<Ui::CSnapImageGuiComp, QWidget> >
32 {
33  Q_OBJECT
34 
35 public:
37 
38  I_BEGIN_COMPONENT(CSnapImageGuiComp);
39  I_ASSIGN(m_bitmapCompPtr, "Bitmap", "Bitmap will be shown", true, "Bitmap");
40  I_ASSIGN_TO(m_bitmapModelCompPtr, m_bitmapCompPtr, true);
41  I_ASSIGN(m_bitmapAcquisitionCompPtr, "BitmapAcquisition", "Bitmap acquision obje for image snap", false, "BitmapAcquisition");
42  I_ASSIGN(m_lookupTableCompPtr, "LookupTable", "Lookup table for pseudo colors in the image view", false, "LookupTable");
43  I_ASSIGN(m_bitmapLoaderCompPtr, "BitmapLoader", "Saves bitmap to file", false, "BitmapLoader");
44  I_ASSIGN(m_paramsLoaderCompPtr, "ParamsLoader", "Loads and saves parameters from and to file", false, "ParamsLoader");
45  I_ASSIGN(m_paramsSetCompPtr, "ParamsSet", "Parameters set", false, "ParamsSet");
46  I_ASSIGN_TO(m_paramsSetModelCompPtr, m_paramsSetCompPtr, false);
47  I_ASSIGN(m_paramsSetGuiCompPtr, "ParamsSetGui", "Shows parameter set", false, "ParamsSetGui");
48  I_ASSIGN_TO(m_paramsSetObserverCompPtr, m_paramsSetGuiCompPtr, false);
49  I_ASSIGN_TO(m_paramsSetExtenderCompPtr, m_paramsSetGuiCompPtr, false);
50  I_ASSIGN(m_liveIntervalAttrPtr, "LiveInterval", "Interval (in seconds) of acquisition in continuous mode", true, 0.04);
51  I_END_COMPONENT;
52 
54 
55  // reimplemented (iqt2d::IViewExtender)
56  virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags);
57  virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr);
58 
59 protected:
60  bool SnapImage();
61 
62  // reimplemented (iqt2d::TViewExtenderCompBase)
63  virtual void CreateShapes(int sceneId, Shapes& result);
64 
65  // reimplemented (iqtgui::CGuiComponentBase)
66  virtual void OnGuiCreated();
67  virtual void OnGuiDestroyed();
68  virtual void OnGuiHidden();
69 
70  // reimplemented (icomp::CComponentBase)
71  virtual void OnComponentCreated();
72 
73 protected Q_SLOTS:
75  void on_LiveImageButton_toggled(bool checked);
79  void OnTimerReady();
80 
81 private:
82  I_REF(istd::IChangeable, m_bitmapCompPtr);
83  I_REF(imod::IModel, m_bitmapModelCompPtr);
84  I_REF(icam::IBitmapAcquisition, m_bitmapAcquisitionCompPtr);
85  I_REF(icmm::IColorTransformation, m_lookupTableCompPtr);
86 
87  I_REF(ifile::IFilePersistence, m_bitmapLoaderCompPtr);
88  I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
89 
90  I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
91  I_REF(imod::IModel, m_paramsSetModelCompPtr);
92  I_REF(iqtgui::IGuiObject, m_paramsSetGuiCompPtr);
93  I_REF(imod::IObserver, m_paramsSetObserverCompPtr);
94  I_REF(iqt2d::IViewExtender, m_paramsSetExtenderCompPtr);
95 
96  I_ATTR(double, m_liveIntervalAttrPtr);
97 
98  QTimer m_timer;
99 };
100 
101 
102 } // namespace iqtcam
103 
104 
105 #endif // !iqtcam_CSnapImageGuiComp_included
106 
107 
iqt2d::TViewExtenderCompBase< iqtgui::TDesignerGuiCompBase< Ui::CSnapImageGuiComp, QWidget > > BaseClass
virtual void OnGuiHidden()
void on_LiveImageButton_toggled(bool checked)
Bitmap acquisition processor.
virtual void OnGuiDestroyed()
virtual void CreateShapes(int sceneId, Shapes &result)
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags)
I_ASSIGN_TO(m_bitmapModelCompPtr, m_bitmapCompPtr, true)
virtual void OnComponentCreated()
virtual void OnGuiCreated()
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr)

© 2007-2011 Witold Gantzke and Kirill Lepskiy