Click or drag to resize

Power Structure

Represents a power measurement, in watts, as a double-precision floating-point number.
Inheritance Hierarchy
SystemObject
  SystemValueType
    GSF.UnitsPower

Namespace: GSF.Units
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
View Source

The Power type exposes the following members.

Constructors
 NameDescription
Public methodPower Creates a new Power.
Top
Methods
 NameDescription
Public methodCompareTo(Double) Compares this instance to a specified Double and returns an indication of their relative values.
Public methodCompareTo(Object) Compares this instance to a specified object and returns an indication of their relative values.
Public methodCompareTo(Power) Compares this instance to a specified Power and returns an indication of their relative values.
Public methodStatic memberConvertFrom Converts the value in the specified sourceUnit to a new Power in watts.
Public methodConvertTo Converts the Power to the specified targetUnit.
Public methodEquals(Double) Returns a value indicating whether this instance is equal to a specified Double value.
Public methodEquals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object))
Public methodEquals(Power) Returns a value indicating whether this instance is equal to a specified Power value.
Public methodStatic memberFromBoilerHorsepower Creates a new Power value from the specified value in boiler horsepower.
Public methodStatic memberFromBTUPerSecond Creates a new Power value from the specified value in BTU (International Table) per second.
Public methodStatic memberFromCaloriesPerSecond Creates a new Power value from the specified value in calories (International Table) per second.
Public methodStatic memberFromHorsepower Creates a new Power value from the specified value in mechanical horsepower (Imperial).
Public methodStatic memberFromLitersAtmospherePerSecond Creates a new Power value from the specified value in liters-atmosphere per second.
Public methodStatic memberFromMetricHorsepower Creates a new Power value from the specified value in metric horsepower.
Public methodGetHashCode Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetTypeCode Returns the TypeCode for value type Double.
Public methodStatic memberParse(String) Converts the string representation of a number to its Power equivalent.
Public methodStatic memberParse(String, NumberStyles) Converts the string representation of a number in a specified style to its Power equivalent.
Public methodStatic memberParse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its Power equivalent.
Public methodStatic memberParse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its Power equivalent.
Public methodToBoilerHorsepower Gets the Power value in boiler horsepower.
Public methodToBTUPerSecond Gets the Power value in BTU (International Table) per second.
Public methodToCaloriesPerSecond Gets the Power value in calories (International Table) per second.
Public methodToHorsepower Gets the Power value in mechanical horsepower (Imperial).
Public methodToLitersAtmospherePerSecond Gets the Power value in liters-atmosphere per second.
Public methodToMetricHorsepower Gets the Power value in metric horsepower.
Public methodToString Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String) Converts the numeric value of this instance to its equivalent string representation, using the specified format.
Public methodToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, Power) Converts the string representation of a number to its Power equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, NumberStyles, IFormatProvider, Power) Converts the string representation of a number in a specified style and culture-specific format to its Power equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Power, Power) Returns computed sum of values.
Public operatorStatic memberDivision(Power, Power) Returns computed division of values.
Public operatorStatic memberEquality(Power, Power) Compares the two values for equality.
Public operatorStatic memberExponent(Power, Power) Returns result of first value raised to power of second value.
Public operatorStatic memberGreaterThan(Power, Power) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThanOrEqual(Power, Power) Returns true if left value is greater than or equal to right value.
Public operatorStatic member(Double to Power) Implicitly converts value, represented in watts, to a Power.
Public operatorStatic member(Power to Double) Implicitly converts Power, represented in watts, to a Double.
Public operatorStatic memberInequality(Power, Power) Compares the two values for inequality.
Public operatorStatic memberLessThan(Power, Power) Returns true if left value is less than right value.
Public operatorStatic memberLessThanOrEqual(Power, Power) Returns true if left value is less or equal to than right value.
Public operatorStatic memberModulus(Power, Power) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberMultiply(Power, Power) Returns computed product of values.
Public operatorStatic memberSubtraction(Power, Power) Returns computed difference of values.
Top
Fields
 NameDescription
Public fieldStatic memberMaxValueRepresents the largest possible value of an Power. This field is constant.
Public fieldStatic memberMinValueRepresents the smallest possible value of an Power. This field is constant.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
This class behaves just like a Double representing a power in watts; it is implicitly castable to and from a Double and therefore can be generally used "as" a double, but it has the advantage of handling conversions to and from other power representations, specifically horsepower, metric horsepower, boiler horsepower, BTU per second, calorie per second, and liter-atmosphere per second. Metric conversions are handled simply by applying the needed SI conversion factor, for example:
Example
Convert power in watts to megawatts:
C#
public double GetMegawatts(Power watts)
{
    return watts / SI.Mega;
}
This example converts megawatts to mechanical horsepower:
C#
public double GetHorsepower(double megawatts)
{
    return (new Power(megawatts * SI.Mega)).ToHorsepower();
}
See Also