Commit b4c276be authored by Michael Ott's avatar Michael Ott
Browse files

Move conversion between different unit systems to end of table to make...

Move conversion between different unit systems to end of table to make UnitConv::convertToBaseUnit() work reliably
parent 4fced962
......@@ -105,12 +105,11 @@ ConversionTableEntry conversionTable[] = {
{ Unit_Volt, "V", Unit_Volt, 1, 0 },
{ Unit_MilliVolt, "mV", Unit_Volt, -1000, 0 },
{ Unit_MicroVolt, "uV", Unit_Volt, -1000000, 0 },
{ Unit_Celsius, "C", Unit_MilliKelvin, 1000, 273150 },
{ Unit_Celsius, "C", Unit_Celsius, 1, 0 },
{ Unit_DeciCelsius, "dC", Unit_Celsius, -10, 0 },
{ Unit_CentiCelsius, "cC", Unit_Celsius, -100, 0},
{ Unit_MilliCelsius, "mC", Unit_Celsius, -1000, 0 },
{ Unit_MicroCelsius, "uC", Unit_Celsius, -1000000, 0},
{ Unit_Fahrenheit, "F", Unit_MilliKelvin, 555, 255116 },
{ Unit_Hertz, "Hz", Unit_Hertz, 1, 0},
{ Unit_KiloHertz, "kHz", Unit_Hertz, 1000, 0},
{ Unit_MegaHertz,"MHz", Unit_Hertz, 1000000, 0},
......@@ -119,7 +118,7 @@ ConversionTableEntry conversionTable[] = {
{ Unit_MicroJoules, "uJ", Unit_Joules, -1000000, 0},
{ Unit_KiloJoules, "kJ", Unit_Joules, 1000, 0},
{ Unit_MegaJoules, "MJ", Unit_Joules, 1000000, 0},
{ Unit_WattHours, "Wh", Unit_Joules, 3600, 0},
{ Unit_WattHours, "Wh", Unit_WattHours, 1, 0},
{ Unit_KiloWattHours, "kWh", Unit_WattHours, 1000, 0},
{ Unit_MegaWattHours, "MWh", Unit_WattHours, 1000000, 0},
{ Unit_CubicMetersPerSecond, "m3/s", Unit_CubicMetersPerHour, 3600, 0},
......@@ -128,8 +127,11 @@ ConversionTableEntry conversionTable[] = {
{ Unit_LitersPerHour, "l/h", Unit_LitersPerHour, 1, 0},
{ Unit_Bar, "Bar", Unit_Bar, 1, 0},
{ Unit_MilliBar, "mBar", Unit_Bar, -1000, 0},
{ Unit_Pascal, "Pa", Unit_Bar, -10000, 0},
{ Unit_Percent, "%", Unit_Percent, 1, 0},
{ Unit_Celsius, "C", Unit_MilliKelvin, 1000, 273150 },
{ Unit_Fahrenheit, "F", Unit_MilliKelvin, 555, 255116 },
{ Unit_WattHours, "Wh", Unit_Joules, 3600, 0},
{ Unit_Pascal, "Pa", Unit_Bar, -10000, 0},
};
#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