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

Base class for a complex or double value with a physical unit. More...

Inheritance diagram for PhysicalValueBase:
PhysicalValue

Public Member Functions

override object Clone ()
 
override bool Equals (object otherObject, EqualityIntent equalityIntent)
 Determines whether the specified Object is equal to this instance.
 
Complex GetComplexValue ()
 Gets the actual value as a complex number.
 
 PhysicalValueBase (MeasuredQuantity measuredQuantity, string comment)
 Standard constructor.
 
 PhysicalValueBase (PhysicalProperty physicalProperty)
 Standard constructor.
 
 PhysicalValueBase (PhysicalProperty physicalProperty, string comment)
 Standard constructor.
 
 PhysicalValueBase (PhysicalValueBase physicalValueBase)
 Copy constructor.
 
 PhysicalValueBase (SerializationInfo info, StreamingContext context)
 Deserialization constructor. See the ISerializable interface for more details.
 
string ToString (int significantDigits)
 Returns a System.String that represents this instance.
 
string ToString (string format, IFormatProvider formatProvider=null)
 ToString function provided by the IFormattable interface. Returns a System.String that represents this instance.
 

Static Public Member Functions

static string GetFormatString (bool showPhysicalUnits, int numberOfDigits, ComplexToStringConversionFormat? complexNumberFormat=null)
 Gets the format string which can be used for the ToString method.
 

Properties

object ActualParameterRunResult [get]
 Gets the actual parameter run result.
 
string Comment [get, set]
 A comment specifying what the PhysicalValue actually is.
 
MeasuredQuantity MeasuredQuantity [get, set]
 Gets and sets the measured quantity (e.g. length) of the physical value.
 
virtual PhysicalProperty PhysicalProperty [get, set]
 The unit of the PhysicalValue.
 

Detailed Description

Base class for a complex or double value with a physical unit.

Constructor & Destructor Documentation

◆ PhysicalValueBase() [1/5]

PhysicalValueBase ( PhysicalProperty  physicalProperty)

Standard constructor.

Parameters
physicalPropertyThe unit of the PhysicalValue.

◆ PhysicalValueBase() [2/5]

PhysicalValueBase ( PhysicalProperty  physicalProperty,
string  comment 
)

Standard constructor.

Parameters
physicalPropertyThe unit of the PhysicalValue.
commentA comment specifying what the PhysicalValue actually is.

◆ PhysicalValueBase() [3/5]

PhysicalValueBase ( MeasuredQuantity  measuredQuantity,
string  comment 
)

Standard constructor.

Parameters
measuredQuantityThe measured quantity of the physical value (e.g. length).
commentA comment specifying what the PhysicalValue actually is.

◆ PhysicalValueBase() [4/5]

PhysicalValueBase ( PhysicalValueBase  physicalValueBase)

Copy constructor.

Parameters
physicalValueBasePhysicalValueBase object to copy.

◆ PhysicalValueBase() [5/5]

PhysicalValueBase ( SerializationInfo  info,
StreamingContext  context 
)

Deserialization constructor. See the ISerializable interface for more details.

Parameters
infoSerializationInfo
contextStreamingContext

Member Function Documentation

◆ 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.

◆ GetComplexValue()

Complex GetComplexValue ( )

Gets the actual value as a complex number.

Returns
The actual value of this physical value.

◆ GetFormatString()

static string GetFormatString ( bool  showPhysicalUnits,
int  numberOfDigits,
ComplexToStringConversionFormat complexNumberFormat = null 
)
static

Gets the format string which can be used for the ToString method.

Parameters
showPhysicalUnitsIf set to true physical units shall be shown in the formatted string.
numberOfDigitsThe number of digits. Should be in the range 1 ... 15. Other wise the global digit precision is used.
complexNumberFormatThe complex number format (RealImaginary, AmplitudePhase or SinusCosinus). Can be omitted for real-valued physical values.
Returns
The format string.

◆ ToString() [1/2]

string ToString ( int  significantDigits)
abstract

Returns a System.String that represents this instance.

Parameters
significantDigitsThe significant digits.
Returns
A System.String that represents this instance.

◆ ToString() [2/2]

string ToString ( string  format,
IFormatProvider  formatProvider = null 
)
abstract

ToString function provided by the IFormattable interface. Returns a System.String that represents this instance.

Parameters
formatThe format. "U" or an empty string means that the string is formatted with units (e.g. "1 nm"). "G" means that the string is formatted without units (e.g. "1e-9"). "F" means that the string is formatted as "{Comment} of {Value with units}" (e.g. "wavelength of 300 nm").

In all cases you can add a number to specify the number of digits that shall be used. E.g. "U3" results in "1.23 nm", while "U4" results in "1.234 nm". After a comma you can add the ComplexToStringConversionFormat for complex physical values. The GetFormatString method can be used to generate a matching format string.

For any other string the ToString(format, formatProvider) of the Value is used.

Parameters
formatProviderOptional culture specific format provider used for formatting the value (if format is not "U" or "F").
Returns
A System.String that represents this instance.

Property Documentation

◆ MeasuredQuantity

MeasuredQuantity MeasuredQuantity
getset

Gets and sets the measured quantity (e.g. length) of the physical value.