Skip to content

Commit 9c43523

Browse files
committed
Merge remote-tracking branch 'angularsen/master' into v4
1 parent 30363ce commit 9c43523

File tree

11 files changed

+186
-2
lines changed

11 files changed

+186
-2
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"Name": "CoefficientOfThermalExpansion",
3+
"BaseUnit": "InverseKelvin",
4+
"XmlDoc": "A unit that represents a fractional change in size in response to a change in temperature.",
5+
"BaseDimensions": {
6+
"Θ": -1
7+
},
8+
"Units": [
9+
{
10+
"SingularName": "InverseKelvin",
11+
"PluralName": "InverseKelvin",
12+
"FromUnitToBaseFunc": "x",
13+
"FromBaseToUnitFunc": "x",
14+
"Localization": [
15+
{
16+
"Culture": "en-US",
17+
"Abbreviations": [ "K⁻¹", "1/K" ]
18+
}
19+
]
20+
},
21+
{
22+
"SingularName": "InverseDegreeCelsius",
23+
"PluralName": "InverseDegreeCelsius",
24+
"FromUnitToBaseFunc": "x",
25+
"FromBaseToUnitFunc": "x",
26+
"Localization": [
27+
{
28+
"Culture": "en-US",
29+
"Abbreviations": [ "°C⁻¹", "1/°C" ]
30+
}
31+
]
32+
},
33+
{
34+
"SingularName": "InverseDegreeFahrenheit",
35+
"PluralName": "InverseDegreeFahrenheit",
36+
"FromUnitToBaseFunc": "x*5/9",
37+
"FromBaseToUnitFunc": "x*9/5",
38+
"Localization": [
39+
{
40+
"Culture": "en-US",
41+
"Abbreviations": [ "°F⁻¹", "1/°F" ]
42+
}
43+
]
44+
}
45+
]
46+
}

Common/UnitDefinitions/MassFlow.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@
6060
"Abbreviations": [ "lb/h" ]
6161
}
6262
]
63+
},
64+
{
65+
"SingularName": "PoundPerMinute",
66+
"PluralName": "PoundsPerMinute",
67+
"FromUnitToBaseFunc": "x/0.132277",
68+
"FromBaseToUnitFunc": "x*0.132277",
69+
"Prefixes": [ "Mega" ],
70+
"Localization": [
71+
{
72+
"Culture": "en-US",
73+
"Abbreviations": [ "lb/min" ]
74+
}
75+
]
6376
},
6477
{
6578
"SingularName": "TonnePerDay",

Common/UnitDefinitions/Volume.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"PluralName": "Liters",
1212
"FromUnitToBaseFunc": "x/1e3",
1313
"FromBaseToUnitFunc": "x*1e3",
14-
"Prefixes": [ "Micro", "Milli", "Centi", "Deci", "Hecto" ],
14+
"Prefixes": [ "Micro", "Milli", "Centi", "Deci", "Hecto", "Kilo" ],
1515
"Localization": [
1616
{
1717
"Culture": "en-US",
@@ -20,7 +20,7 @@
2020
{
2121
"Culture": "ru-RU",
2222
"Abbreviations": [ "л" ],
23-
"AbbreviationsWithPrefixes": [ "мкл", "мл", "сл", "дл", "гл" ]
23+
"AbbreviationsWithPrefixes": [ "мкл", "мл", "сл", "дл", "гл", "кл" ]
2424
}
2525
]
2626
},
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated (once) by \generate-code.bat, but will not be
4+
// regenerated when it already exists. The purpose of creating this file is to make
5+
// it easier to remember to implement all the unit conversion test cases.
6+
//
7+
// Whenever a new unit is added to this quantity and \generate-code.bat is run,
8+
// the base test class will get a new abstract property and cause a compile error
9+
// in this derived class, reminding the developer to implement the test case
10+
// for the new unit.
11+
//
12+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
13+
//
14+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
15+
// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
16+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
17+
//
18+
// </auto-generated>
19+
//------------------------------------------------------------------------------
20+
21+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
22+
// https://github.com/angularsen/UnitsNet
23+
//
24+
// Permission is hereby granted, free of charge, to any person obtaining a copy
25+
// of this software and associated documentation files (the "Software"), to deal
26+
// in the Software without restriction, including without limitation the rights
27+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28+
// copies of the Software, and to permit persons to whom the Software is
29+
// furnished to do so, subject to the following conditions:
30+
//
31+
// The above copyright notice and this permission notice shall be included in
32+
// all copies or substantial portions of the Software.
33+
//
34+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
40+
// THE SOFTWARE.
41+
42+
43+
using System;
44+
45+
namespace UnitsNet.Tests.CustomCode
46+
{
47+
public class CoefficientOfThermalExpansionTests : CoefficientOfThermalExpansionTestsBase
48+
{
49+
protected override double InverseDegreeCelsiusInOneInverseKelvin => 1.0;
50+
51+
protected override double InverseDegreeFahrenheitInOneInverseKelvin => 1.8;
52+
53+
protected override double InverseKelvinInOneInverseKelvin => 1.0;
54+
}
55+
}

UnitsNet.Tests/CustomCode/MassFlowTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public class MassFlowTests : MassFlowTestsBase
5656

5757
protected override double PoundsPerHourInOneGramPerSecond => 7.93664;
5858

59+
protected override double PoundsPerMinuteInOneGramPerSecond => 0.132277;
60+
61+
protected override double MegapoundsPerMinuteInOneGramPerSecond => 0.132277e-6;
62+
5963
[Fact]
6064
public void DurationTimesMassFlowEqualsMass()
6165
{

UnitsNet.Tests/CustomCode/VolumeTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class VolumeTests : VolumeTestsBase
6464
protected override double KilousGallonsInOneCubicMeter => 2.6417217e-1;
6565

6666
protected override double LitersInOneCubicMeter => 1E3;
67+
protected override double KilolitersInOneCubicMeter => 1;
68+
6769
protected override double MegacubicFeetInOneCubicMeter => 3.531472e-5;
6870
protected override double MegaimperialGallonsInOneCubicMeter => 2.1996924e-4;
6971
protected override double MegausGallonsInOneCubicMeter => 2.6417217e-4;

UnitsNet/GeneratedCode/QuantityType.g.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public enum QuantityType
6060
BitRate,
6161
BrakeSpecificFuelConsumption,
6262
Capacitance,
63+
CoefficientOfThermalExpansion,
6364
Density,
6465
Duration,
6566
DynamicViscosity,

UnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ private static readonly (string CultureName, Type UnitType, int UnitValue, strin
172172
("en-US", typeof(BrakeSpecificFuelConsumptionUnit), (int)BrakeSpecificFuelConsumptionUnit.KilogramPerJoule, new string[]{"kg/J"}),
173173
("en-US", typeof(BrakeSpecificFuelConsumptionUnit), (int)BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour, new string[]{"lb/hph"}),
174174
("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Farad, new string[]{"F"}),
175+
("en-US", typeof(CoefficientOfThermalExpansionUnit), (int)CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, new string[]{"°C⁻¹", "1/°C"}),
176+
("en-US", typeof(CoefficientOfThermalExpansionUnit), (int)CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, new string[]{"°F⁻¹", "1/°F"}),
177+
("en-US", typeof(CoefficientOfThermalExpansionUnit), (int)CoefficientOfThermalExpansionUnit.InverseKelvin, new string[]{"K⁻¹", "1/K"}),
175178
("en-US", typeof(DensityUnit), (int)DensityUnit.CentigramPerDeciliter, new string[]{"cg/dl"}),
176179
("en-US", typeof(DensityUnit), (int)DensityUnit.CentigramPerLiter, new string[]{"cg/L"}),
177180
("en-US", typeof(DensityUnit), (int)DensityUnit.CentigramPerMilliliter, new string[]{"cg/ml"}),
@@ -546,10 +549,12 @@ private static readonly (string CultureName, Type UnitType, int UnitValue, strin
546549
("ru-RU", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerHour, new string[]{"кг/ч"}),
547550
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerSecond, new string[]{"kg/S"}),
548551
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MegapoundPerHour, new string[]{"Mlb/h"}),
552+
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MegapoundPerMinute, new string[]{"Mlb/min"}),
549553
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MicrogramPerSecond, new string[]{"µg/S"}),
550554
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MilligramPerSecond, new string[]{"mg/S"}),
551555
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.NanogramPerSecond, new string[]{"ng/S"}),
552556
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.PoundPerHour, new string[]{"lb/h"}),
557+
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.PoundPerMinute, new string[]{"lb/min"}),
553558
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.ShortTonPerHour, new string[]{"short tn/h"}),
554559
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.TonnePerDay, new string[]{"t/d"}),
555560
("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.TonnePerHour, new string[]{"t/h"}),
@@ -981,6 +986,8 @@ private static readonly (string CultureName, Type UnitType, int UnitValue, strin
981986
("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KilocubicMeter, new string[]{"kм³"}),
982987
("en-US", typeof(VolumeUnit), (int)VolumeUnit.KiloimperialGallon, new string[]{"kgal (imp.)"}),
983988
("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KiloimperialGallon, new string[]{"kАнглийский галлон"}),
989+
("en-US", typeof(VolumeUnit), (int)VolumeUnit.Kiloliter, new string[]{"kl"}),
990+
("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Kiloliter, new string[]{"кл"}),
984991
("en-US", typeof(VolumeUnit), (int)VolumeUnit.KilousGallon, new string[]{"kgal (U.S.)"}),
985992
("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KilousGallon, new string[]{"kАмериканский галлон"}),
986993
("en-US", typeof(VolumeUnit), (int)VolumeUnit.Liter, new string[]{"l"}),
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
13+
//
14+
// </auto-generated>
15+
//------------------------------------------------------------------------------
16+
17+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
18+
// https://github.com/angularsen/UnitsNet
19+
//
20+
// Permission is hereby granted, free of charge, to any person obtaining a copy
21+
// of this software and associated documentation files (the "Software"), to deal
22+
// in the Software without restriction, including without limitation the rights
23+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24+
// copies of the Software, and to permit persons to whom the Software is
25+
// furnished to do so, subject to the following conditions:
26+
//
27+
// The above copyright notice and this permission notice shall be included in
28+
// all copies or substantial portions of the Software.
29+
//
30+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
36+
// THE SOFTWARE.
37+
38+
// ReSharper disable once CheckNamespace
39+
namespace UnitsNet.Units
40+
{
41+
// Disable missing XML comment warnings for the generated unit enums.
42+
#pragma warning disable 1591
43+
44+
public enum CoefficientOfThermalExpansionUnit
45+
{
46+
Undefined = 0,
47+
InverseDegreeCelsius,
48+
InverseDegreeFahrenheit,
49+
InverseKelvin,
50+
}
51+
52+
#pragma warning restore 1591
53+
}

UnitsNet/GeneratedCode/Units/MassFlowUnit.g.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ public enum MassFlowUnit
5252
KilogramPerHour,
5353
KilogramPerSecond,
5454
MegapoundPerHour,
55+
MegapoundPerMinute,
5556
MicrogramPerSecond,
5657
MilligramPerSecond,
5758
NanogramPerSecond,
5859
PoundPerHour,
60+
PoundPerMinute,
5961
ShortTonPerHour,
6062
TonnePerDay,
6163
TonnePerHour,

UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public enum VolumeUnit
6666
KilocubicFoot,
6767
KilocubicMeter,
6868
KiloimperialGallon,
69+
Kiloliter,
6970
KilousGallon,
7071
Liter,
7172
MegacubicFoot,

0 commit comments

Comments
 (0)