CSnapImageParamsEditorComp.h
Go to the documentation of this file.
1 #ifndef iqtcam_CSnapImageParamsEditorComp_included
2 #define iqtcam_CSnapImageParamsEditorComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QTimer>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QAction>
9 #include <QtWidgets/QMenu>
10 #else
11 #include <QtGui/QAction>
12 #include <QtGui/QMenu>
13 #endif
14 
15 // ACF includes
16 #include <ifile/IFilePersistence.h>
17 #include <imod/IModel.h>
18 #include <imod/IObserver.h>
19 #include <iimg/IBitmap.h>
21 #include <iprm/IParamsSet.h>
22 #include <iqtgui/IGuiObject.h>
25 
26 // ACF-Solutions includes
28 
29 #include <iqtcam/iqtcam.h>
30 
31 #include <GeneratedFiles/iqtcam/ui_CSnapImageParamsEditorComp.h>
32 
33 
34 namespace iqtcam
35 {
36 
37 
42  iqtgui::TDesignerGuiObserverCompBase<Ui::CSnapImageParamsEditorComp, iprm::IParamsSet> >
43 {
44  Q_OBJECT
45 
46 public:
48 
49  I_BEGIN_COMPONENT(CSnapImageParamsEditorComp);
50  I_ASSIGN(m_bitmapCompPtr, "Bitmap", "Bitmap will be shown", true, "Bitmap");
51  I_ASSIGN_TO(m_bitmapModelCompPtr, m_bitmapCompPtr, true);
52  I_ASSIGN(m_bitmapAcquisitionCompPtr, "BitmapAcquisition", "Bitmap acquision obje for image snap", false, "BitmapAcquisition");
53  I_ASSIGN(m_lookupTableCompPtr, "LookupTable", "Lookup table for pseudo colors in the image view", false, "LookupTable");
54  I_ASSIGN(m_bitmapLoaderCompPtr, "BitmapLoader", "Saves or loads bitmap to/from file", false, "BitmapLoader");
55  I_ASSIGN(m_allowBitmapLoadAttrPtr, "AllowBitmapLoad", "If true loading of images is allowed", true, false);
56  I_ASSIGN(m_paramsLoaderCompPtr, "ParamsLoader", "Loads and saves parameters from and to file", false, "ParamsLoader");
57  I_ASSIGN(m_paramsSetGuiCompPtr, "ParamsSetGui", "Shows parameter set", false, "ParamsSetGui");
58  I_ASSIGN_TO(m_paramsSetObserverCompPtr, m_paramsSetGuiCompPtr, false);
59  I_ASSIGN_TO(m_paramsSetExtenderCompPtr, m_paramsSetGuiCompPtr, false);
60  I_ASSIGN(m_liveIntervalAttrPtr, "LiveInterval", "Interval (in seconds) of acquisition in continuous mode", true, 0.04);
61  I_END_COMPONENT;
62 
64 
65  // reimplemented (iqt2d::IViewExtender)
66  virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags);
67  virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr);
68 
69 protected:
71  {
72  public:
74 
75  protected:
76  // reimplemented (imod::CSingleModelObserverBase)
77  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
78 
79  private:
81  };
82 
83  bool SnapImage();
84  void UpdateButtonsState();
85 
86  // reimplemented (iqt2d::TViewExtenderCompBase)
87  virtual void CreateShapes(int sceneId, Shapes& result);
88 
89  // reimplemented (iqtgui::CGuiComponentBase)
90  virtual void OnGuiRetranslate();
91  virtual void OnGuiCreated();
92  virtual void OnGuiDestroyed();
93  virtual void OnGuiHidden();
94 
95  // reimplemented (iqtgui::TGuiObserverWrap)
96  virtual void OnGuiModelAttached();
97  virtual void OnGuiModelDetached();
98 
99  // reimplemented (icomp::CComponentBase)
100  virtual void OnComponentCreated();
101 
102 protected Q_SLOTS:
108  void OnIntervalSnap(bool checked);
109  void OnSnapOnChanges(bool checked);
110  void OnTimerReady();
111 
112 private:
113  I_REF(iimg::IBitmap, m_bitmapCompPtr);
114  I_REF(imod::IModel, m_bitmapModelCompPtr);
115  I_REF(icam::IBitmapAcquisition, m_bitmapAcquisitionCompPtr);
116  I_REF(icmm::IColorTransformation, m_lookupTableCompPtr);
117 
118  I_REF(ifile::IFilePersistence, m_bitmapLoaderCompPtr);
119  I_ATTR(bool, m_allowBitmapLoadAttrPtr);
120  I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
121 
122  I_REF(iqtgui::IGuiObject, m_paramsSetGuiCompPtr);
123  I_REF(imod::IObserver, m_paramsSetObserverCompPtr);
124  I_REF(iqt2d::IViewExtender, m_paramsSetExtenderCompPtr);
125 
126  I_ATTR(double, m_liveIntervalAttrPtr);
127 
128  QTimer m_timer;
129 
130  ParamsObserver m_paramsObserver;
131 
132  QAction m_intervalSnapAction;
133  QAction m_snapOnChangesAction;
134  QMenu m_snapButtonMenu;
135 };
136 
137 
138 } // namespace iqtcam
139 
140 
141 #endif // !iqtcam_CSnapImageParamsEditorComp_included
142 
143 
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr)
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
Bitmap acquisition processor.
void OnSnapOnChanges(bool checked)
ParamsObserver(CSnapImageParamsEditorComp *parentPtr)
iqt2d::TViewExtenderCompBase< iqtgui::TDesignerGuiObserverCompBase< Ui::CSnapImageParamsEditorComp, iprm::IParamsSet > > BaseClass
virtual void CreateShapes(int sceneId, Shapes &result)
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags)
Delegator of parameters integrating snap functionality.

© 2007-2017 Witold Gantzke and Kirill Lepskiy