C# Class Porrey.Uwp.IoT.Calibration.NumericExtensions

Exibir arquivo Open project: porrey/iot

Public Methods

Method Description
AsRange ( this value, float minimumValue, float maximumValue ) : float

Returns the value within the range specified.

AsRange ( this value, int minimumValue, int maximumValue ) : int

Returns the value within the range specified.

AsScaledValue ( this value, float maximumValue ) : float

Returns the value read from the channel as a scaled against the specified maximum value.

AsScaledValue ( this value, int maximumValue ) : int

Returns the value read from the channel as a scaled against the specified maximum value.

Maximum ( this value, float maximumValue ) : float

Returns a value that is never larger than maximumValue.

Maximum ( this value, int maximumValue ) : int

Returns a value that is never larger than maximum.

Minimum ( this value, float minimumValue ) : float

Returns a value that is never smaller than minimumValue.

Minimum ( this value, int minimumValue ) : int

Returns a value that is never smaller than minimumValue.

Normalize ( this value, float maximumValue ) : float

Normalzies value to a number between 0 and 1.

WithCalibration ( this value, float calibratedMaximum ) : float

Returns an adjusted value based on a calibration done to determine the maximum value of the device.

Method Details

AsRange() public static method

Returns the value within the range specified.
public static AsRange ( this value, float minimumValue, float maximumValue ) : float
value this
minimumValue float The lower end of the range and the minimum value returned.
maximumValue float The upper end of the range and the maximum value returned.
return float

AsRange() public static method

Returns the value within the range specified.
public static AsRange ( this value, int minimumValue, int maximumValue ) : int
value this
minimumValue int The lower end of the range and the minimum value returned.
maximumValue int The upper end of the range and the maximum value returned.
return int

AsScaledValue() public static method

Returns the value read from the channel as a scaled against the specified maximum value.
public static AsScaledValue ( this value, float maximumValue ) : float
value this
maximumValue float The largest allowed value.
return float

AsScaledValue() public static method

Returns the value read from the channel as a scaled against the specified maximum value.
public static AsScaledValue ( this value, int maximumValue ) : int
value this
maximumValue int The largest allowed value.
return int

Maximum() public static method

Returns a value that is never larger than maximumValue.
public static Maximum ( this value, float maximumValue ) : float
value this The value that is limited.
maximumValue float The maximum value.
return float

Maximum() public static method

Returns a value that is never larger than maximum.
public static Maximum ( this value, int maximumValue ) : int
value this The value that is limited.
maximumValue int The maximum value.
return int

Minimum() public static method

Returns a value that is never smaller than minimumValue.
public static Minimum ( this value, float minimumValue ) : float
value this The value that is limited.
minimumValue float
return float

Minimum() public static method

Returns a value that is never smaller than minimumValue.
public static Minimum ( this value, int minimumValue ) : int
value this The value that is limited.
minimumValue int
return int

Normalize() public static method

Normalzies value to a number between 0 and 1.
public static Normalize ( this value, float maximumValue ) : float
value this The value to be normalized.
maximumValue float The maximum of value.
return float

WithCalibration() public static method

Returns an adjusted value based on a calibration done to determine the maximum value of the device.
public static WithCalibration ( this value, float calibratedMaximum ) : float
value this The sensor reading to be calibrated.
calibratedMaximum float The maximum value based on calibration of the sensor.
return float