Skip to content

Pylon::IFloatEx#

Extends the GenApi::IFloat interface with convenience methods.

#include <pylon/FloatParameter.h>

Inherits from GenApi::IFloat, Pylon::IValueEx, GenApi::IValue, GenApi::IBase

Inherited by Pylon::CFloatParameter

Public Functions#

Name
virtual bool TrySetValue(double value)
Sets the value of the parameter if the parameter is writable.
virtual double GetValueOrDefault(double defaultValue)
Gets the value of the parameter if the parameter is readable.
virtual bool TrySetValue(double value, EFloatValueCorrection correction)
Sets the value of the parameter if the parameter is writable and readable.
virtual void SetValue(double value, EFloatValueCorrection correction)
Sets the value of the parameter.
virtual double GetValuePercentOfRange()
Gets the value of the parameter in percent of its value range (from minimum to maximum).
virtual void SetValuePercentOfRange(double percentOfRange)
Sets the value of the parameter to a value within its range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min.
virtual bool TrySetValuePercentOfRange(double percentOfRange)
If the parameter is writable and readable, sets the value of the parameter to a value within its range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min.
virtual void SetToMaximum()
Sets the parameter value to the maximum possible value.
virtual void SetToMinimum()
Sets the parameter value to the minimum possible value.
virtual bool TrySetToMaximum()
Sets the parameter value to the maximum possible value if the parameter is readable and writable.
virtual bool TrySetToMinimum()
Sets the parameter value to the minimum possible value if the parameter is readable and writable.
virtual void GetAlternativeIntegerRepresentation(CIntegerParameter & parameter)
Gets the alternative integer representation of the float parameter, if available.
virtual void SetValue(double Value, bool Verify =true)
Set node value.
virtual double GetValue(bool Verify =false, bool IgnoreCache =false)
Get node value.
virtual double operator()()
Get node value.
virtual double operator*()
Get node value.
virtual double GetMin()
Get minimum value allowed.
virtual double GetMax()
Get maximum value allowed.
virtual bool HasInc()
True if the float has a constant increment.
virtual EIncMode GetIncMode()
Get increment mode.
virtual double GetInc()
Get the constant increment if there is any.
virtual double_autovector_t GetListOfValidValues(bool bounded =true)
Get list of valid value.
virtual ERepresentation GetRepresentation()
Get recommended representation.
virtual GenICam::gcstring GetUnit() const
Get the physical unit name.
virtual EDisplayNotation GetDisplayNotation() const
Get the way the float should be converted to a string.
virtual int64_t GetDisplayPrecision() const
Get the precision to be used when converting the float to a string.
virtual void ImposeMin(double Value)
Restrict minimum value.
virtual void ImposeMax(double Value)
Restrict maximum value.
virtual INode * GetNode()
Get the INode interface of the node.
virtual GenICam::gcstring ToString(bool Verify =false, bool IgnoreCache =false)
Get content of the node as string.
virtual void FromString(const GenICam::gcstring & ValueStr, bool Verify =true)
Set content of the node as string.
virtual bool IsValueCacheValid() const
Checks if the value comes from cache or is requested from another node.
virtual EAccessMode GetAccessMode() const
Get the access mode of the node.
virtual bool IsReadable() const
Indicates whether the parameter is readable.
virtual bool IsWritable() const
Indicates whether the parameter is writable.
virtual bool IsValid() const
Indicates whether a node is attached.
virtual String_t GetInfo(EParameterInfo info)
Gets the parameter information.
virtual String_t GetInfoOrDefault(EParameterInfo info, const String_t defaultInfo)
Gets the parameter information if the parameter is attached to a node.
virtual String_t ToStringOrDefault(const String_t & defaultValue)
Gets the parameter value as string if the parameter is readable.

Additional inherited members#

Public Functions inherited from GenApi::IFloat

Name
virtual IFloat & operator=(double Value)
Set node value.

Public Functions inherited from GenApi::IBase

Name
virtual ~IBase()
Virtual destructor enforcing virtual destructor on all derived classes.

Public Functions Documentation#

TrySetValue#

virtual bool TrySetValue(
    double value
) 

Sets the value of the parameter if the parameter is writable.

Parameters:

  • value The value to set.

Return: Returns false if the parameter is not writable.

Precondition:

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the preconditions are not met or if writing the value fails.

Reimplemented by: Pylon::CFloatParameter::TrySetValue

The value must be in the valid range and the increment must be correct. If the float parameter has an increment, the increment is automatically corrected.

GetValueOrDefault#

virtual double GetValueOrDefault(
    double defaultValue
) 

Gets the value of the parameter if the parameter is readable.

Parameters:

  • defaultValue The default value returned if the parameter is not readable.

Return: Returns the parameter value if the parameter is readable. Otherwise returns the default value.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exception if reading the value fails.

Reimplemented by: Pylon::CFloatParameter::GetValueOrDefault

Otherwise returns the default value.

TrySetValue#

virtual bool TrySetValue(
    double value,
    EFloatValueCorrection correction
) 

Sets the value of the parameter if the parameter is writable and readable.

Parameters:

  • value The value to set.
  • correction The correction method.

Return: Returns false if the parameter is not readable or not writable.

Note: Calls TrySetValue(GenApi::IFloatParameter, double) if correction equals FloatValueCorrection_None.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if writing the value fails.

Reimplemented by: Pylon::CFloatParameter::TrySetValue

The value is automatically corrected if needed.

SetValue#

virtual void SetValue(
    double value,
    EFloatValueCorrection correction
) 

Sets the value of the parameter.

Parameters:

  • value The value to set.
  • correction The correction method.

Note: Calls GenApi::IFloatParameter::SetValue(double) if correction equals FloatValueCorrection_None.

Precondition:

  • The parameter must be writable.
  • The parameter must be readable.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the preconditions are not met or if writing the value fails.

Reimplemented by: Pylon::CFloatParameter::SetValue

The value is automatically corrected if needed.

GetValuePercentOfRange#

virtual double GetValuePercentOfRange() 

Gets the value of the parameter in percent of its value range (from minimum to maximum).

Return: Returns the parameter value in percent of its value range. Returns 100 if minimum equals maximum.

Precondition: The parameter must be readable.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if writing the value fails.

Reimplemented by: Pylon::CFloatParameter::GetValuePercentOfRange

SetValuePercentOfRange#

virtual void SetValuePercentOfRange(
    double percentOfRange
) 

Sets the value of the parameter to a value within its range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min.

Parameters:

  • percentOfRange The percentage of the range to be used in the calculation.

Precondition:

  • The parameter must be writable.
  • The parameter must be readable.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if writing the value fails.

Reimplemented by: Pylon::CFloatParameter::SetValuePercentOfRange

TrySetValuePercentOfRange#

virtual bool TrySetValuePercentOfRange(
    double percentOfRange
) 

If the parameter is writable and readable, sets the value of the parameter to a value within its range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min.

Parameters:

  • percentOfRange The percentage of the range used in the calculation. Valid values are in the range of 0 to 100.

Return: Returns true if the value has been set.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if writing the value fails.

Reimplemented by: Pylon::CFloatParameter::TrySetValuePercentOfRange

SetToMaximum#

virtual void SetToMaximum() 

Sets the parameter value to the maximum possible value.

Precondition:

  • The parameter must be writable.
  • The parameter must be readable.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the parameter is not writable, not readable, or if reading or writing fails.

Reimplemented by: Pylon::CFloatParameter::SetToMaximum

SetToMinimum#

virtual void SetToMinimum() 

Sets the parameter value to the minimum possible value.

Precondition:

  • The parameter must be writable.
  • The parameter must be readable.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the parameter is not writable, not readable, or if reading or writing fails.

Reimplemented by: Pylon::CFloatParameter::SetToMinimum

TrySetToMaximum#

virtual bool TrySetToMaximum() 

Sets the parameter value to the maximum possible value if the parameter is readable and writable.

Return: Returns true if the maximum value has been set.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if reading or writing fails.

Reimplemented by: Pylon::CFloatParameter::TrySetToMaximum

TrySetToMinimum#

virtual bool TrySetToMinimum() 

Sets the parameter value to the minimum possible value if the parameter is readable and writable.

Return: Returns true if the minimum value has been set.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if reading or writing fails.

Reimplemented by: Pylon::CFloatParameter::TrySetToMinimum

GetAlternativeIntegerRepresentation#

virtual void GetAlternativeIntegerRepresentation(
    CIntegerParameter & parameter
) 

Gets the alternative integer representation of the float parameter, if available.

Parameters:

  • parameter The integer representation returned. The returned value will be empty if no alternative representation is available.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions.

Reimplemented by: Pylon::CFloatParameter::GetAlternativeIntegerRepresentation

The alternative integer representation is typically used if a parameter is represented as a float value in the node map, but as an integer register in the camera device.

SetValue#

virtual void SetValue(
    double Value,
    bool Verify =true
) 

Set node value.

Parameters:

  • Value The value to set
  • Verify Enables AccessMode and Range verification (default = true)

Reimplemented by: Pylon::CFloatParameter::SetValue

GetValue#

virtual double GetValue(
    bool Verify =false,
    bool IgnoreCache =false
) 

Get node value.

Parameters:

  • Verify Enables Range verification (default = false). The AccessMode is always checked
  • IgnoreCache If true the value is read ignoring any caches (default = false)

Return: The value read

Reimplemented by: Pylon::CFloatParameter::GetValue

operator()#

virtual double operator()() 

Get node value.

Reimplemented by: Pylon::CFloatParameter::operator()

operator*#

virtual double operator*() 

Get node value.

Reimplemented by: Pylon::CFloatParameter::operator*

GetMin#

virtual double GetMin() 

Get minimum value allowed.

Reimplemented by: Pylon::CFloatParameter::GetMin

GetMax#

virtual double GetMax() 

Get maximum value allowed.

Reimplemented by: Pylon::CFloatParameter::GetMax

HasInc#

virtual bool HasInc() 

True if the float has a constant increment.

Reimplemented by: Pylon::CFloatParameter::HasInc

GetIncMode#

virtual EIncMode GetIncMode() 

Get increment mode.

Reimplemented by: Pylon::CFloatParameter::GetIncMode

GetInc#

virtual double GetInc() 

Get the constant increment if there is any.

Reimplemented by: Pylon::CFloatParameter::GetInc

GetListOfValidValues#

virtual double_autovector_t GetListOfValidValues(
    bool bounded =true
) 

Get list of valid value.

Reimplemented by: Pylon::CFloatParameter::GetListOfValidValues

GetRepresentation#

virtual ERepresentation GetRepresentation() 

Get recommended representation.

Reimplemented by: Pylon::CFloatParameter::GetRepresentation

GetUnit#

virtual GenICam::gcstring GetUnit() const 

Get the physical unit name.

Reimplemented by: Pylon::CFloatParameter::GetUnit

GetDisplayNotation#

virtual EDisplayNotation GetDisplayNotation() const 

Get the way the float should be converted to a string.

Reimplemented by: Pylon::CFloatParameter::GetDisplayNotation

GetDisplayPrecision#

virtual int64_t GetDisplayPrecision() const 

Get the precision to be used when converting the float to a string.

Reimplemented by: Pylon::CFloatParameter::GetDisplayPrecision

ImposeMin#

virtual void ImposeMin(
    double Value
) 

Restrict minimum value.

Reimplemented by: Pylon::CFloatParameter::ImposeMin

ImposeMax#

virtual void ImposeMax(
    double Value
) 

Restrict maximum value.

Reimplemented by: Pylon::CFloatParameter::ImposeMax

GetNode#

inline virtual INode * GetNode()

Get the INode interface of the node.

Reimplemented by: Pylon::CArrayParameter::GetNode

ToString#

virtual GenICam::gcstring ToString(
    bool Verify =false,
    bool IgnoreCache =false
) 

Get content of the node as string.

Parameters:

  • Verify Enables Range verification (default = false). The AccessMode is always checked
  • IgnoreCache If true the value is read ignoring any caches (default = false)

Return: The value read

Reimplemented by: Pylon::CArrayParameter::ToString

FromString#

virtual void FromString(
    const GenICam::gcstring & ValueStr,
    bool Verify =true
) 

Set content of the node as string.

Parameters:

  • ValueStr The value to set
  • Verify Enables AccessMode and Range verification (default = true)

Reimplemented by: Pylon::CArrayParameter::FromString

IsValueCacheValid#

virtual bool IsValueCacheValid() const 

Checks if the value comes from cache or is requested from another node.

Reimplemented by: Pylon::CArrayParameter::IsValueCacheValid

GetAccessMode#

virtual EAccessMode GetAccessMode() const 

Get the access mode of the node.

Reimplemented by: Pylon::CArrayParameter::GetAccessMode

IsReadable#

virtual bool IsReadable() const 

Indicates whether the parameter is readable.

Return: Returns true if the parameter is readable.

Error Safety:

Does not throw C++ exceptions.

Reimplemented by: Pylon::CArrayParameter::IsReadable

IsWritable#

virtual bool IsWritable() const 

Indicates whether the parameter is writable.

Return: Returns true if the parameter is writable.

Error Safety:

Does not throw C++ exceptions.

Reimplemented by: Pylon::CArrayParameter::IsWritable

IsValid#

virtual bool IsValid() const 

Indicates whether a node is attached.

Return: Returns true if a node is attached.

Error Safety:

Does not throw C++ exceptions.

Reimplemented by: Pylon::CArrayParameter::IsValid, Pylon::CCommandParameter::IsValid, Pylon::CBooleanParameter::IsValid, Pylon::CStringParameter::IsValid, Pylon::CParameter::IsValid, Pylon::CEnumParameter::IsValid, Pylon::CIntegerParameter::IsValid, Pylon::CFloatParameter::IsValid

GetInfo#

virtual String_t GetInfo(
    EParameterInfo info
) 

Gets the parameter information.

Parameters:

  • info The type information to return.

Return: Returns the parameter information.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Throws an exception if no node is attached. Can throw exceptions if the retrieval of the information fails.

Reimplemented by: Pylon::CArrayParameter::GetInfo

GetInfoOrDefault#

virtual String_t GetInfoOrDefault(
    EParameterInfo info,
    const String_t defaultInfo
) 

Gets the parameter information if the parameter is attached to a node.

Parameters:

  • info The type information to return. Otherwise returns the default information. This method is useful if you want to display parameter information and handle the case that some parameters are not available for a device.
  • defaultInfo The default information returned if the parameter is not attached to a node.

Return: Returns the parameter information if the parameter is attached to a node. Otherwise returns the default information.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the retrieval of the information fails.

Reimplemented by: Pylon::CArrayParameter::GetInfoOrDefault

See IsValid().

ToStringOrDefault#

virtual String_t ToStringOrDefault(
    const String_t & defaultValue
) 

Gets the parameter value as string if the parameter is readable.

Parameters:

  • defaultValue The default value returned if the parameter is not readable.

Return: Returns the parameter value if the parameter is readable. Otherwise returns the default value.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if reading the value fails.

Reimplemented by: Pylon::CArrayParameter::ToStringOrDefault

Otherwise returns the default value.


Updated on 5 July 2022 at 15:30:00