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 "SwissKnife.h"
40 #include "FloatT.h"
41 #include "PolyReference.h"
42 
43 namespace GENAPI_NAMESPACE
44 {
45  //*************************************************************
46  // CConverter class
47  //*************************************************************
48 
50 
57  class CConverterImpl : public IFloat, public CNodeImpl
58  {
59  public:
62  protected:
63 
64  //-------------------------------------------------------------
65  // IFloat implementation
66  //-------------------------------------------------------------
67 
68  // Set feature value
69  virtual void InternalSetValue(double Value, bool Verify = true);
70 
71  // Get feature value
72  virtual double InternalGetValue(bool Verify = false, bool IgnoreCache = false);
73 
74  // Get minimum value allowed
75  virtual double InternalGetMin();
76 
77  // Get maximum value allowed
78  virtual double InternalGetMax();
79 
81  virtual bool InternalHasInc();
82 
84  virtual double InternalGetInc();
85 
88 
89  // Get recommended representation
91  {
93  return m_Representation;
94  else
95  return m_Value.GetRepresentation();
96  }
97 
98  // Get the access mode of the node
99  virtual EAccessMode InternalGetAccessMode() const;
100 
103  {
104  return intfIFloat;
105  }
106 
109  {
110  if ( !m_Unit.empty() )
111  return m_Unit;
112  else
113  return m_Value.GetUnit();
114  }
115 
118  {
120  return m_DisplayNotation;
121  else
122  return m_Value.GetDisplayNotation();
123  }
124 
127  {
128  if ( m_DisplayPrecision != -1 )
129  return m_DisplayPrecision;
130  else
131  return m_Value.GetDisplayPrecision();
132  }
133 
135  virtual ECachingMode InternalGetCachingMode() const;
136 
137  public:
139  //-------------------------------------------------------------
140  // Initializing
141  //-------------------------------------------------------------
142  public:
143 
144 
145  virtual void SetProperty( CProperty &Property );
146  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
147 
148 
149  // determine if the conversion function is increasing or decreasing
150  void CheckIncreasing();
151 
152 
153  protected:
155  bool IsMinUninititialized() const;
156 
158  bool IsMaxUninitialized() const;
159 
160  //-------------------------------------------------------------
161  // Member variables
162  //-------------------------------------------------------------
163 
166 
169 
172 
175 
178 
181 
184 
187 
190 
193 
196 
199  };
200 
203  : public BaseT< ValueT< NodeT < FloatT < CConverterImpl > > > >
204  {
205  };
206 }
207 
208 #endif // GENAPI_CONVERTER_H
Definition of the ValueT class template.
CFloatPolyRef m_ConvertFrom
The Swiss Knife for Get.
Definition: Converter.h:177
IFloat interface.
Definition: Types.h:196
GENICAM_NAMESPACE::gcstring m_InputName
The Name of the external Variable.
Definition: Converter.h:171
virtual const double_autovector_t InternalGetListOfValidValues()
Get list of valid value.
class implementing the converter object
Definition: Converter.h:202
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:186
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:198
__int64 int64_t
Definition: config-win32.h:21
CFloatPolyRef m_ConvertTo
The Swiss Knife for Set.
Definition: Converter.h:174
virtual EAccessMode InternalGetAccessMode() const
Get the access mode of the node.
interface GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
Implementation of the IBase interface.
Definition: BaseT.h:48
Definition of the NodeT class template.
IFloat implementation with integrated conversion.
Definition: Converter.h:57
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
CFloatPolyRef m_Value
Reference to the value.
Definition: Converter.h:180
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:189
int64_t GetDisplayPrecision() const
see IFloat
int64_t m_DisplayPrecision
the precision the float is converted with to a string
Definition: Converter.h:192
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
virtual ERepresentation InternalGetRepresentation() const
Definition: Converter.h:90
ERepresentation m_Representation
recommended representation of the value
Definition: Converter.h:183
virtual GENICAM_NAMESPACE::gcstring InternalGetUnit() const
Get the unit.
Definition: Converter.h:108
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:165
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:126
Standard implementation for the INode and the ISelector interface.
Definition: Node.h:85
ESlope m_Slope
indicates if the formula is strictly monotonous increasing or decreating
Definition: Converter.h:195
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
virtual EDisplayNotation InternalGetDisplayNotation() const
Get the way the float should be converted to a string.
Definition: Converter.h:117
enum GENAPI_NAMESPACE::_ESlope ESlope
typedef for formula type
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:168
bool IsMinUninititialized() const
Checks if <Min> has ben set.
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: Converter.h:102
Part of the generic device API.
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 Thu Jun 6 2019 19:10:54