These functions provide a convenient facility for converting data values from one set of units to another. More...
Functions | |
| FF_Error_t | STFF::ConvertDepth (FF_DepthUnits_t fromUnits, FF_DepthUnits_t toUnits, double input, double *pOutput) |
| Convert a depth value from one set of units (feet, meters, or fathoms) to another. More... | |
| FF_Error_t | STFF::ConvertSpeed (FF_SpeedUnits_t fromUnits, FF_SpeedUnits_t toUnits, double input, double *pOutput) |
| Convert a speed value from one set of units (knots, miles per hour, or kilometers per hour) to another. More... | |
| FF_Error_t | STFF::ConvertTemperature (FF_TemperatureUnits_t fromUnits, FF_TemperatureUnits_t toUnits, double input, double *pOutput) |
| Convert a temperature value from one set of units (degrees Celsius or degrees Fahrenheit) to the other. More... | |
These functions provide a convenient facility for converting data values from one set of units to another.
For example, the STFF::ConvertSpeed function will convert a speed in knots into its equivalent in miles per hour or kilometers per hour.
These are non-member functions that reside in the STFF namespace.
| STFF::ConvertDepth | ( | FF_DepthUnits_t | fromUnits, |
| FF_DepthUnits_t | toUnits, | ||
| double | input, | ||
| double * | pOutput | ||
| ) |
#include <STFF-Utility.h>
Convert a depth value from one set of units (feet, meters, or fathoms) to another.
fromUnits parameter (e.g. hundredths of a foot), then the output value will be in the same fraction of the toUnits parameter (e.g. hundredths of a meter).| [in] | fromUnits | Units corresponding to the input parameter |
| [in] | toUnits | Units corresponding to the pOutput parameter |
| [in] | input | The value to be converted |
| [out] | pOutput | Pointer to the location where the converted value will be stored |
| FF_ERR_NO_ERROR | if the conversion succeeded |
| FF_ERR_ARGUMENT_OUT_OF_RANGE | if fromUnits, toUnits, or input contain illegal values |
| FF_ERR_INVALID_POINTER | if pOutput is a null pointer |
| STFF::ConvertSpeed | ( | FF_SpeedUnits_t | fromUnits, |
| FF_SpeedUnits_t | toUnits, | ||
| double | input, | ||
| double * | pOutput | ||
| ) |
#include <STFF-Utility.h>
Convert a speed value from one set of units (knots, miles per hour, or kilometers per hour) to another.
Note that if the input value is in a fraction of the fromUnits parameter (e.g. hundredths of a knot), then the output value will be in the same fraction of the toUnits parameter (e.g. hundredths of a mph).
| [in] | fromUnits | Units corresponding to the input parameter |
| [in] | toUnits | Units corresponding to the pOutput parameter |
| [in] | input | The value to be converted |
| [out] | pOutput | Pointer to the location where the converted value will be stored |
| FF_ERR_NO_ERROR | if the conversion succeeded |
| FF_ERR_ARGUMENT_OUT_OF_RANGE | if fromUnits, toUnits, or input contain illegal values |
| FF_ERR_INVALID_POINTER | if pOutput is a null pointer |
| STFF::ConvertTemperature | ( | FF_TemperatureUnits_t | fromUnits, |
| FF_TemperatureUnits_t | toUnits, | ||
| double | input, | ||
| double * | pOutput | ||
| ) |
#include <STFF-Utility.h>
Convert a temperature value from one set of units (degrees Celsius or degrees Fahrenheit) to the other.
Note that if the input value is in a fraction of the fromUnits parameter (e.g. hundredths of a degree C), then the output value will be in the same fraction of the toUnits parameter (e.g. hundredths of a degree F).
| [in] | fromUnits | Units corresponding to the input parameter |
| [in] | toUnits | Units corresponding to the pOutput parameter |
| [in] | input | The value to be converted |
| [out] | pOutput | Pointer to the location where the converted value will be stored |
| FF_ERR_NO_ERROR | if the conversion succeeded |
| FF_ERR_ARGUMENT_OUT_OF_RANGE | if fromUnits, toUnits, or input contain illegal values |
| FF_ERR_INVALID_POINTER | if pOutput is a null pointer |