Skip to content

Commit 9f652ec

Browse files
ajphallangularsen
andauthored
Add units to RotationalStiffness, VolumePerLength, ForcePerLength (#776)
* Add additional RotationalStiffness and VolumePerLength units. Add additional prefixes to ForcePerLength. * Reorganized test cases for readability * Add back missing test constant * Update singular/plural names for rotational stiffness units. * Revert name changes to already existing rotational stiffness units. * Update rotational stiffness unit test unit naming. Co-authored-by: Andreas Gullberg Larsen <[email protected]>
1 parent 5c00d9d commit 9f652ec

30 files changed

+2653
-69
lines changed

Common/UnitDefinitions/ForcePerLength.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"PluralName": "NewtonsPerMeter",
1313
"FromUnitToBaseFunc": "x",
1414
"FromBaseToUnitFunc": "x",
15-
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo", "Mega" ],
15+
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Kilo", "Mega" ],
1616
"Localization": [
1717
{
1818
"Culture": "en-US",
@@ -25,6 +25,7 @@
2525
"PluralName": "NewtonsPerMillimeter",
2626
"FromUnitToBaseFunc": "x*1e3",
2727
"FromBaseToUnitFunc": "x/1e3",
28+
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Kilo", "Mega" ],
2829
"Localization": [
2930
{
3031
"Culture": "en-US",

Common/UnitDefinitions/RotationalStiffness.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,57 @@
4444
"Abbreviations": [ "kipf·ft/°", "kip·ft/°g", "k·ft/°", "kipf·ft/deg", "kip·ft/deg", "k·ft/deg" ]
4545
}
4646
]
47+
},
48+
{
49+
"SingularName": "NewtonMillimeterPerDegree",
50+
"PluralName": "NewtonMillimetersPerDegree",
51+
"FromUnitToBaseFunc": "x*180/Math.PI*0.001",
52+
"FromBaseToUnitFunc": "x/180*Math.PI*1000",
53+
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Kilo", "Mega" ],
54+
"Localization": [
55+
{
56+
"Culture": "en-US",
57+
"Abbreviations": [ "N·mm/deg", "Nmm/deg", "N·mm/°", "Nmm/°" ]
58+
}
59+
]
60+
},
61+
{
62+
"SingularName": "NewtonMeterPerDegree",
63+
"PluralName": "NewtonMetersPerDegree",
64+
"FromUnitToBaseFunc": "x*(180/Math.PI)",
65+
"FromBaseToUnitFunc": "x/(180/Math.PI)",
66+
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Kilo", "Mega" ],
67+
"Localization": [
68+
{
69+
"Culture": "en-US",
70+
"Abbreviations": [ "N·m/deg", "Nm/deg", "N·m/°", "Nm/°" ]
71+
}
72+
]
73+
},
74+
{
75+
"SingularName": "NewtonMillimeterPerRadian",
76+
"PluralName": "NewtonMillimetersPerRadian",
77+
"FromUnitToBaseFunc": "x*0.001",
78+
"FromBaseToUnitFunc": "x*1000",
79+
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Kilo", "Mega" ],
80+
"Localization": [
81+
{
82+
"Culture": "en-US",
83+
"Abbreviations": [ "N·mm/rad", "Nmm/rad" ]
84+
}
85+
]
86+
},
87+
{
88+
"SingularName": "PoundForceFeetPerRadian",
89+
"PluralName": "PoundForceFeetPerRadian",
90+
"FromUnitToBaseFunc": "x*1.3558179483314",
91+
"FromBaseToUnitFunc": "x/1.3558179483314",
92+
"Localization": [
93+
{
94+
"Culture": "en-US",
95+
"Abbreviations": [ "lbf·ft/rad" ]
96+
}
97+
]
4798
}
4899
]
49100
}

Common/UnitDefinitions/VolumePerLength.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"BaseUnit": "CubicMeterPerMeter",
44
"XmlDoc": "Volume, typically of fluid, that a container can hold within a unit of length.",
55
"BaseDimensions": {
6-
"L": 3
6+
"L": 2
77
},
88
"Units": [
99
{
@@ -38,6 +38,32 @@
3838
}
3939
]
4040
},
41+
{
42+
"SingularName": "LiterPerKilometer",
43+
"PluralName": "LitersPerKilometer",
44+
"FromUnitToBaseFunc": "x/1e6",
45+
"FromBaseToUnitFunc": "x*1e6",
46+
"Prefixes": [],
47+
"Localization": [
48+
{
49+
"Culture": "en-US",
50+
"Abbreviations": [ "l/km" ]
51+
}
52+
]
53+
},
54+
{
55+
"SingularName": "LiterPerMillimeter",
56+
"PluralName": "LitersPerMillimeter",
57+
"FromUnitToBaseFunc": "x",
58+
"FromBaseToUnitFunc": "x",
59+
"Prefixes": [],
60+
"Localization": [
61+
{
62+
"Culture": "en-US",
63+
"Abbreviations": [ "l/mm" ]
64+
}
65+
]
66+
},
4167
{
4268
"SingularName": "OilBarrelPerFoot",
4369
"PluralName": "OilBarrelsPerFoot",

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToForcePerLengthExtensionsTest.g.cs

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToRotationalStiffnessExtensionsTest.g.cs

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToVolumePerLengthExtensionsTest.g.cs

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)