Add Torr unit to pressure units in UnitConverterDataLoader.cpp

This commit adds the Torr unit to the list of pressure units in the UnitConverterDataLoader.cpp file. The Torr unit is assigned a value of 7 and its localized name and abbreviation are retrieved using GetLocalizedStringName(). Additionally, the conversion data for Torr is added to the GetConversionData() function.
This commit is contained in:
Jacob Poteet 2024-02-10 15:33:37 -05:00
commit 9681cfc37c

View file

@ -757,6 +757,8 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map<ViewMode, vector<Order
pressureUnits.push_back(OrderedUnit{
UnitConverterUnits::Pressure_PSI, GetLocalizedStringName(L"UnitName_PSI"), GetLocalizedStringName(L"UnitAbbreviation_PSI"), 6, false, false, false });
unitMap.emplace(ViewMode::Pressure, pressureUnits);
pressureUnits.push_back(OrderedUnit{
UnitConverterUnits::Pressure_Torr, GetLocalizedStringName(L"UnitName_Torr"), GetLocalizedStringName(L"UnitAbbreviation_Torr"), 7});
vector<OrderedUnit> angleUnits;
angleUnits.push_back(OrderedUnit{ UnitConverterUnits::Angle_Degree,
@ -944,7 +946,8 @@ void UnitConverterDataLoader::GetConversionData(_In_ unordered_map<ViewMode, uno
{ ViewMode::Pressure, UnitConverterUnits::Pressure_KiloPascal, 0.0098692326671601 },
{ ViewMode::Pressure, UnitConverterUnits::Pressure_MillimeterOfMercury, 0.0013155687145324 },
{ ViewMode::Pressure, UnitConverterUnits::Pressure_Pascal, 9.869232667160128e-6 },
{ ViewMode::Pressure, UnitConverterUnits::Pressure_PSI, 0.068045961016531 } };
{ ViewMode::Pressure, UnitConverterUnits::Pressure_PSI, 0.068045961016531 },
{ ViewMode::Pressure, UnitConverterUnits::Pressure_Torr, 0.00131578947368 } };
// Populate the hash map and return;
for (UnitData unitdata : unitDataList)