Commit 74af8523 authored by Axel Auweter's avatar Axel Auweter
Browse files

Cleanups in unitconv.

parent 0cc896ec
......@@ -23,6 +23,10 @@ typedef enum {
DCDBUnit_Watt,
DCDBUnit_Volt,
/* Others */
DCDBUnit_Celsius,
DCDBUnit_Fahrenheit,
/* 1e-3 */
DCDBUnit_MilliMeter,
DCDBUnit_MilliSecond,
......@@ -30,6 +34,7 @@ typedef enum {
DCDBUnit_MilliKelvin,
DCDBUnit_MilliWatt,
DCDBUnit_MilliVolt,
DCDBUnit_MilliCelsius,
/* 1e-6 */
DCDBUnit_MicroMeter,
......@@ -38,12 +43,8 @@ typedef enum {
DCDBUnit_MicroKelvin,
DCDBUnit_MicroWatt,
DCDBUnit_MicroVolt,
DCDBUnit_MicroCelsius,
/* Others */
DCDBUnit_Celsius,
DCDBUnit_Fahrenheit,
DCDBUnit_MilliCelsius,
} DCDBUnit;
class UnitConv
......
......@@ -10,6 +10,9 @@
#include <list>
/*
Undefined
DCDBUnit_None,
Base units
DCDBUnit_Meter,
DCDBUnit_Second,
......@@ -18,6 +21,10 @@
DCDBUnit_Watt,
DCDBUnit_Volt,
Others
DCDBUnit_Celsius,
DCDBUnit_Fahrenheit,
1e-3
DCDBUnit_MilliMeter,
DCDBUnit_MilliSecond,
......@@ -25,6 +32,7 @@
DCDBUnit_MilliKelvin,
DCDBUnit_MilliWatt,
DCDBUnit_MilliVolt,
DCDBUnit_MilliCelsius,
1e-6
DCDBUnit_MicroMeter,
......@@ -33,10 +41,7 @@
DCDBUnit_MicroKelvin,
DCDBUnit_MicroWatt,
DCDBUnit_MicroVolt,
Others
DCDBUnit_Celsius,
DCDBUnit_Fahrenheit
DCDBUnit_MicroCelsius,
*/
typedef struct {
......@@ -72,8 +77,9 @@ ConversionTableEntry conversionTable[] = {
/* 17 */ { DCDBUnit_MilliVolt, "mV", DCDBUnit_Volt, -1000, 0 },
/* 18 */ { DCDBUnit_MicroVolt, "uV", DCDBUnit_Volt, -1000000, 0 },
/* 19 */ { DCDBUnit_Celsius, "C", DCDBUnit_MilliKelvin, 1000, 273150 },
/* 20 */ { DCDBUnit_Fahrenheit, "F", DCDBUnit_MilliKelvin, 555, 255116 },
/* 21 */ { DCDBUnit_MilliCelsius, "mC", DCDBUnit_Celsius, -1000, 0 },
/* 20 */ { DCDBUnit_MilliCelsius, "mC", DCDBUnit_Celsius, -1000, 0 },
/* 21 */ { DCDBUnit_MicroCelsius, "uC", DCDBUnit_Celsius, -1000000, 0},
/* 22 */ { DCDBUnit_Fahrenheit, "F", DCDBUnit_MilliKelvin, 555, 255116 },
};
#define ConversionTableSize ((int)(sizeof(conversionTable)/sizeof(ConversionTableEntry)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment