Skip to content

Commit 8ddaf50

Browse files
Add units to ElectricCurrentGradient, PressureChangeRate (#1274)
### Added Units __ElectricCurrentGradient__: * AmperesPerMinute * MilliAmperesPerMinute * MilliAmperesPerSecond > I don't know russian, but i copy pasted the unit abbreviation from the other units. Google says its ok. __PressureChangeRate__: * BarsPerSecond * BarsPerMinute * MillibarsPerSecond * MillibarsPerMinute ### Added operators * Multiplication of __ElectricCurrentGradient__ and __TimeSpan|Duration__ returns __ElectricCurrent__ * Multiplcation of __PressureChangeRate__ and __TimeSpan|Duration__ returns __Pressure__ * Division of __ElectricCurrent__ by __Time|Duration__ returns __ElectricCurrentGradient__ * Division of __Pressure__ by __TimeSpan|Duration__ returns __PressureChangeRate__ > found some operator only use `Duration` and some use both `TimeSpan` and `Duration`, thats what I went with. ### FIX __All__ generated files in `UnitsNet/GeneratedCode/Quanities/` had a change of 1 spacechar. That's the change in `QuantityGenerator.cs`. I set `SupportsSIUnitSystem` to `true` in `ElectricCurrentGradientTests` and added the `BaseUnits` element on AmperesPerSecond in `ElectricCurrentGradient.json`. I think thats correct? --------- Co-authored-by: Andreas Gullberg Larsen <[email protected]>
1 parent 46e607d commit 8ddaf50

29 files changed

+931
-53
lines changed

Common/UnitDefinitions/ElectricCurrentGradient.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,37 @@
1010
{
1111
"SingularName": "AmperePerSecond",
1212
"PluralName": "AmperesPerSecond",
13+
"BaseUnits": {
14+
"T": "Second",
15+
"I": "Ampere"
16+
},
1317
"FromUnitToBaseFunc": "{x}",
1418
"FromBaseToUnitFunc": "{x}",
19+
"Prefixes": [ "Milli" ],
1520
"Localization": [
1621
{
1722
"Culture": "en-US",
1823
"Abbreviations": [ "A/s" ]
1924
}
2025
]
2126
},
27+
{
28+
"SingularName": "AmperePerMinute",
29+
"PluralName": "AmperesPerMinute",
30+
"BaseUnits": {
31+
"T": "Minute",
32+
"I": "Ampere"
33+
},
34+
"FromUnitToBaseFunc": "{x} / 60",
35+
"FromBaseToUnitFunc": "{x} * 60",
36+
"Prefixes": [ "Milli" ],
37+
"Localization": [
38+
{
39+
"Culture": "en-US",
40+
"Abbreviations": [ "A/min" ]
41+
}
42+
]
43+
},
2244
{
2345
"SingularName": "AmperePerMillisecond",
2446
"PluralName": "AmperesPerMillisecond",

Common/UnitDefinitions/PressureChangeRate.json

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
]
4444
},
45-
{
45+
{
4646
"SingularName": "MillimeterOfMercuryPerSecond",
4747
"PluralName": "MillimetersOfMercuryPerSecond",
4848
"FromUnitToBaseFunc": "{x} * 133.322",
@@ -74,7 +74,7 @@
7474
}
7575
]
7676
},
77-
{
77+
{
7878
"SingularName": "PoundForcePerSquareInchPerSecond",
7979
"PluralName": "PoundsForcePerSquareInchPerSecond",
8080
"FromUnitToBaseFunc": "{x} * 6.894757293168361e3",
@@ -111,6 +111,40 @@
111111
"AbbreviationsForPrefixes": { "Kilo": [ "ksi/мин", "kipf/in²/мин" ]}
112112
}
113113
]
114+
},
115+
{
116+
"SingularName": "BarPerSecond",
117+
"PluralName": "BarsPerSecond",
118+
"FromUnitToBaseFunc": "{x} * 1e5",
119+
"FromBaseToUnitFunc": "{x} / 1e5",
120+
"Prefixes": [ "Milli" ],
121+
"Localization": [
122+
{
123+
"Culture": "en-US",
124+
"Abbreviations": [ "bar/s" ]
125+
},
126+
{
127+
"Culture": "ru-RU",
128+
"Abbreviations": [ "бар/с" ]
129+
}
130+
]
131+
},
132+
{
133+
"SingularName": "BarPerMinute",
134+
"PluralName": "BarsPerMinute",
135+
"FromUnitToBaseFunc": "{x} * 1e5 / 60",
136+
"FromBaseToUnitFunc": "{x} / 1e5 * 60",
137+
"Prefixes": [ "Milli" ],
138+
"Localization": [
139+
{
140+
"Culture": "en-US",
141+
"Abbreviations": [ "bar/min" ]
142+
},
143+
{
144+
"Culture": "ru-RU",
145+
"Abbreviations": [ "бар/мин" ]
146+
}
147+
]
114148
}
115149
]
116150
}

Common/UnitEnumValues.g.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@
298298
"AmperePerMicrosecond": 1,
299299
"AmperePerMillisecond": 2,
300300
"AmperePerNanosecond": 3,
301-
"AmperePerSecond": 4
301+
"AmperePerSecond": 4,
302+
"AmperePerMinute": 11,
303+
"MilliamperePerMinute": 6,
304+
"MilliamperePerSecond": 14
302305
},
303306
"ElectricField": {
304307
"VoltPerMeter": 1
@@ -1153,7 +1156,11 @@
11531156
"PascalPerMinute": 11,
11541157
"PascalPerSecond": 12,
11551158
"PoundForcePerSquareInchPerMinute": 13,
1156-
"PoundForcePerSquareInchPerSecond": 14
1159+
"PoundForcePerSquareInchPerSecond": 14,
1160+
"BarPerMinute": 16,
1161+
"BarPerSecond": 23,
1162+
"MillibarPerMinute": 24,
1163+
"MillibarPerSecond": 20
11571164
},
11581165
"Ratio": {
11591166
"DecimalFraction": 1,

UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs

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

UnitsNet.NanoFramework/GeneratedCode/Quantities/PressureChangeRate.g.cs

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

UnitsNet.NanoFramework/GeneratedCode/Units/ElectricCurrentGradientUnit.g.cs

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

UnitsNet.NanoFramework/GeneratedCode/Units/PressureChangeRateUnit.g.cs

Lines changed: 4 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/NumberToElectricCurrentGradientExtensionsTest.g.cs

Lines changed: 12 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)