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
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::EAccessMode
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
GENAPI_NAMESPACE::CConverterImpl::m_DisplayNotation
EDisplayNotation m_DisplayNotation
the printf format specifier used to convert the float number to a string
Definition: Converter.h:190
GENAPI_NAMESPACE::CConverterImpl::m_Value
CFloatPolyRef m_Value
Reference to the value.
Definition: Converter.h:181
GENAPI_NAMESPACE::CFloatPolyRef::GetDisplayNotation
EDisplayNotation GetDisplayNotation() const
see IFloat
Definition: PolyReference.h:980
PolyReference.h
Definition of polymorphical smart pointer.
GENAPI_NAMESPACE::double_autovector_t
Vector of doubles with reference counting.
Definition: Autovector.h:76
GENAPI_NAMESPACE::CConverterImpl::InternalGetAccessMode
virtual EAccessMode InternalGetAccessMode() const
Get the access mode of the node.
GENAPI_NAMESPACE::EDisplayNotation
enum GENAPI_NAMESPACE::_EDisplayNotation EDisplayNotation
typedef for float notation
GENAPI_NAMESPACE::CFloatPolyRef
A reference to a float which can be either a double variable, or a pointer to an IFloat,...
Definition: PolyReference.h:633
SwissKnife.h
Definition of CSwissKnife.
GENICAM_NAMESPACE::gcstring::empty
virtual bool empty(void) const
NodeMap.h
Declaration of CNodeMap.
GENAPI_NAMESPACE::CNodeImpl
Standard implementation for the INode and the ISelector interface.
Definition: Node.h:86
GENICAM_NAMESPACE::gcstring
A string class which is a clone of std::string.
Definition: GCString.h:52
GENAPI_NAMESPACE::CConverterImpl::IsMinUninititialized
bool IsMinUninititialized() const
Checks if <Min> has ben set.
GENAPI_NAMESPACE::_UndefinedRepresentation
@ _UndefinedRepresentation
Definition: Types.h:97
GENAPI_NAMESPACE::CConverterImpl::m_FormulaTo
GENICAM_NAMESPACE::gcstring m_FormulaTo
The SwissKnife formula for Set.
Definition: Converter.h:166
NodeT.h
Definition of the NodeT class template.
GENAPI_NAMESPACE::CConverterImpl::SetProperty
virtual void SetProperty(CProperty &Property)
Checks if the node is terminal.
GENAPI_NAMESPACE::CConverterImpl::InternalGetCachingMode
virtual ECachingMode InternalGetCachingMode() const
Get Caching Mode.
GENAPI_NAMESPACE::CConverterImpl::InternalGetUnit
virtual GENICAM_NAMESPACE::gcstring InternalGetUnit() const
Get the unit.
Definition: Converter.h:109
GENAPI_NAMESPACE::CConverterImpl::m_ConvertTo
CFloatPolyRef m_ConvertTo
The Swiss Knife for Set.
Definition: Converter.h:175
GENAPI_NAMESPACE::CFloatPolyRef::GetDisplayPrecision
int64_t GetDisplayPrecision() const
see IFloat
Definition: PolyReference.h:999
GENAPI_NAMESPACE::CConverterImpl
IFloat implementation with integrated conversion.
Definition: Converter.h:58
GENAPI_NAMESPACE::BaseT
Implementation of the IBase interface.
Definition: BaseT.h:48
GENAPI_NAMESPACE::CConverterImpl::InternalSetValue
virtual void InternalSetValue(double Value, bool Verify=true)
GENAPI_NAMESPACE::CConverterImpl::InternalGetValue
virtual double InternalGetValue(bool Verify=false, bool IgnoreCache=false)
GENAPI_NAMESPACE::CConverterImpl::InternalGetListOfValidValues
virtual const double_autovector_t InternalGetListOfValidValues()
Get list of valid value.
GENAPI_NAMESPACE::intfIFloat
@ intfIFloat
IFloat interface.
Definition: Types.h:195
GENAPI_NAMESPACE::ERepresentation
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
GENAPI_NAMESPACE::Verify
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
GENAPI_NAMESPACE::CConverterImpl::m_Slope
ESlope m_Slope
indicates if the formula is strictly monotonous increasing or decreating
Definition: Converter.h:196
GENAPI_NAMESPACE::CConverter
class implementing the converter object
Definition: Converter.h:203
GENAPI_NAMESPACE::CFloatPolyRef::GetUnit
GENICAM_NAMESPACE::gcstring GetUnit() const
see IFloat interface
Definition: PolyReference.h:936
GENAPI_NAMESPACE::CConverterImpl::m_Unit
GENICAM_NAMESPACE::gcstring m_Unit
the physical unit name
Definition: Converter.h:187
GENAPI_NAMESPACE::CConverterImpl::InternalGetMax
virtual double InternalGetMax()
GENAPI_NAMESPACE::EInterfaceType
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
GENAPI_NAMESPACE::CConverterImpl::InternalGetDisplayPrecision
virtual int64_t InternalGetDisplayPrecision() const
Get the precision to be used when converting the float to a string.
Definition: Converter.h:127
BaseT.h
Definition of the BaseT class template.
GENAPI_NAMESPACE::CConverterImpl::m_FormulaFrom
GENICAM_NAMESPACE::gcstring m_FormulaFrom
The SwissKnife formula for Get.
Definition: Converter.h:169
GENAPI_NAMESPACE::CConverterImpl::m_DisplayPrecision
int64_t m_DisplayPrecision
the precision the float is converted with to a string
Definition: Converter.h:193
GENAPI_NAMESPACE::CConverterImpl::m_IsLinear
EYesNo m_IsLinear
indicates if the conversion is linear
Definition: Converter.h:199
FloatT.h
Definition of the FloatT class template.
Node.h
GENAPI_NAMESPACE::CConverterImpl::CConverterImpl
CConverterImpl()
Constructor.
GENAPI_NAMESPACE::CConverterImpl::InternalGetPrincipalInterfaceType
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: Converter.h:103
GENAPI_NAMESPACE::CConverterImpl::GetProperty
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
GENAPI_NAMESPACE::IFloat
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
GENAPI_NAMESPACE::CConverterImpl::CheckIncreasing
void CheckIncreasing()
GENAPI_NAMESPACE::EYesNo
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
GENAPI_NAMESPACE::CFloatPolyRef::GetRepresentation
ERepresentation GetRepresentation() const
see IFloat interface
Definition: PolyReference.h:916
GENAPI_NAMESPACE::CConverterImpl::m_InputName
GENICAM_NAMESPACE::gcstring m_InputName
The Name of the external Variable.
Definition: Converter.h:172
int64_t
__int64 int64_t
Definition: config-win32.h:21
GENAPI_NAMESPACE::ESlope
enum GENAPI_NAMESPACE::_ESlope ESlope
typedef for formula type
GENAPI_NAMESPACE::CConverterImpl::InternalGetInc
virtual double InternalGetInc()
Get the constant increment if there is any.
GENAPI_NAMESPACE::ECachingMode
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
GENAPI_NAMESPACE::CConverterImpl::m_ConvertFrom
CFloatPolyRef m_ConvertFrom
The Swiss Knife for Get.
Definition: Converter.h:178
ValueT.h
Definition of the ValueT class template.
GENAPI_NAMESPACE::CConverterImpl::InternalGetDisplayNotation
virtual EDisplayNotation InternalGetDisplayNotation() const
Get the way the float should be converted to a string.
Definition: Converter.h:118
GENAPI_NAMESPACE::CConverterImpl::InternalHasInc
virtual bool InternalHasInc()
True if the float has a constant increment.
GENAPI_NAMESPACE::CConverterImpl::IsMaxUninitialized
bool IsMaxUninitialized() const
Checks if <Max> has ben set.
GENAPI_NAMESPACE::CConverterImpl::InternalGetMin
virtual double InternalGetMin()
GENAPI_NAMESPACE::CConverterImpl::m_Representation
ERepresentation m_Representation
recommended representation of the value
Definition: Converter.h:184
GENAPI_NAMESPACE::_UndefinedEDisplayNotation
@ _UndefinedEDisplayNotation
Object is not yet initialized.
Definition: Types.h:183
GCString.h
Portable string implementation.
GENAPI_NAMESPACE::CConverterImpl::InternalGetRepresentation
virtual ERepresentation InternalGetRepresentation() const
Definition: Converter.h:91


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11