FltReg.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: Margret Albrecht
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_FLTREG_H
32 #define GENAPI_FLTREG_H
33 
34 #include "../IFloat.h"
35 #include "FloatT.h"
36 #include "Register.h"
37 
38 namespace GENAPI_NAMESPACE
39 {
40  //*************************************************************
41  // CFltReg class
42  //*************************************************************
43 
45  class CFltRegImpl : public IFloat, public CRegisterImpl
46  {
47  public:
49  CFltRegImpl();
50 
51  protected:
52 
55  {
56  return intfIFloat;
57  }
58 
59  //-------------------------------------------------------------
60  // IRegister implementation
61  //-------------------------------------------------------------
62 
64  virtual int64_t InternalGetLength(bool Verify = false);
65 
66  //-------------------------------------------------------------
67  // IFloat implementation
68  //-------------------------------------------------------------
69 
71  virtual void InternalSetValue(double dblValue, bool Verify = true);
72 
74  virtual double InternalGetValue(bool Verify = false, bool IgnoreCache = false);
75 
77  virtual double InternalGetMin() ;
78 
80  virtual double InternalGetMax() ;
81 
83  virtual bool InternalHasInc()
84  {
85  // a swiss knife does not know about its increments
86  return false;
87  }
88 
91  {
92  return double_autovector_t();
93  }
94 
96  #pragma BullseyeCoverage off
97  // (untestable, function never called)
98  virtual double InternalGetInc()
99  {
100  assert(false);
101  return -1.0;
102  }
103  #pragma BullseyeCoverage on
104 
105 
108  {
110  return m_Representation;
111  else
112  return PureNumber;
113  }
114 
117  {
118  return m_Unit;
119  }
120 
123  {
124  return m_DisplayNotation;
125  }
126 
129  {
130  return m_DisplayPrecision;
131  }
132 
133  //-------------------------------------------------------------
134  // Initializing
135  //-------------------------------------------------------------
136  public:
137 
138  virtual void SetProperty( CProperty &Property );
139  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
140 
141  protected:
143  void ReadReg(uint8_t* ValueBytes, bool Verify = false, bool IgnoreCache = false);
144 
146  void WriteReg(uint8_t* pValueBytes, bool Verify = true);
147 
148  //-------------------------------------------------------------
149  // Memeber variables
150  //-------------------------------------------------------------
151 
154 
157 
160 
163 
166 
167  };
168 
170  class CFltReg
171  : public BaseT< ValueT< FloatT < RegisterT < NodeT< CFltRegImpl > > > > >
172  {
173  };
174 }
175 
176 #endif // GENAPI_FLTREG_H
IFloat interface.
Definition: Types.h:196
virtual bool InternalHasInc()
True if the float has a constant increment.
Definition: FltReg.h:83
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
virtual double InternalGetMin()
Get minimum value allowed.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
enum GENAPI_NAMESPACE::_EEndianess EEndianess
Endianess of a value in a register.
Definition of CRegister.
int64_t m_DisplayPrecision
the precision the float is converted with to a string
Definition: FltReg.h:165
virtual double InternalGetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
virtual int64_t InternalGetDisplayPrecision() const
Get the precision to be used when converting the float to a string.
Definition: FltReg.h:128
Decimal number in an edit control.
Definition: Types.h:94
Vector of doubles with reference counting.
Definition: Autovector.h:76
__int64 int64_t
Definition: config-win32.h:21
virtual void InternalSetValue(double dblValue, bool Verify=true)
Set node value.
virtual int64_t InternalGetLength(bool Verify=false)
Retrieves the Length of the register [Bytes].
void WriteReg(uint8_t *pValueBytes, bool Verify=true)
helper to handle the register access incl. swapping
virtual ERepresentation InternalGetRepresentation() const
Get recommended representation.
Definition: FltReg.h:107
the clkass implementing the FltReg node
Definition: FltReg.h:170
virtual void SetProperty(CProperty &Property)
virtual GENICAM_NAMESPACE::gcstring InternalGetUnit() const
Get the unit.
Definition: FltReg.h:116
virtual const double_autovector_t InternalGetListOfValidValues()
Get list of valid value.
Definition: FltReg.h:90
Implementation of the IBase interface.
Definition: BaseT.h:48
EDisplayNotation m_DisplayNotation
the printf format specifier used to convert the float number to a string
Definition: FltReg.h:162
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
Standard IRegister implementation Provides a chunk of memory which acts as a proxy to the register...
Definition: Register.h:59
enum GENAPI_NAMESPACE::_EDisplayNotation EDisplayNotation
typedef for float notation
EEndianess m_Endianess
endianess of the register
Definition: FltReg.h:156
IFloat implementation for a register.
Definition: FltReg.h:45
void ReadReg(uint8_t *ValueBytes, bool Verify=false, bool IgnoreCache=false)
helper to handle the register access incl. swapping
virtual double InternalGetInc()
Get the constant increment if there is any.
Definition: FltReg.h:98
virtual double InternalGetMax()
Get maximum value allowed.
A string class which is a clone of std::string.
Definition: GCString.h:52
ERepresentation m_Representation
The float&#39;s reprsentation.
Definition: FltReg.h:153
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: FltReg.h:54
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IFloat
Interface for float properties.
Definition: IFloat.h:60
GENICAM_NAMESPACE::gcstring m_Unit
the physical unit name
Definition: FltReg.h:159
Definition of the FloatT class template.
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
virtual EDisplayNotation InternalGetDisplayNotation() const
Get the way the float should be converted to a string.
Definition: FltReg.h:122


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