Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
PhysicalValueRange Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class for a range of physical values. More...

Inheritance diagram for PhysicalValueRange:

Public Member Functions

override object Clone ()
 Clones the current object.
 
override bool Equals (object otherObject, EqualityIntent equalityIntent)
 Determines whether the specified Object is equal to this instance.
 
PhysicalValueRange OverlappingRange (PhysicalValueRange range)
 Method that returns the overlap of this and a given PhysicalValueRange.
 
PhysicalValueRangeOverlappingRange_within2PI (PhysicalValueRange range)
 Method that returns the overlap of this and a given PhysicalValueRange.
 
 PhysicalValueRange (double value1, bool value1isElement, double value2, bool value2isElement, MeasuredQuantity measuredQuantity, string name)
 Constructor with all parameters but with a single name.
 
 PhysicalValueRange (double value1, double value2, MeasuredQuantity measuredQuantity, string name="")
 Constructor with the most important parameters.
 
 PhysicalValueRange (double value1, double value2, PhysicalProperty property)
 Constructor with the most important parameters.
 
 PhysicalValueRange (double value1, string name1, bool value1isElement, double value2, string name2, bool value2isElement, MeasuredQuantity measuredQuantity)
 Constructor with all parameters.
 
 PhysicalValueRange (double value1, string name1, bool value1isElement, double value2, string name2, bool value2isElement, PhysicalProperty property)
 Constructor with all parameters.
 
 PhysicalValueRange (PhysicalValue value1, bool value1isElement, PhysicalValue value2, bool value2isElement)
 Constructor with physical value parameters and inclusion information.
 
 PhysicalValueRange (PhysicalValue value1, PhysicalValue value2)
 Constructor with physical value parameters.
 
 PhysicalValueRange (PhysicalValueRange range)
 Copy constructor.
 
bool RangeContainsDoubleValue (double value, bool permissiveCheck)
 Method that checks whether a given double value is contained by this range.
 
bool RangeContainsDoubleValue (double value, double epsilon)
 Method that checks whether a given double value is contained by this range.
 
bool RangeContainsRange (PhysicalValueRange range)
 Method that checks whether a given PhysicalValueRange is contained (completely) by this, using the Globals.Epsilon value.
 
bool RangeContainsRange (PhysicalValueRange range, double epsilon)
 Method that checks whether a given PhysicalValueRange is contained (completely) by this, using a given epsilon value.
 
bool RangesOverlap (PhysicalValueRange range)
 Method that checks whether a given PhysicalValueRange overlaps with this.
 
bool RangesOverlap_within2PI (PhysicalValueRange range)
 Method that checks whether a given PhysicalValueRange overlaps with this.
 
AxisNumberFormat SuggestAxisFormat ()
 Suggest an axis format for this.
 
override string ToString ()
 Overridden ToString function.
 

Static Public Member Functions

static PhysicalValueRange GetOrderedRange (PhysicalValueRange valueRange)
 Gets the input range whereas it is ensured that value 1 is not larger than value 2.
 
static bool operator!= (PhysicalValueRange value1, PhysicalValueRange value2)
 Compares two PhysicalValueRange for inequality.
 
static bool operator== (PhysicalValueRange range1, PhysicalValueRange range2)
 Compares two PhysicalValueRange for equality.
 
static PhysicalValueRange SwapValues (PhysicalValueRange valueRangeToSwap)
 Method that returns a new physical value range with swapped values.
 

Properties

double Center [get]
 Gets the center value of the range.
 
string CommonName [get]
 Gets the common name if Name1 and Name2 are equal. Else null is returned.
 
MeasuredQuantity MeasuredQuantity [get, set]
 Gets and sets the measured quantity, which in the future will replace the PhysicalProperty.
 
string Name1 [get, set]
 Meaning of value1.
 
string Name2 [get, set]
 Meaning of value2.
 
PhysicalProperty PhysicalProperty [get, set]
 The unit of the physical value.
 
PhysicalValue PhysicalValue1 [get]
 The value of the first physical value.
 
PhysicalValue PhysicalValue2 [get]
 The value of the second physical value.
 
double SignedValueRange [get]
 Gets the difference between Value2 and Value1.
 
double Value1 [get, set]
 First numerical value.
 
bool Value1IsElementOfRange [get, set]
 Determines if Value1 is an element of the PhysicalValueRange.
 
double Value2 [get, set]
 Second numerical value.
 
bool Value2IsElementOfRange [get, set]
 Determines if Value2 is an element of the PhysicalValueRange.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class for a range of physical values.

Constructor & Destructor Documentation

◆ PhysicalValueRange() [1/8]

PhysicalValueRange ( double  value1,
double  value2,
PhysicalProperty  property 
)

Constructor with the most important parameters.

Parameters
value1First numerical value
value2Second numerical value
propertyThe unit of the physical value.

◆ PhysicalValueRange() [2/8]

PhysicalValueRange ( double  value1,
double  value2,
MeasuredQuantity  measuredQuantity,
string  name = "" 
)

Constructor with the most important parameters.

Parameters
value1First numerical value
value2Second numerical value
measuredQuantityThe measured of the physical value (e.g. length).
nameOptional name describing the physical value range.

◆ PhysicalValueRange() [3/8]

PhysicalValueRange ( double  value1,
string  name1,
bool  value1isElement,
double  value2,
string  name2,
bool  value2isElement,
PhysicalProperty  property 
)

Constructor with all parameters.

Parameters
value1First numerical value
name1Meaning of value1.
value1isElementDetermines if Value1 is an element of the PhysicalValueRange
value2Second numerical value
name2Meaning of value2.
value2isElementDetermines if Value2 is an element of the PhysicalValueRange
propertyThe unit of the physical value.

◆ PhysicalValueRange() [4/8]

PhysicalValueRange ( double  value1,
bool  value1isElement,
double  value2,
bool  value2isElement,
MeasuredQuantity  measuredQuantity,
string  name 
)

Constructor with all parameters but with a single name.

Parameters
value1First numerical value
value1isElementDetermines if Value1 is an element of the PhysicalValueRange
value2Second numerical value
value2isElementDetermines if Value2 is an element of the PhysicalValueRange
measuredQuantityThe measured of the physical value (e.g. length).
nameThe name describing the physical value range.

◆ PhysicalValueRange() [5/8]

PhysicalValueRange ( double  value1,
string  name1,
bool  value1isElement,
double  value2,
string  name2,
bool  value2isElement,
MeasuredQuantity  measuredQuantity 
)

Constructor with all parameters.

Parameters
value1First numerical value
name1Meaning of value1.
value1isElementDetermines if Value1 is an element of the PhysicalValueRange
value2Second numerical value
name2Meaning of value2.
value2isElementDetermines if Value2 is an element of the PhysicalValueRange
measuredQuantityThe measured of the physical value (e.g. length).

◆ PhysicalValueRange() [6/8]

Constructor with physical value parameters.

Parameters
value1First physical value
value2Second physical value

◆ PhysicalValueRange() [7/8]

PhysicalValueRange ( PhysicalValue  value1,
bool  value1isElement,
PhysicalValue  value2,
bool  value2isElement 
)

Constructor with physical value parameters and inclusion information.

Parameters
value1First physical value
value1isElementDetermines if Value1 is an element of the PhysicalValueRange
value2Second physical value
value2isElementDetermines if Value2 is an element of the PhysicalValueRange

◆ PhysicalValueRange() [8/8]

Copy constructor.

Parameters
rangePhysical value range to copy

Member Function Documentation

◆ Clone()

override object Clone ( )

Clones the current object.

Returns
Deep copy of this object.

◆ Equals()

override bool Equals ( object  otherObject,
EqualityIntent  equalityIntent 
)

Determines whether the specified Object is equal to this instance.

Parameters
otherObjectThe Object to compare with this instance.
equalityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or just physical equality.
Returns
true if the specified Object is equal to this instance; otherwise, false.

◆ GetOrderedRange()

static PhysicalValueRange GetOrderedRange ( PhysicalValueRange  valueRange)
static

Gets the input range whereas it is ensured that value 1 is not larger than value 2.

Parameters
valueRangeThe value range.
Returns
The value range with swapped values if value 1 of the input range is larger than its value 2. Otherwise a copy of the original value range.

◆ operator!=()

static bool operator!= ( PhysicalValueRange  value1,
PhysicalValueRange  value2 
)
static

Compares two PhysicalValueRange for inequality.

Parameters
value1First PhysicalValueRange object to compare.
value2Second PhysicalValueRange object to compare.
Returns
Returns true if the two objects are unequal.

◆ operator==()

static bool operator== ( PhysicalValueRange  range1,
PhysicalValueRange  range2 
)
static

Compares two PhysicalValueRange for equality.

Parameters
range1First PhysicalValueRange object to compare.
range2Second PhysicalValueRange object to compare.
Returns
Returns true if the two objects are equal.

◆ OverlappingRange()

PhysicalValueRange OverlappingRange ( PhysicalValueRange  range)

Method that returns the overlap of this and a given PhysicalValueRange.

Parameters
rangeRange with which to calculate the overlap with this instance.
Returns
The range overlap. The physical properties are determined by this. In case of no overlap, null is returned.
Exceptions
ArgumentNullException

◆ OverlappingRange_within2PI()

PhysicalValueRange? OverlappingRange_within2PI ( PhysicalValueRange  range)

Method that returns the overlap of this and a given PhysicalValueRange.

Parameters
rangeRange with which to calculate the overlap with this instance.
Returns
The range overlap. The physical properties are determined by this. In case of no overlap, null is returned.
Exceptions
ArgumentNullException

◆ RangeContainsDoubleValue() [1/2]

bool RangeContainsDoubleValue ( double  value,
bool  permissiveCheck 
)

Method that checks whether a given double value is contained by this range.

Parameters
valueValue to check for lying inside the range
permissiveCheckIf TRUE, the check will allow the value to be in a small epsilon outside the range.
Returns
TRUE if double value is contained by this range, otherwise FALSE

◆ RangeContainsDoubleValue() [2/2]

bool RangeContainsDoubleValue ( double  value,
double  epsilon 
)

Method that checks whether a given double value is contained by this range.

Parameters
valueValue to check for lying inside the range
epsilonThe check will allow the value to lie in a small epsilon outside the range.
Returns
TRUE if double value is contained by this range, otherwise FALSE

◆ RangeContainsRange() [1/2]

bool RangeContainsRange ( PhysicalValueRange  range)

Method that checks whether a given PhysicalValueRange is contained (completely) by this, using the Globals.Epsilon value.

Parameters
rangeRange to be checked if it lies inside this.
Returns
true if range lies inside this.

◆ RangeContainsRange() [2/2]

bool RangeContainsRange ( PhysicalValueRange  range,
double  epsilon 
)

Method that checks whether a given PhysicalValueRange is contained (completely) by this, using a given epsilon value.

Parameters
rangeRange to be checked if it lies inside this.
epsilonEpsilon (= relative deviation) to be used for comparison.
Returns
true if range lies inside this.

◆ RangesOverlap()

bool RangesOverlap ( PhysicalValueRange  range)

Method that checks whether a given PhysicalValueRange overlaps with this.

Parameters
range
Returns

◆ RangesOverlap_within2PI()

bool RangesOverlap_within2PI ( PhysicalValueRange  range)

Method that checks whether a given PhysicalValueRange overlaps with this.

Parameters
range
Returns

◆ SuggestAxisFormat()

AxisNumberFormat SuggestAxisFormat ( )

Suggest an axis format for this.

Returns
The suggest axis number format (scientific, standard, or engineering).

◆ SwapValues()

static PhysicalValueRange SwapValues ( PhysicalValueRange  valueRangeToSwap)
static

Method that returns a new physical value range with swapped values.

Parameters
valueRangeToSwapValue range whose values are to be swapped.
Returns
Value range with swapped values.

◆ ToString()

override string ToString ( )

Overridden ToString function.

Returns
The formatted value.

Property Documentation

◆ CommonName

string CommonName
get

Gets the common name if Name1 and Name2 are equal. Else null is returned.


◆ MeasuredQuantity

MeasuredQuantity MeasuredQuantity
getset

Gets and sets the measured quantity, which in the future will replace the PhysicalProperty.