FloatFeature.cpp
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved.
3 
4  Redistribution of this file, in original or modified form, without
5  prior written consent of Allied Vision Technologies is prohibited.
6 
7 -------------------------------------------------------------------------------
8 
9  File: FloatFeature.cpp
10 
11  Description: Implementation of class AVT::VmbAPI::FloatFeature.
12  Intended for use in the implementation of Vimba CPP API.
13 
14 -------------------------------------------------------------------------------
15 
16  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
17  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
18  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
24  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 =============================================================================*/
28 
30 
31 namespace AVT {
32 namespace VmbAPI {
33 
34 FloatFeature::FloatFeature( const VmbFeatureInfo_t *featureInfo, FeatureContainer* const pFeatureContainer )
35  : BaseFeature( featureInfo, pFeatureContainer )
36 {
37 }
38 
39 VmbErrorType FloatFeature::GetValue( double &rfValue ) const
40 {
41  if ( NULL == m_pFeatureContainer )
42  {
43  return VmbErrorDeviceNotOpen;
44  }
45 
47 }
48 
49 VmbErrorType FloatFeature::SetValue( const double &rfValue )
50 {
51  if ( NULL == m_pFeatureContainer )
52  {
53  return VmbErrorDeviceNotOpen;
54  }
55 
57 }
58 
59 VmbErrorType FloatFeature::GetRange( double &rfMinimum, double &rfMaximum ) const
60 {
61  if ( NULL == m_pFeatureContainer )
62  {
63  return VmbErrorDeviceNotOpen;
64  }
65 
66  return (VmbErrorType)VmbFeatureFloatRangeQuery( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(), &rfMinimum, &rfMaximum );
67 }
68 
70 {
71  if ( NULL == m_pFeatureContainer )
72  {
73  return VmbErrorDeviceNotOpen;
74  }
75  VmbBool_t hasIncrement;
77  if( VmbErrorSuccess == Result)
78  {
79  incrementSupported = hasIncrement;
80  return VmbErrorSuccess;
81  }
82  return static_cast<VmbErrorType>( Result);
83 }
84 
85 VmbErrorType FloatFeature::GetIncrement( double &rnIncrement ) const
86 {
87  if ( NULL == m_pFeatureContainer )
88  {
89  return VmbErrorDeviceNotOpen;
90  }
91  VmbBool_t hasIncrement;
92  VmbError_t Result =VmbFeatureFloatIncrementQuery( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(),&hasIncrement, &rnIncrement );
93  if( VmbErrorSuccess == Result && !hasIncrement)
94  {
96  }
97  return static_cast<VmbErrorType>( Result);
98 }
99 
100 }} // namespace AVT::VmbAPI
VmbErrorDeviceNotOpen
@ VmbErrorDeviceNotOpen
Definition: VmbCommonTypes.h:113
AVT::VmbAPI::BaseFeature::m_featureInfo
FeatureInfo m_featureInfo
Definition: BaseFeature.h:106
VmbFeatureFloatSet
IMEXPORTC VmbError_t VMB_CALL VmbFeatureFloatSet(const VmbHandle_t handle, const char *name, double value)
VmbFeatureFloatIncrementQuery
IMEXPORTC VmbError_t VMB_CALL VmbFeatureFloatIncrementQuery(const VmbHandle_t handle, const char *name, VmbBool_t *pHasIncrement, double *pValue)
AVT
Definition: AncillaryData.h:35
VmbErrorType
VmbErrorType
Definition: VmbCommonTypes.h:106
AVT::VmbAPI::FloatFeature::SetValue
virtual IMEXPORT VmbErrorType SetValue(const double &rfValue)
Definition: FloatFeature.cpp:49
AVT::VmbAPI::FloatFeature::GetIncrement
virtual IMEXPORT VmbErrorType GetIncrement(double &increment) const
Definition: FloatFeature.cpp:85
VmbErrorNotImplemented
@ VmbErrorNotImplemented
Definition: VmbCommonTypes.h:125
AVT::VmbAPI::FeatureContainer::GetHandle
VmbHandle_t GetHandle() const
Definition: FeatureContainer.cpp:188
AVT::VmbAPI::BaseFeature::FeatureInfo::name
std::string name
Definition: BaseFeature.h:89
VmbFeatureFloatGet
IMEXPORTC VmbError_t VMB_CALL VmbFeatureFloatGet(const VmbHandle_t handle, const char *name, double *pValue)
VmbFeatureFloatRangeQuery
IMEXPORTC VmbError_t VMB_CALL VmbFeatureFloatRangeQuery(const VmbHandle_t handle, const char *name, double *pMin, double *pMax)
AVT::VmbAPI::BaseFeature
Definition: BaseFeature.h:39
VmbError_t
VmbInt32_t VmbError_t
Definition: VmbCommonTypes.h:130
FloatFeature.h
VmbErrorSuccess
@ VmbErrorSuccess
Definition: VmbCommonTypes.h:108
AVT::VmbAPI::BaseFeature::m_pFeatureContainer
FeatureContainer * m_pFeatureContainer
Definition: BaseFeature.h:108
AVT::VmbAPI::FloatFeature::GetRange
virtual IMEXPORT VmbErrorType GetRange(double &minimum, double &maximum) const
Definition: FloatFeature.cpp:59
AVT::VmbAPI::FloatFeature::FloatFeature
FloatFeature(const VmbFeatureInfo_t *featureInfo, FeatureContainer *const pFeatureContainer)
Definition: FloatFeature.cpp:34
AVT::VmbAPI::FloatFeature::HasIncrement
virtual IMEXPORT VmbErrorType HasIncrement(VmbBool_t &incrementSupported) const
Definition: FloatFeature.cpp:69
AVT::VmbAPI::FeatureContainer
Definition: FeatureContainer.h:40
AVT::VmbAPI::FloatFeature::GetValue
virtual IMEXPORT VmbErrorType GetValue(double &value) const
Definition: FloatFeature.cpp:39
VmbBool_t
char VmbBool_t
Definition: VmbCommonTypes.h:89
VmbFeatureInfo
Definition: VimbaC.h:207


avt_vimba_camera
Author(s): Allied Vision Technologies, Miquel Massot
autogenerated on Sat Jun 3 2023 02:14:12