Skip to content

IFloatParameterExtensions Class#

Extension class for the float parameter interface.

Inheritance Hierarchy#

System.Object
  Basler.Pylon.IFloatParameterExtensions

Syntax#

C#

public static class IFloatParameterExtensions

VB

<ExtensionAttribute>
Public NotInheritable Class IFloatParameterExtensions

The IFloatParameterExtensions type exposes the following members.

Methods#

 NameDescription
Public methodStatic memberGetValueOrDefault Gets the parameter value if the parameter is readable. Otherwise, returns the default value.
Public methodStatic memberGetValuePercentOfRange Returns the current value in percent of minimum/maximum range.
Public methodStatic memberSetToMaximum Sets the parameter value to the maximum possible value.
Public methodStatic memberSetToMinimum Sets the parameter value to the minimum possible value.
Public methodStatic memberSetValue Sets the provided value. The value is automatically corrected if needed.
Public methodStatic memberSetValuePercentOfRange Sets the provided value to a value within the range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min.
Public methodStatic memberTrySetToMaximum Sets the parameter value to the maximum possible value if the parameter is readable and writable.
Public methodStatic memberTrySetToMinimum Sets the parameter value to the minimum possible value if the parameter is readable and writable.
Public methodStatic memberTrySetValue(IFloatParameter, Double) Sets the value passed if the parameter is writable. The value must be in the valid range and the increment must be correct.
Public methodStatic memberTrySetValue(IFloatParameter, Double, FloatValueCorrection) Sets the provided value if the parameter is writable and readable. The value is automatically corrected if needed.
Public methodStatic memberTrySetValuePercentOfRange If the parameter is writable and readable, sets the value passed to a value within the range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min
 

IFloatParameterExtensions.GetValueOrDefault Method#

Gets the parameter value if the parameter is readable. Otherwise, returns the default value.

Syntax#

C#

public static double GetValueOrDefault(
    this IFloatParameter parameter,
    double defaultValue
)

VB

<ExtensionAttribute>
Public Shared Function GetValueOrDefault ( 
    parameter As IFloatParameter,
    defaultValue As Double
) As Double

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
defaultValue
Type: System.Double
The default value returned if the parameter is not readable.
Return Value#

Type: Double
Returns the parameter value if the parameter is readable. Otherwise, returns the default value.

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exception if reading the value fails.

IFloatParameterExtensions.GetValuePercentOfRange Method#

Returns the current value in percent of minimum/maximum range.

Syntax#

C#

public static double GetValuePercentOfRange(
    this IFloatParameter parameter
)

VB

<ExtensionAttribute>
Public Shared Function GetValuePercentOfRange ( 
    parameter As IFloatParameter
) As Double

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
Return Value#

Type: Double
Returns the current value in percent of minimum/maximum range. Returns 100 if minimum equals maximum.

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Preconditions: The parameter must be readable.

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exceptions if writing the value fails.

IFloatParameterExtensions.SetToMaximum Method#

Sets the parameter value to the maximum possible value.

Syntax#

C#

public static void SetToMaximum(
    this IFloatParameter parameter
)

VB

<ExtensionAttribute>
Public Shared Sub SetToMaximum ( 
    parameter As IFloatParameter
)

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Preconditions:
 

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

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

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

IFloatParameterExtensions.SetToMinimum Method#

Sets the parameter value to the minimum possible value.

Syntax#

C#

public static void SetToMinimum(
    this IFloatParameter parameter
)

VB

<ExtensionAttribute>
Public Shared Sub SetToMinimum ( 
    parameter As IFloatParameter
)

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Preconditions:
 

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

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

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

IFloatParameterExtensions.SetValue Method#

Sets the provided value. The value is automatically corrected if needed.

Syntax#

C#

public static void SetValue(
    this IFloatParameter parameter,
    double value,
    FloatValueCorrection correction
)

VB

<ExtensionAttribute>
Public Shared Sub SetValue ( 
    parameter As IFloatParameter,
    value As Double,
    correction As FloatValueCorrection
)

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
value
Type: System.Double
The value to set.
correction
Type: Basler.Pylon.FloatValueCorrection
The correction method.
Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Preconditions:
 

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

Caution Caution
Calls SetValue(Double) if correction equals FloatValueCorrection.None.
 

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

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

IFloatParameterExtensions.SetValuePercentOfRange Method#

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

Syntax#

C#

public static void SetValuePercentOfRange(
    this IFloatParameter parameter,
    double percentOfRange
)

VB

<ExtensionAttribute>
Public Shared Sub SetValuePercentOfRange ( 
    parameter As IFloatParameter,
    percentOfRange As Double
)

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
percentOfRange
Type: System.Double
The percentage of the range to be used in the calculation.
Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Preconditions:
 

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

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exceptions if writing the value fails.

IFloatParameterExtensions.TrySetToMaximum Method#

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

Syntax#

C#

public static bool TrySetToMaximum(
    this IFloatParameter parameter
)

VB

<ExtensionAttribute>
Public Shared Function TrySetToMaximum ( 
    parameter As IFloatParameter
) As Boolean

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
Return Value#

Type: Boolean
Returns true if the maximum value has been set.

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exceptions if reading or writing fails.

IFloatParameterExtensions.TrySetToMinimum Method#

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

Syntax#

C#

public static bool TrySetToMinimum(
    this IFloatParameter parameter
)

VB

<ExtensionAttribute>
Public Shared Function TrySetToMinimum ( 
    parameter As IFloatParameter
) As Boolean

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
Return Value#

Type: Boolean
Returns true if the minimum value has been set.

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exceptions if reading or writing fails.

IFloatParameterExtensions.TrySetValue Method (IFloatParameter, Double)#

Sets the value passed if the parameter is writable. The value must be in the valid range and the increment must be correct.

Syntax#

C#

public static bool TrySetValue(
    this IFloatParameter parameter,
    double value
)

VB

<ExtensionAttribute>
Public Shared Function TrySetValue ( 
    parameter As IFloatParameter,
    value As Double
) As Boolean

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
value
Type: System.Double
The value to set.
Return Value#

Type: Boolean
Returns false if the parameter is not writable.

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

If the float parameter has an increment, the increment is automatically corrected.

Preconditions:
 

  • The passed value must be >= GetMinimum().
  • The passed value must be <= GetMaximum().

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

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

IFloatParameterExtensions.TrySetValuePercentOfRange Method#

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

Syntax#

C#

public static bool TrySetValuePercentOfRange(
    this IFloatParameter parameter,
    double percentOfRange
)

VB

<ExtensionAttribute>
Public Shared Function TrySetValuePercentOfRange ( 
    parameter As IFloatParameter,
    percentOfRange As Double
) As Boolean

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
percentOfRange
Type: System.Double
The percentage of the range used in the calculation. Valid values are in the range of 0 to 100.
Return Value#

Type: Boolean
Returns true if the value has been set.

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exceptions if writing the value fails.

IFloatParameterExtensions.TrySetValue Method (IFloatParameter, Double, FloatValueCorrection)#

Sets the provided value if the parameter is writable and readable. The value is automatically corrected if needed.

Syntax#

C#

public static bool TrySetValue(
    this IFloatParameter parameter,
    double value,
    FloatValueCorrection correction
)

VB

<ExtensionAttribute>
Public Shared Function TrySetValue ( 
    parameter As IFloatParameter,
    value As Double,
    correction As FloatValueCorrection
) As Boolean

Parameters#
parameter
Type: Basler.Pylon.IFloatParameter
The interface of the parameter.
value
Type: System.Double
The value to set.
correction
Type: Basler.Pylon.FloatValueCorrection
The correction method.
Return Value#

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

Usage Note#

In Visual Basic and C#, you can call this method as an instance method on any object of type IFloatParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks#

Caution Caution
Calls TrySetValue(IFloatParameter, Double) if correction equals FloatValueCorrection.None.
 

Thread Safety: This method is synchronized with the source of the parameter collection, if any.

Error Safety: Can throw exceptions if writing the value fails.

IFloatParameterExtensions.TrySetValue Method#

Overload List#

 NameDescription
Public methodStatic memberTrySetValue(IFloatParameter, Double) Sets the value passed if the parameter is writable. The value must be in the valid range and the increment must be correct.
Public methodStatic memberTrySetValue(IFloatParameter, Double, FloatValueCorrection) Sets the provided value if the parameter is writable and readable. The value is automatically corrected if needed.