IIntegerParameterExtensions Class#
Inheritance Hierarchy#
System.Object
Basler.Pylon.IIntegerParameterExtensions
Syntax#
C#
VB
The IIntegerParameterExtensions 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): ((maxRange - minRange) * (percentOfRange / 100.0)) + minRange. The computed value is always corrected to the nearest valid value. | |
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(IIntegerParameter, Int64) | Sets the value passed if the parameter is writable. The value must be in the valid range and the increment must be correct. | |
TrySetValue(IIntegerParameter, Int64, IntegerValueCorrection) | 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, the provided value in percentage of range (simplified): ((max - min) * (percentOfRange / 100.0)) + min is set. The computed value is always corrected to the nearest valid value. |
IIntegerParameterExtensions.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 IIntegerParameter,
defaultValue As Long
) As Long
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
The interface of the parameter. - defaultValue
- Type: System.Int64
The default value returned if the parameter is not readable.
Return Value#
Type: Int64
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 IIntegerParameter. 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.
IIntegerParameterExtensions.GetValuePercentOfRange Method#
Returns the current value in percent of minimum/maximum range.
Syntax#
C#
VB
<ExtensionAttribute>
Public Shared Function GetValuePercentOfRange (
parameter As IIntegerParameter
) As Double
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
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 IIntegerParameter. 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.
IIntegerParameterExtensions.SetToMaximum Method#
Sets the parameter value to the maximum possible value.
Syntax#
C#
VB
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
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 IIntegerParameter. 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.
IIntegerParameterExtensions.SetToMinimum Method#
Sets the parameter value to the minimum possible value.
Syntax#
C#
VB
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
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 IIntegerParameter. 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.
IIntegerParameterExtensions.SetValue Method#
Sets the provided value. The value is automatically corrected if needed.
Syntax#
C#
public static void SetValue(
this IIntegerParameter parameter,
long value,
IntegerValueCorrection correction
)
VB
<ExtensionAttribute>
Public Shared Sub SetValue (
parameter As IIntegerParameter,
value As Long,
correction As IntegerValueCorrection
)
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
The interface of the parameter. - value
- Type: System.Int64
The value to set. - correction
- Type: Basler.Pylon.IntegerValueCorrection
The correction method.
Usage Note#
In Visual Basic and C#, you can call this method as an instance method on any object of type IIntegerParameter. 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(Int64) if correction equals IntegerValueCorrection.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.
IIntegerParameterExtensions.SetValuePercentOfRange Method#
Sets the provided value to a value within the range, using this formula (simplified): ((maxRange - minRange) * (percentOfRange / 100.0)) + minRange. The computed value is always corrected to the nearest valid value.
Syntax#
C#
public static void SetValuePercentOfRange(
this IIntegerParameter parameter,
double percentOfRange
)
VB
<ExtensionAttribute>
Public Shared Sub SetValuePercentOfRange (
parameter As IIntegerParameter,
percentOfRange As Double
)
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
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 IIntegerParameter. 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#
The parameter must be writable.
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.
IIntegerParameterExtensions.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 IIntegerParameter
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
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 IIntegerParameter. 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.
IIntegerParameterExtensions.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 IIntegerParameter
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
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 IIntegerParameter. 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.
IIntegerParameterExtensions.TrySetValue Method (IIntegerParameter, Int64)#
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 IIntegerParameter,
value As Long
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
The interface of the parameter. - value
- Type: System.Int64
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 IIntegerParameter. 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 passed value must be >= GetMinimum().
- The passed value must be <= GetMaximum().
- The passed value must be aligned to the increment returned by GetIncrement().
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.
IIntegerParameterExtensions.TrySetValuePercentOfRange Method#
If the parameter is writable and readable, the provided value in percentage of range (simplified): ((max - min) * (percentOfRange / 100.0)) + min is set. The computed value is always corrected to the nearest valid value.
Syntax#
C#
public static bool TrySetValuePercentOfRange(
this IIntegerParameter parameter,
double percentOfRange
)
VB
<ExtensionAttribute>
Public Shared Function TrySetValuePercentOfRange (
parameter As IIntegerParameter,
percentOfRange As Double
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
The interface of the parameter. - percentOfRange
- Type: System.Double
Percent of min/max range.
Return Value#
Type: Boolean
Returns true if the a 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 IIntegerParameter. 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.
IIntegerParameterExtensions.TrySetValue Method (IIntegerParameter, Int64, IntegerValueCorrection)#
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 IIntegerParameter parameter,
long value,
IntegerValueCorrection correction
)
VB
<ExtensionAttribute>
Public Shared Function TrySetValue (
parameter As IIntegerParameter,
value As Long,
correction As IntegerValueCorrection
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IIntegerParameter
The interface of the parameter. - value
- Type: System.Int64
The value to set. - correction
- Type: Basler.Pylon.IntegerValueCorrection
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 IIntegerParameter. 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(IIntegerParameter, Int64) if correction equals IntegerValueCorrection.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.
IIntegerParameterExtensions.TrySetValue Method#
Overload List#
Name | Description | |
---|---|---|
TrySetValue(IIntegerParameter, Int64) | Sets the value passed if the parameter is writable. The value must be in the valid range and the increment must be correct. | |
TrySetValue(IIntegerParameter, Int64, IntegerValueCorrection) | Sets the provided value if the parameter is writable and readable. The value is automatically corrected if needed. |