Skip to content

Commit 01af6ab

Browse files
authored
Adding some BaseUnits for commonly used quantities (#643)
1 parent b5a431f commit 01af6ab

14 files changed

+123
-25
lines changed

Common/UnitDefinitions/ElectricField.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
{
1414
"SingularName": "VoltPerMeter",
1515
"PluralName": "VoltsPerMeter",
16+
"BaseUnits": {
17+
"L": "Meter",
18+
"M": "Kilogram",
19+
"T": "Second",
20+
"I": "Ampere"
21+
},
1622
"FromUnitToBaseFunc": "x",
1723
"FromBaseToUnitFunc": "x",
1824
"Localization": [

Common/UnitDefinitions/ElectricPotential.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
{
1313
"SingularName": "Volt",
1414
"PluralName": "Volts",
15+
"BaseUnits": {
16+
"L": "Meter",
17+
"M": "Kilogram",
18+
"T": "Second",
19+
"I": "Ampere"
20+
},
1521
"FromUnitToBaseFunc": "x",
1622
"FromBaseToUnitFunc": "x",
1723
"Prefixes": [ "Micro", "Milli", "Kilo", "Mega" ],

Common/UnitDefinitions/HeatFlux.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
{
1111
"SingularName": "WattPerSquareMeter",
1212
"PluralName": "WattsPerSquareMeter",
13+
"BaseUnits": {
14+
"M": "Kilogram",
15+
"T": "Second"
16+
},
1317
"FromUnitToBaseFunc": "x",
1418
"FromBaseToUnitFunc": "x",
1519
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ],

Common/UnitDefinitions/Magnetization.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
{
1212
"SingularName": "AmperePerMeter",
1313
"PluralName": "AmperesPerMeter",
14+
"BaseUnits": {
15+
"L": "Meter",
16+
"I": "Ampere"
17+
},
1418
"FromUnitToBaseFunc": "x",
1519
"FromBaseToUnitFunc": "x",
1620
"Localization": [

Common/UnitDefinitions/PowerDensity.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Name": "PowerDensity",
33
"BaseUnit": "WattPerCubicMeter",
44
"XmlDoc": "The amount of power in a volume.",
5-
"BaseDimensions": {
5+
"BaseDimensions": {
66
"L": -1,
77
"M": 1,
88
"T": -3
@@ -11,6 +11,11 @@
1111
{
1212
"SingularName": "WattPerCubicMeter",
1313
"PluralName": "WattsPerCubicMeter",
14+
"BaseUnits": {
15+
"L": "Meter",
16+
"M": "Kilogram",
17+
"T": "Second"
18+
},
1419
"FromUnitToBaseFunc": "x",
1520
"FromBaseToUnitFunc": "x",
1621
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera" ],

Common/UnitDefinitions/Pressure.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
{
1212
"SingularName": "Pascal",
1313
"PluralName": "Pascals",
14+
"BaseUnits": {
15+
"L": "Meter",
16+
"M": "Kilogram",
17+
"T": "Second"
18+
},
1419
"FromUnitToBaseFunc": "x",
1520
"FromBaseToUnitFunc": "x",
1621
"Prefixes": [ "Micro", "Milli", "Deca", "Hecto", "Kilo", "Mega", "Giga" ],
1722
"Localization": [
1823
{
1924
"Culture": "en-US",
20-
"Abbreviations": [ "Pa" ]
25+
"Abbreviations": [ "Pa" ]
2126
},
2227
{
2328
"Culture": "ru-RU",

Common/UnitDefinitions/Speed.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
{
1111
"SingularName": "MeterPerSecond",
1212
"PluralName": "MetersPerSecond",
13+
"BaseUnits": {
14+
"L": "Meter",
15+
"T": "Second"
16+
},
1317
"FromUnitToBaseFunc": "x",
1418
"FromBaseToUnitFunc": "x",
1519
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ],
@@ -23,6 +27,10 @@
2327
{
2428
"SingularName": "MeterPerMinute",
2529
"PluralName": "MetersPerMinutes",
30+
"BaseUnits": {
31+
"L": "Meter",
32+
"T": "Minute"
33+
},
2634
"FromUnitToBaseFunc": "x/60",
2735
"FromBaseToUnitFunc": "x*60",
2836
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ],
@@ -36,6 +44,10 @@
3644
{
3745
"SingularName": "MeterPerHour",
3846
"PluralName": "MetersPerHour",
47+
"BaseUnits": {
48+
"L": "Meter",
49+
"T": "Hour"
50+
},
3951
"FromUnitToBaseFunc": "x/3600",
4052
"FromBaseToUnitFunc": "x*3600",
4153
"Prefixes": [ "Milli", "Centi", "Kilo" ],
@@ -49,6 +61,10 @@
4961
{
5062
"SingularName": "FootPerSecond",
5163
"PluralName": "FeetPerSecond",
64+
"BaseUnits": {
65+
"L": "Foot",
66+
"T": "Second"
67+
},
5268
"FromUnitToBaseFunc": "x*0.3048",
5369
"FromBaseToUnitFunc": "x/0.3048",
5470
"Localization": [
@@ -61,6 +77,10 @@
6177
{
6278
"SingularName": "FootPerMinute",
6379
"PluralName": "FeetPerMinute",
80+
"BaseUnits": {
81+
"L": "Foot",
82+
"T": "Minute"
83+
},
6484
"FromUnitToBaseFunc": "x*0.3048/60",
6585
"FromBaseToUnitFunc": "x/0.3048*60",
6686
"Localization": [
@@ -73,6 +93,10 @@
7393
{
7494
"SingularName": "FootPerHour",
7595
"PluralName": "FeetPerHour",
96+
"BaseUnits": {
97+
"L": "Foot",
98+
"T": "Hour"
99+
},
76100
"FromUnitToBaseFunc": "x*0.3048/3600",
77101
"FromBaseToUnitFunc": "x/0.3048*3600",
78102
"Localization": [
@@ -85,6 +109,10 @@
85109
{
86110
"SingularName": "UsSurveyFootPerSecond",
87111
"PluralName": "UsSurveyFeetPerSecond",
112+
"BaseUnits": {
113+
"L": "UsSurveyFoot",
114+
"T": "Second"
115+
},
88116
"FromUnitToBaseFunc": "x*1200/3937",
89117
"FromBaseToUnitFunc": "x*3937/1200",
90118
"Localization": [
@@ -97,6 +125,10 @@
97125
{
98126
"SingularName": "UsSurveyFootPerMinute",
99127
"PluralName": "UsSurveyFeetPerMinute",
128+
"BaseUnits": {
129+
"L": "UsSurveyFoot",
130+
"T": "Minute"
131+
},
100132
"FromUnitToBaseFunc": "(x*1200/3937)/60",
101133
"FromBaseToUnitFunc": "(x*3937/1200)*60",
102134
"Localization": [
@@ -109,6 +141,10 @@
109141
{
110142
"SingularName": "UsSurveyFootPerHour",
111143
"PluralName": "UsSurveyFeetPerHour",
144+
"BaseUnits": {
145+
"L": "UsSurveyFoot",
146+
"T": "Hour"
147+
},
112148
"FromUnitToBaseFunc": "(x*1200/3937)/3600",
113149
"FromBaseToUnitFunc": "(x*3937/1200)*3600",
114150
"Localization": [
@@ -121,6 +157,10 @@
121157
{
122158
"SingularName": "InchPerSecond",
123159
"PluralName": "InchesPerSecond",
160+
"BaseUnits": {
161+
"L": "Inch",
162+
"T": "Second"
163+
},
124164
"FromUnitToBaseFunc": "x*2.54e-2",
125165
"FromBaseToUnitFunc": "x/2.54e-2",
126166
"Localization": [
@@ -133,6 +173,10 @@
133173
{
134174
"SingularName": "InchPerMinute",
135175
"PluralName": "InchesPerMinute",
176+
"BaseUnits": {
177+
"L": "Inch",
178+
"T": "Minute"
179+
},
136180
"FromUnitToBaseFunc": "(x/60)*2.54e-2",
137181
"FromBaseToUnitFunc": "(x/2.54e-2)*60",
138182
"Localization": [
@@ -145,6 +189,10 @@
145189
{
146190
"SingularName": "InchPerHour",
147191
"PluralName": "InchesPerHour",
192+
"BaseUnits": {
193+
"L": "Inch",
194+
"T": "Hour"
195+
},
148196
"FromUnitToBaseFunc": "(x/3600)*2.54e-2",
149197
"FromBaseToUnitFunc": "(x/2.54e-2)*3600",
150198
"Localization": [
@@ -157,6 +205,10 @@
157205
{
158206
"SingularName": "YardPerSecond",
159207
"PluralName": "YardsPerSecond",
208+
"BaseUnits": {
209+
"L": "Yard",
210+
"T": "Second"
211+
},
160212
"FromUnitToBaseFunc": "x*0.9144",
161213
"FromBaseToUnitFunc": "x/0.9144",
162214
"Localization": [
@@ -169,6 +221,10 @@
169221
{
170222
"SingularName": "YardPerMinute",
171223
"PluralName": "YardsPerMinute",
224+
"BaseUnits": {
225+
"L": "Yard",
226+
"T": "Minute"
227+
},
172228
"FromUnitToBaseFunc": "x*0.9144/60",
173229
"FromBaseToUnitFunc": "x/0.9144*60",
174230
"Localization": [
@@ -181,6 +237,10 @@
181237
{
182238
"SingularName": "YardPerHour",
183239
"PluralName": "YardsPerHour",
240+
"BaseUnits": {
241+
"L": "Yard",
242+
"T": "Hour"
243+
},
184244
"FromUnitToBaseFunc": "x*0.9144/3600",
185245
"FromBaseToUnitFunc": "x/0.9144*3600",
186246
"Localization": [
@@ -193,6 +253,10 @@
193253
{
194254
"SingularName": "Knot",
195255
"PluralName": "Knots",
256+
"BaseUnits": {
257+
"L": "NauticalMile",
258+
"T": "Hour"
259+
},
196260
"FromUnitToBaseFunc": "x*0.514444",
197261
"FromBaseToUnitFunc": "x/0.514444",
198262
"Localization": [
@@ -205,6 +269,10 @@
205269
{
206270
"SingularName": "MilePerHour",
207271
"PluralName": "MilesPerHour",
272+
"BaseUnits": {
273+
"L": "Mile",
274+
"T": "Hour"
275+
},
208276
"FromUnitToBaseFunc": "x*0.44704",
209277
"FromBaseToUnitFunc": "x/0.44704",
210278
"Localization": [

UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)