CScriptDataProcessorComp.h
Go to the documentation of this file.
1 #ifndef iqtsig_CScriptSampleAcquisitionComp_included
2 #define iqtsig_CScriptSampleAcquisitionComp_included
3 
4 
5 // Qt includes
6 #include <QtScript/QtScript>
7 
8 // ACF includes
9 #include "icomp/CComponentBase.h"
10 #include "ilog/TLoggerCompWrap.h"
12 
13 #include "iqtsig/iqtsig.h"
14 
15 
16 namespace iqtsig
17 {
18 
19 
32 {
33 public:
35 
36  I_BEGIN_COMPONENT(CScriptDataProcessorComp);
37  I_REGISTER_INTERFACE(iproc::IProcessor);
38  I_ASSIGN(m_minValueAttrPtr, "MinValue", "Minimal value of sample", true, 0.0);
39  I_ASSIGN(m_maxValueAttrPtr, "MaxValue", "Maximal value of sample", true, 100.0);
40  I_ASSIGN(m_samplesCountAttrPtr, "SamplesCount", "Number of samples processed in single step", false, 100);
41  I_ASSIGN(m_channelsCountAttrPtr, "ChannelsCount", "Number of channels processed in single step", false, 100);
42  I_ASSIGN(m_defaultScriptAttrPtr, "DefaultScript", "Default script used to calculate sample output in 'Calc' function", false, "minValue");
43  I_ASSIGN(m_scriptParamIdAttrPtr, "ScriptParamId", "ID of script in parameter set (defined as idoc::ITextDocument)", false, "ScriptId");
44  I_END_COMPONENT;
45 
47 
48  // reimplemented (iproc::IProcessor)
49  virtual int DoProcessing(
50  const iprm::IParamsSet* paramsPtr,
51  const istd::IPolymorphic* inputPtr,
52  istd::IChangeable* outputPtr,
53  ibase::IProgressManager* progressManagerPtr = NULL);
54 
55  // reimplemented (isig::ISamplingConstraints)
56  virtual istd::CRange GetIntervalRange() const;
57  virtual bool IsSamplingModeSupported(int mode) const;
58  virtual istd::CRange GetValueRange(bool forInput = true, bool forOutput = true, const iprm::IParamsSet* paramsSetPtr = 0) const;
59  virtual int GetMaximalSamplesCount(bool forInput = true, bool forOutput = true, const iprm::IParamsSet* paramsSetPtr = 0) const;
60 
61 protected:
62  // reimplemented (icomp::CComponentBase)
63  virtual void OnComponentCreated();
64 
65 private:
66  QScriptEngine m_scriptEngine;
67  int m_frameNumber;
68 
69  I_ATTR(double, m_minValueAttrPtr);
70  I_ATTR(double, m_maxValueAttrPtr);
71  I_ATTR(int, m_samplesCountAttrPtr);
72  I_ATTR(int, m_channelsCountAttrPtr);
73  I_ATTR(QString, m_defaultScriptAttrPtr);
74  I_ATTR(QByteArray, m_scriptParamIdAttrPtr);
75 };
76 
77 
78 } // namespace iqtsig
79 
80 
81 #endif // !iqtsig_CScriptSampleAcquisitionComp_included
82 
83 
Processor creating some data sequence (sample) using user defined script.
virtual istd::CRange GetIntervalRange() const
Wrapper of iproc::IProcessor for simple synchrone processor implementations.
virtual bool IsSamplingModeSupported(int mode) const
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
ilog::CLoggerComponentBase BaseClass
virtual istd::CRange GetValueRange(bool forInput=true, bool forOutput=true, const iprm::IParamsSet *paramsSetPtr=0) const
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual int GetMaximalSamplesCount(bool forInput=true, bool forOutput=true, const iprm::IParamsSet *paramsSetPtr=0) const

© 2007-2011 Witold Gantzke and Kirill Lepskiy