Converter.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Hartmut Nebelung
6 // $Header$
7 //
8 // License: This file is published under the license of the EMVA GenICam Standard Group.
9 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10 // If for some reason you are missing this file please contact the EMVA or visit the website
11 // (http://www.genicam.org) for a full copy.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
17 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 //-----------------------------------------------------------------------------
31 #ifndef GENAPI_CONVERTER_H
32 #define GENAPI_CONVERTER_H
33 #include "Base/GCString.h"
34 #include "../IFloat.h"
35 #include "Node.h"
36 #include "BaseT.h"
37 #include "ValueT.h"
38 #include "NodeT.h"
39 #include "NodeMap.h"
40 #include "SwissKnife.h"
41 #include "FloatT.h"
42 #include "PolyReference.h"
43 
44 namespace GENAPI_NAMESPACE
45 {
46  //*************************************************************
47  // CConverter class
48  //*************************************************************
49 
51 
58  class CConverterImpl : public IFloat, public CNodeImpl
59  {
60  public:
63  protected:
64 
65  //-------------------------------------------------------------
66  // IFloat implementation
67  //-------------------------------------------------------------
68 
69  // Set feature value
70  virtual void InternalSetValue(double Value, bool Verify = true);
71 
72  // Get feature value
73  virtual double InternalGetValue(bool Verify = false, bool IgnoreCache = false);
74 
75  // Get minimum value allowed
76  virtual double InternalGetMin();
77 
78  // Get maximum value allowed
79  virtual double InternalGetMax();
80 
82  virtual bool InternalHasInc();
83 
85  virtual double InternalGetInc();
86 
89 
90  // Get recommended representation
92  {
94  return m_Representation;
95  else
96  return m_Value.GetRepresentation();
97  }
98 
99  // Get the access mode of the node
100  virtual EAccessMode InternalGetAccessMode() const;
101 
104  {
105  return intfIFloat;
106  }
107 
110  {
111  if ( !m_Unit.empty() )
112  return m_Unit;
113  else
114  return m_Value.GetUnit();
115  }
116 
119  {
121  return m_DisplayNotation;
122  else
123  return m_Value.GetDisplayNotation();
124  }
125 
128  {
129  if ( m_DisplayPrecision != -1 )
130  return m_DisplayPrecision;
131  else
132  return m_Value.GetDisplayPrecision();
133  }
134 
136  virtual ECachingMode InternalGetCachingMode() const;
137 
138  public:
140  //-------------------------------------------------------------
141  // Initializing
142  //-------------------------------------------------------------
143  public:
144 
145 
146  virtual void SetProperty( CProperty &Property );
147  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
148 
149 
150  // determine if the conversion function is increasing or decreasing
151  void CheckIncreasing();
152 
153 
154  protected:
156  bool IsMinUninititialized() const;
157 
159  bool IsMaxUninitialized() const;
160 
161  //-------------------------------------------------------------
162  // Member variables
163  //-------------------------------------------------------------
164 
167 
170 
173 
176 
179 
182 
185 
188 
191 
194 
197 
200  };
201 
204  : public BaseT< ValueT< NodeT < FloatT < CConverterImpl > > > >
205  {
206  };
207 }
208 
209 #endif // GENAPI_CONVERTER_H
Definition of the ValueT class template.
CFloatPolyRef m_ConvertFrom
The Swiss Knife for Get.
Definition: Converter.h:178
IFloat interface.
Definition: Types.h:196
GENICAM_NAMESPACE::gcstring m_InputName
The Name of the external Variable.
Definition: Converter.h:172
virtual const double_autovector_t InternalGetListOfValidValues()
Get list of valid value.
class implementing the converter object
Definition: Converter.h:203
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
virtual bool empty(void) const
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
GENICAM_NAMESPACE::gcstring m_Unit
the physical unit name
Definition: Converter.h:187
virtual double InternalGetValue(bool Verify=false, bool IgnoreCache=false)
GENICAM_NAMESPACE::gcstring GetUnit() const
see IFloat interface
Vector of doubles with reference counting.
Definition: Autovector.h:76
EYesNo m_IsLinear
indicates if the conversion is linear
Definition: Converter.h:199
__int64 int64_t
Definition: config-win32.h:21
CFloatPolyRef m_ConvertTo
The Swiss Knife for Set.
Definition: Converter.h:175
virtual EAccessMode InternalGetAccessMode() const
Get the access mode of the node.
Implementation of the IBase interface.
Definition: BaseT.h:48
Definition of the NodeT class template.
IFloat implementation with integrated conversion.
Definition: Converter.h:58
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
CFloatPolyRef m_Value
Reference to the value.
Definition: Converter.h:181
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
enum GENAPI_NAMESPACE::_EDisplayNotation EDisplayNotation
typedef for float notation
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
EDisplayNotation m_DisplayNotation
the printf format specifier used to convert the float number to a string
Definition: Converter.h:190
int64_t GetDisplayPrecision() const
see IFloat
int64_t m_DisplayPrecision
the precision the float is converted with to a string
Definition: Converter.h:193
virtual ERepresentation InternalGetRepresentation() const
Definition: Converter.h:91
ERepresentation m_Representation
recommended representation of the value
Definition: Converter.h:184
virtual GENICAM_NAMESPACE::gcstring InternalGetUnit() const
Get the unit.
Definition: Converter.h:109
virtual bool InternalHasInc()
True if the float has a constant increment.
Definition of polymorphical smart pointer.
GENICAM_NAMESPACE::gcstring m_FormulaTo
The SwissKnife formula for Set.
Definition: Converter.h:166
virtual void SetProperty(CProperty &Property)
Checks if the node is terminal.
EDisplayNotation GetDisplayNotation() const
see IFloat
bool IsMaxUninitialized() const
Checks if <Max> has ben set.
Definition of the BaseT class template.
virtual int64_t InternalGetDisplayPrecision() const
Get the precision to be used when converting the float to a string.
Definition: Converter.h:127
Standard implementation for the INode and the ISelector interface.
Definition: Node.h:86
ESlope m_Slope
indicates if the formula is strictly monotonous increasing or decreating
Definition: Converter.h:196
A reference to a float which can be either a double variable, or a pointer to an IFloat, IInteger, or an IEnumeration interface.
A string class which is a clone of std::string.
Definition: GCString.h:52
Object is not yet initialized.
Definition: Types.h:184
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
Portable string implementation.
ERepresentation GetRepresentation() const
see IFloat interface
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
virtual EDisplayNotation InternalGetDisplayNotation() const
Get the way the float should be converted to a string.
Definition: Converter.h:118
enum GENAPI_NAMESPACE::_ESlope ESlope
typedef for formula type
Declaration of CNodeMap.
virtual double InternalGetInc()
Get the constant increment if there is any.
Definition of CSwissKnife.
Definition of the FloatT class template.
GENICAM_NAMESPACE::gcstring m_FormulaFrom
The SwissKnife formula for Get.
Definition: Converter.h:169
bool IsMinUninititialized() const
Checks if <Min> has ben set.
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: Converter.h:103
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
virtual ECachingMode InternalGetCachingMode() const
Get Caching Mode.
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
virtual void InternalSetValue(double Value, bool Verify=true)


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40