Skip to content
Snippets Groups Projects
Commit cede5e83 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added a few more unit definitions to the unit conversion system.

Former-commit-id: 07ccd6dde999c9f0f91b4e344435dd5e0026f7ca
parent ed59345d
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,32 @@ void getBaseUnitExponantsArray(float baseUnitsExp[5], enum UnitConversionFactor
case UNIT_CONV_PRESSURE:
baseUnitsExp[UNIT_MASS] = 1; baseUnitsExp[UNIT_LENGTH] = -1; baseUnitsExp[UNIT_TIME] = -2; break;
case UNIT_CONV_ELECTRIC_CHARGE:
baseUnitsExp[UNIT_TIME] = 1; baseUnitsExp[UNIT_CURRENT] = 1; break;
case UNIT_CONV_ELECTRIC_VOLTAGE:
baseUnitsExp[UNIT_MASS] = 1; baseUnitsExp[UNIT_LENGTH] = 2; baseUnitsExp[UNIT_TIME] = -3; baseUnitsExp[UNIT_CURRENT] = -1; break;
case UNIT_CONV_ELECTRIC_CAPACITANCE:
baseUnitsExp[UNIT_MASS] = -1; baseUnitsExp[UNIT_LENGTH] = -2; baseUnitsExp[UNIT_TIME] = 4; baseUnitsExp[UNIT_CURRENT] = 2; break;
case UNIT_CONV_ELECTRIC_RESISTANCE:
baseUnitsExp[UNIT_MASS] = 1; baseUnitsExp[UNIT_LENGTH] = 2; baseUnitsExp[UNIT_TIME] = -3; baseUnitsExp[UNIT_CURRENT] = -2; break;
case UNIT_CONV_ELECTRIC_CONDUCTANCE:
baseUnitsExp[UNIT_MASS] = -1; baseUnitsExp[UNIT_LENGTH] = -2; baseUnitsExp[UNIT_TIME] = 3; baseUnitsExp[UNIT_CURRENT] = 2; break;
case UNIT_CONV_MAGNETIC_FLUX:
baseUnitsExp[UNIT_MASS] = 1; baseUnitsExp[UNIT_LENGTH] = 2; baseUnitsExp[UNIT_TIME] = -2; baseUnitsExp[UNIT_CURRENT] = -1; break;
case UNIT_CONV_MAGNETIC_FIELD:
baseUnitsExp[UNIT_MASS] = 1; baseUnitsExp[UNIT_TIME] = -2; baseUnitsExp[UNIT_CURRENT] = -1; break;
case UNIT_CONV_MAGNETIC_INDUCTANCE:
baseUnitsExp[UNIT_MASS] = 1; baseUnitsExp[UNIT_LENGTH] = 2; baseUnitsExp[UNIT_TIME] = -2; baseUnitsExp[UNIT_CURRENT] = -2; break;
case UNIT_CONV_TEMPERATURE:
baseUnitsExp[UNIT_TEMPERATURE] = 1;
}
}
......
......@@ -71,6 +71,15 @@ enum UnitConversionFactor
UNIT_CONV_POWER,
UNIT_CONV_PRESSURE,
UNIT_CONV_FREQUENCY,
UNIT_CONV_ELECTRIC_CHARGE,
UNIT_CONV_ELECTRIC_VOLTAGE,
UNIT_CONV_ELECTRIC_CAPACITANCE,
UNIT_CONV_ELECTRIC_RESISTANCE,
UNIT_CONV_ELECTRIC_CONDUCTANCE,
UNIT_CONV_MAGNETIC_FLUX,
UNIT_CONV_MAGNETIC_FIELD,
UNIT_CONV_MAGNETIC_INDUCTANCE,
UNIT_CONV_TEMPERATURE
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment