CColorPatternComparatorComp.h
Go to the documentation of this file.
1 #ifndef iipr_CColorPatternComparatorComp_included
2 #define iipr_CColorPatternComparatorComp_included
3 
4 
5 // ACF includes
8 #include "icmm/CHsv.h"
9 
10 // ACF-Solutions includes
16 
17 
18 namespace iipr
19 {
20 
21 
30  public iproc::TSupplierCompWrap<imeas::CSimpleNumericValue>,
31  virtual public imeas::INumericValueProvider,
32  virtual public istd::IInformationProvider
33 {
34 public:
36 
37  I_BEGIN_COMPONENT(CColorPatternComparatorComp);
38  I_REGISTER_INTERFACE(imeas::INumericValueProvider);
39  I_REGISTER_INTERFACE(istd::IInformationProvider);
40  I_REGISTER_INTERFACE(imeas::IDataSequenceProvider);
41  I_ASSIGN(m_patternCompareThresholdParamIdAttrPtr, "PatternCompareThresholdParamId", "ID of the threshold parameter for pattern comparison", true, "PatternCompareThresholdParamId");
42  I_ASSIGN(m_workingPatternProviderCompPtr, "WorkingPatternProvider", "Provider of the working pattern to be compared with the teached one", true, "WorkingPatternProvider");
43  I_ASSIGN(m_teachedPatternProviderCompPtr, "TeachedPatternProvider", "Provider of the learned pattern", true, "TeachedPatternProvider");
44  I_ASSIGN_TO(m_teachedPatternProviderModelCompPtr, m_teachedPatternProviderCompPtr, false);
45  I_ASSIGN_TO(m_teachedPatternSupplierCompPtr, m_teachedPatternProviderCompPtr, false);
46  I_ASSIGN(m_dataStatisticsProcessorCompPtr, "DataStatisticsProcessor", "Processor used for calculation of the histogram statistics", true, "DataStatisticsProcessor");
47  I_ASSIGN(m_defaultSourceAttrPtr, "DefaultSource", "Default source of information.", true, "Color Check");
48  I_END_COMPONENT;
49 
51 
52  // reimplemented (imeas::INumericValueProvider)
53  virtual int GetValuesCount() const;
54  virtual const imeas::INumericValue& GetNumericValue(int index) const;
55 
56  // reimplemented (istd::IInformationProvider)
57  virtual QDateTime GetInformationTimeStamp() const;
58  virtual InformationCategory GetInformationCategory() const;
59  virtual int GetInformationId() const;
60  virtual QString GetInformationDescription() const;
61  virtual QString GetInformationSource() const;
62  virtual int GetInformationFlags() const;
63 
64 protected:
65  // reimplemented (iproc::TSupplierCompWrap)
66  virtual int ProduceObject(ProductType& result) const;
67 
68  // reimplemented (icomp::CComponentBase)
69  virtual void OnComponentCreated();
70  virtual void OnComponentDestroyed();
71 
72 private:
73  bool GetHsvColorValue(const imeas::IDataSequenceStatistics& statistics, icmm::CHsv& hsv) const;
74 
75 private:
76  I_ATTR(QByteArray, m_patternCompareThresholdParamIdAttrPtr);
77  I_REF(imeas::IDataSequenceProvider, m_workingPatternProviderCompPtr);
78  I_REF(imod::IModel, m_workingPatternProviderModelCompPtr);
79  I_REF(iproc::ISupplier, m_workingPatternSupplierCompPtr);
80 
81  I_REF(imeas::IDataSequenceProvider, m_teachedPatternProviderCompPtr);
82  I_REF(imod::IModel, m_teachedPatternProviderModelCompPtr);
83  I_REF(iproc::ISupplier, m_teachedPatternSupplierCompPtr);
84 
85  I_REF(imeas::IDataSequenceStatisticsProcessor, m_dataStatisticsProcessorCompPtr);
86 
87  I_ATTR(QString, m_defaultSourceAttrPtr);
88 
89  mutable QDateTime m_resultTimeStamp;
90 
91  mutable bool m_isColorPatternMatched;
92 };
93 
94 
95 } // namespace iipr
96 
97 
98 #endif // !iipr_CColorPatternComparatorComp_included
Color comparator based on histogram statistics.
virtual const imeas::INumericValue & GetNumericValue(int index) const
Returns a single numeric value from the list.
virtual int GetInformationFlags() const
iproc::TSupplierCompWrap< imeas::CSimpleNumericValue > BaseClass
virtual QDateTime GetInformationTimeStamp() const
virtual int ProduceObject(ProductType &result) const
Produce single object.
Simple data sequence provider.
Basic implementation of imeas::INumericValue interface.
Base interface for suppliers providing synchrone processing of single object with "pull data" model...
Definition: ISupplier.h:22
Provide access to the list of the numeric values.
virtual int GetInformationId() const
virtual QString GetInformationSource() const
General parameter set containing list of numeric values.
Definition: INumericValue.h:19
virtual int GetValuesCount() const
Get number of numeric values in the list.
virtual QString GetInformationDescription() const
virtual InformationCategory GetInformationCategory() const
Common interaface for data sequence statistics.
I_ASSIGN_TO(m_teachedPatternProviderModelCompPtr, m_teachedPatternProviderCompPtr, false)
Processor interface for statistics calculation of a data sequence.
Standard implementation of interface iproc::ISupplier with preparation for component implementation...

© 2007-2011 Witold Gantzke and Kirill Lepskiy