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
00025
00026
00027
00028
00029 #include <VimbaCPP/Source/FloatFeature.h>
00030
00031 namespace AVT {
00032 namespace VmbAPI {
00033
00034 FloatFeature::FloatFeature( const VmbFeatureInfo_t *featureInfo, FeatureContainer* const pFeatureContainer )
00035 : BaseFeature( featureInfo, pFeatureContainer )
00036 {
00037 }
00038
00039 VmbErrorType FloatFeature::GetValue( double &rfValue ) const
00040 {
00041 if ( NULL == m_pFeatureContainer )
00042 {
00043 return VmbErrorDeviceNotOpen;
00044 }
00045
00046 return (VmbErrorType)VmbFeatureFloatGet( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(), &rfValue );
00047 }
00048
00049 VmbErrorType FloatFeature::SetValue( const double &rfValue )
00050 {
00051 if ( NULL == m_pFeatureContainer )
00052 {
00053 return VmbErrorDeviceNotOpen;
00054 }
00055
00056 return (VmbErrorType)VmbFeatureFloatSet( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(), rfValue );
00057 }
00058
00059 VmbErrorType FloatFeature::GetRange( double &rfMinimum, double &rfMaximum ) const
00060 {
00061 if ( NULL == m_pFeatureContainer )
00062 {
00063 return VmbErrorDeviceNotOpen;
00064 }
00065
00066 return (VmbErrorType)VmbFeatureFloatRangeQuery( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(), &rfMinimum, &rfMaximum );
00067 }
00068
00069 VmbErrorType FloatFeature::HasIncrement( VmbBool_t &incrementSupported ) const
00070 {
00071 if ( NULL == m_pFeatureContainer )
00072 {
00073 return VmbErrorDeviceNotOpen;
00074 }
00075 VmbBool_t hasIncrement;
00076 VmbError_t Result =VmbFeatureFloatIncrementQuery( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(),&hasIncrement, NULL );
00077 if( VmbErrorSuccess == Result)
00078 {
00079 incrementSupported = hasIncrement;
00080 return VmbErrorSuccess;
00081 }
00082 return static_cast<VmbErrorType>( Result);
00083 }
00084
00085 VmbErrorType FloatFeature::GetIncrement( double &rnIncrement ) const
00086 {
00087 if ( NULL == m_pFeatureContainer )
00088 {
00089 return VmbErrorDeviceNotOpen;
00090 }
00091 VmbBool_t hasIncrement;
00092 VmbError_t Result =VmbFeatureFloatIncrementQuery( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(),&hasIncrement, &rnIncrement );
00093 if( VmbErrorSuccess == Result && !hasIncrement)
00094 {
00095 return VmbErrorNotImplemented;
00096 }
00097 return static_cast<VmbErrorType>( Result);
00098 }
00099
00100 }}