eVision Python API
Loading...
Searching...
No Matches
eVision.EIntegerRange Class Reference

Represents a range of integer values. More...

Public Member Functions

None __init__ (self)
 Creates an eVision.EIntegerRange.__init__ object.
None __init__ (self, int min, int max)
 Creates an eVision.EIntegerRange.__init__ object.
None __init__ (self, eVision.EIntegerRange range)
 Creates an eVision.EIntegerRange.__init__ object.
None SetBounds (self, int min, int max)
 Sets the bounds of the range.
None SetFromBaseAndAbsoluteTolerance (self, int baseValue, int tolerance)
 Sets the bounds of the range from a base value and an absolute tolerance from this base value.
None SetFromBaseAndRelativeTolerance (self, int baseValue, float tolerance)
 Sets the bounds of the range from a base value and a relative tolerance from this base value.
None Update (self, int value)
 Updates the range.
bool IsInRange (self, float value, bool lowerBoundInclusive, bool upperBoundInclusive)
 Checks if a value is inside the range.
bool IsInRange (self, float value, bool lowerBoundInclusive)
 Checks if a value is inside the range.
bool IsInRange (self, float value)
 Checks if a value is inside the range.
int LowerBound (self)
 Lower bound of the range.
int UpperBound (self)
 Upper bound of the range.
int Center (self)
 Center of the range.
int Size (self)
 Size of the range.

Detailed Description

Represents a range of integer values.

Remarks:

License(s): BasicTypes

Constructor & Destructor Documentation

◆ __init__() [1/3]

None eVision.EIntegerRange.__init__ ( self)

Creates an eVision.EIntegerRange.__init__ object.

◆ __init__() [2/3]

None eVision.EIntegerRange.__init__ ( self,
int min,
int max )

Creates an eVision.EIntegerRange.__init__ object.

Parameters
minLower bound of the range.
maxUpper bound of the range.

◆ __init__() [3/3]

None eVision.EIntegerRange.__init__ ( self,
eVision.EIntegerRange range )

Creates an eVision.EIntegerRange.__init__ object.

Parameters
rangeRange to copy.

Member Function Documentation

◆ Center()

int eVision.EIntegerRange.Center ( self)

Center of the range.

◆ IsInRange() [1/3]

bool eVision.EIntegerRange.IsInRange ( self,
float value )

Checks if a value is inside the range.

Parameters
valueValue to test.

◆ IsInRange() [2/3]

bool eVision.EIntegerRange.IsInRange ( self,
float value,
bool lowerBoundInclusive )

Checks if a value is inside the range.

Parameters
valueValue to test.
lowerBoundInclusiveIndicates if the lower bound should be considered inside the range (true) or outside (false).

◆ IsInRange() [3/3]

bool eVision.EIntegerRange.IsInRange ( self,
float value,
bool lowerBoundInclusive,
bool upperBoundInclusive )

Checks if a value is inside the range.

Parameters
valueValue to test.
lowerBoundInclusiveIndicates if the lower bound should be considered inside the range (true) or outside (false).
upperBoundInclusiveIndicates if the upper bound should be considered inside the range (true) or outside (false).

◆ LowerBound()

int eVision.EIntegerRange.LowerBound ( self)

Lower bound of the range.

◆ SetBounds()

None eVision.EIntegerRange.SetBounds ( self,
int min,
int max )

Sets the bounds of the range.

Parameters
minLower bound of the range.
maxUpper bound of the range.

◆ SetFromBaseAndAbsoluteTolerance()

None eVision.EIntegerRange.SetFromBaseAndAbsoluteTolerance ( self,
int baseValue,
int tolerance )

Sets the bounds of the range from a base value and an absolute tolerance from this base value.

Remarks:

The range will be set with a lower bound of (base - tolerance) and an upper bound of (base + tolerance).

Parameters
baseValueBase value.
toleranceAbsolute tolerance around the base value. Must be positive.

◆ SetFromBaseAndRelativeTolerance()

None eVision.EIntegerRange.SetFromBaseAndRelativeTolerance ( self,
int baseValue,
float tolerance )

Sets the bounds of the range from a base value and a relative tolerance from this base value.

Remarks:

The range will be set with a lower bound of (base - (base * tolerance)) and an upper bound of (base + (base * tolerance)).

Parameters
baseValueBase value.
toleranceRelative tolerance around the base value. Must be positive.

◆ Size()

int eVision.EIntegerRange.Size ( self)

Size of the range.

◆ Update()

None eVision.EIntegerRange.Update ( self,
int value )

Updates the range.

If the value passed is outside of the range bounds, they are modified so they include the value.

Parameters
valueValue to be included in the range.

◆ UpperBound()

int eVision.EIntegerRange.UpperBound ( self)

Upper bound of the range.