Measurements of units were added

This commit is contained in:
Evgeny Redikultsev
2022-11-26 17:33:21 +05:00
parent f849ee024a
commit c5e503252e
25 changed files with 293 additions and 61 deletions

View File

@@ -0,0 +1,27 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Services.Units
{
public static class UnitsFactory
{
public static List<IUnit> GetUnitCollection()
{
List<IUnit> units = new List<IUnit>();
UnitTypes type = UnitTypes.Length;
units.Add(new Unit() { UnitType = type, Name = "m", Multiplyer = 1d });
units.Add(new Unit() { UnitType = type, Name = "mm", Multiplyer = 1e3d });
units.Add(new Unit() { UnitType = type, Name = "cm", Multiplyer = 1e2d });
units.Add(new Unit() { UnitType = type, Name = "km", Multiplyer = 1e-3d });
type = UnitTypes.Stress;
units.Add(new Unit() { UnitType = type, Name = "Pa", Multiplyer = 1d });
units.Add(new Unit() { UnitType = type, Name = "kPa", Multiplyer = 1e-3d });
units.Add(new Unit() { UnitType = type, Name = "MPa", Multiplyer = 1e-6d });
return units;
}
}
}