CMultiBitmapSupplierGuiComp.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 // Qt includes
5 #include <QtCore/QTimer>
6 
7 // ACF includes
8 #include <iimg/CBitmap.h>
10 
11 // ACF-Solutions includes
14 #include <GeneratedFiles/iqtcam/ui_CMultiBitmapSupplierGuiComp.h>
15 
16 
17 namespace iqtcam
18 {
19 
20 
22  public iqtinsp::TSupplierGuiCompBase<Ui::CMultiBitmapSupplierGuiComp>
23 {
24  Q_OBJECT
25 
26 public:
28 
29  I_BEGIN_COMPONENT(CMultiBitmapSupplierGuiComp);
30  I_ASSIGN(m_singleBitmapPersistenceCompPtr, "SingleBitmapPersistence", "Persistence for saving a single bitmap", false, "SingleBitmapPersistence");
31  I_ASSIGN(m_multiBitmapPersistenceCompPtr, "MultiBitmapPersistence", "Persistence for saving all camera images in a document", false, "MultiBitmapPersistence");
32  I_ASSIGN(m_iconSizeAttrPtr, "IconSize", "Maximum icon size in preview in px. Use 0 if you want to disable bitmap preview", true, 48);
33  I_ASSIGN(m_filePathFormatAttrPtr, "FilePathFormat", "Format of file path used to save bitmap, used only if save folder is used.\n\t- %1 will be replaced with current date\n\t- %2 with time\n\t- %3 with channel index\n\t- %4 with image resolution", true, "%1%2_%3.png");
34  I_END_COMPONENT;
35 
37 
38 protected Q_SLOTS:
40  void on_LiveImageButton_toggled(bool checked);
43  void on_BitmapPreview_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous);
46  void OnTimerReady();
47 
48 protected:
49  // reimplemented (iqtgui::CGuiComponentBase)
50  virtual void OnGuiCreated();
51  virtual void OnGuiHidden();
52 
53  // reimplemented (iqtinsp::TSupplierGuiCompBase)
54  virtual QWidget* GetParamsWidget() const;
55 
56  // reimplemented (iqt2d::TViewExtenderCompBase)
57  virtual void CreateShapes(int sceneId, Shapes& result);
58 
59  // reimplemented (iqtgui::TGuiObserverWrap)
60  virtual void OnGuiModelAttached();
61  virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet);
62 
63 private:
67  void SelectBitmap(int bitmapIdx);
68 
69  void ExportSelectedBitmap(const QString& filePath = QString());
70  void ExportBitmapDocument(const QString& filePath = QString());
71  void UpdateCommands();
72 
73  static QString CreateFileFilterForPersistence(const ifile::IFilePersistence& persistence);
74 
75 private:
76  I_REF(ifile::IFilePersistence, m_singleBitmapPersistenceCompPtr);
77  I_REF(ifile::IFilePersistence, m_multiBitmapPersistenceCompPtr);
78  I_ATTR(int, m_iconSizeAttrPtr);
79  I_TEXTATTR(m_filePathFormatAttrPtr);
80 
83 
84  QList<QIcon>m_icons;
85 
86  QTimer m_timer;
87 };
88 
89 
90 } // namespace iqtcam
91 
92 
virtual void CreateShapes(int sceneId, Shapes &result)
void on_LiveImageButton_toggled(bool checked)
virtual QWidget * GetParamsWidget() const
Get parameters widget object.
iqtinsp::TSupplierGuiCompBase< Ui::CMultiBitmapSupplierGuiComp > BaseClass
void on_BitmapPreview_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet)

© 2007-2017 Witold Gantzke and Kirill Lepskiy