Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031 #ifndef GENAPI_SWISSKNIFE_H
00032 #define GENAPI_SWISSKNIFE_H
00033
00034 #include "../IFloat.h"
00035 #include "Node.h"
00036 #include "MathParser/MathParser.h"
00037 #include "BaseT.h"
00038 #include "ValueT.h"
00039 #include "NodeT.h"
00040 #include "FloatT.h"
00041
00042 namespace GENAPI_NAMESPACE
00043 {
00044
00045
00046
00047
00056 class CSwissKnifeImpl : public IFloat, public CNodeImpl
00057 {
00058 public:
00060 CSwissKnifeImpl();
00061
00063 virtual ~CSwissKnifeImpl();
00064
00065 protected:
00066
00067
00068
00069
00070
00071 virtual EAccessMode InternalGetAccessMode() const;
00072
00074 virtual EInterfaceType InternalGetPrincipalInterfaceType() const
00075 {
00076 return intfIFloat;
00077 }
00078
00079
00080 public:
00081
00082
00083
00084
00086
00087 virtual double GetValueWithInput(double input, bool Verify = false, bool IgnoreCache = false);
00088
00089 protected:
00090
00091
00092
00093
00094
00095 #pragma BullseyeCoverage off
00096 virtual void InternalSetValue(double , bool )
00097 {
00098 throw LOGICAL_ERROR_EXCEPTION_NODE("SwissKnife : %s SetValue failed. SwissKnife is read only", m_Name.c_str() );
00099 }
00100 #pragma BullseyeCoverage on
00101
00102
00103 virtual double InternalGetValue(bool Verify = false, bool IgnoreCache = false);
00104
00105
00106 virtual double InternalGetMin()
00107 {
00108 return m_Min;
00109 }
00110
00111
00112 virtual double InternalGetMax()
00113 {
00114 return m_Max;
00115 }
00116
00118 virtual bool InternalHasInc()
00119 {
00120
00121 return false;
00122 }
00123
00125 #pragma BullseyeCoverage off
00126
00127 virtual double InternalGetInc()
00128 {
00129 assert(false);
00130 return -1.0;
00131 }
00132 #pragma BullseyeCoverage on
00133
00135 const virtual double_autovector_t InternalGetListOfValidValues()
00136 {
00137 return double_autovector_t();
00138 }
00139
00140
00141
00142 virtual ERepresentation InternalGetRepresentation()
00143 {
00144 if( m_Representation != _UndefinedRepresentation )
00145 return m_Representation;
00146 else
00147 return PureNumber;
00148 }
00149
00150
00151 virtual GENICAM_NAMESPACE::gcstring InternalGetUnit() const
00152 {
00153 return m_Unit;
00154 }
00155
00157 virtual EDisplayNotation InternalGetDisplayNotation() const
00158 {
00159 return m_DisplayNotation;
00160 }
00161
00163 virtual int64_t InternalGetDisplayPrecision() const
00164 {
00165 return m_DisplayPrecision;
00166 }
00167
00169 virtual ECachingMode InternalGetCachingMode() const;
00170
00171 public:
00172
00173
00174
00175
00176 virtual void FinalConstruct();
00177
00178 virtual void SetProperty( CProperty &Property );
00179
00180 virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
00181 virtual void Parse();
00182
00183 protected:
00184
00185
00186
00187
00188
00190 double m_Min;
00191
00193 double m_Max;
00194
00196 GENICAM_NAMESPACE::gcstring m_Formula;
00197
00199 std::map<GENICAM_NAMESPACE::gcstring, GENICAM_NAMESPACE::gcstring> m_Symbolics;
00200
00202 std::map<GENICAM_NAMESPACE::gcstring, CFloatPolyRef> m_Variables;
00203
00205 CStrMap m_VariableMap;
00206
00208 CMathParser m_MathParser;
00209
00211 ERepresentation m_Representation;
00212
00214 GENICAM_NAMESPACE::gcstring m_Unit;
00215
00217 EDisplayNotation m_DisplayNotation;
00218
00220 int64_t m_DisplayPrecision;
00221
00223
00224 GENICAM_NAMESPACE::gcstring m_InputName;
00225
00227 GENAPI_NAMESPACE::EInputDirection m_InputDirection;
00228
00230 CFloatPolyRef m_Input;
00231
00232 };
00233
00234 class CSwissKnife : public BaseT< ValueT< NodeT< FloatT< CSwissKnifeImpl > > > >
00235 {
00236 };
00237
00238 }
00239
00240 #endif // GENAPI_SWISSKNIFE_H