IFloatParameterExtensions Class#
Inheritance Hierarchy#
System.Object
Basler.Pylon.IFloatParameterExtensions
Syntax#
C#
VB
The IFloatParameterExtensions type exposes the following members.
Methods#
Name | Description | |
---|---|---|
GetValueOrDefault | Gets the parameter value if the parameter is readable. Otherwise, returns the default value. | |
GetValuePercentOfRange | Returns the current value in percent of minimum/maximum range. | |
SetToMaximum | Sets the parameter value to the maximum possible value. | |
SetToMinimum | Sets the parameter value to the minimum possible value. | |
SetValue | Sets the provided value. The value is automatically corrected if needed. | |
SetValuePercentOfRange | Sets the provided value to a value within the range, using this formula (simplified): ((max - min) * (percentOfRange / 100.0)) + min. | |
TrySetToMaximum | Sets the parameter value to the maximum possible value if the parameter is readable and writable. | |
TrySetToMinimum | Sets the parameter value to the minimum possible value if the parameter is readable and writable. | |
TrySetValue(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. | |
TrySetValue(IFloatParameter, Double, FloatValueCorrection) | Sets the provided value if the parameter is writable and readable. The value is automatically corrected if needed. | |
TrySetValuePercentOfRange | 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#
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#
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#
VB
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#
VB
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 |
---|
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#
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#
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#
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#
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 |
---|
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#
Name | Description | |
---|---|---|
TrySetValue(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. | |
TrySetValue(IFloatParameter, Double, FloatValueCorrection) | Sets the provided value if the parameter is writable and readable. The value is automatically corrected if needed. |