Skip to content

Commit 9de4859

Browse files
committed
Add TemperatureGradient Quantity
1 parent ba5513e commit 9de4859

File tree

19 files changed

+2485
-3
lines changed

19 files changed

+2485
-3
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"Name": "TemperatureGradient",
3+
"BaseUnit": "KelvinPerMeter",
4+
"XmlDoc": "The rate of change of temperature with displacement in a given direction (as with increase of height)",
5+
"BaseDimensions": {
6+
"L": -1,
7+
"Θ": 1
8+
},
9+
"Units": [
10+
{
11+
"SingularName": "KelvinPerMeter",
12+
"PluralName": "KelvinsPerMeter",
13+
"BaseUnits": {
14+
"L": "Meter",
15+
"Θ": "Kelvin"
16+
},
17+
"FromUnitToBaseFunc": "x",
18+
"FromBaseToUnitFunc": "x",
19+
"Localization": [
20+
{
21+
"Culture": "en-US",
22+
"Abbreviations": [ "∆°K/m" ]
23+
}
24+
]
25+
},
26+
{
27+
"SingularName": "DegreeCelsiusPerMeter",
28+
"PluralName": "DegreesCelciusPerMeter",
29+
"BaseUnits": {
30+
"L": "Meter",
31+
"Θ": "DegreeCelsius"
32+
},
33+
"FromUnitToBaseFunc": "x",
34+
"FromBaseToUnitFunc": "x",
35+
"Localization": [
36+
{
37+
"Culture": "en-US",
38+
"Abbreviations": [ "∆°C/m" ]
39+
}
40+
]
41+
},
42+
{
43+
"SingularName": "DegreeFahrenheitPerFoot",
44+
"PluralName": "DegreesFahrenheitPerFoot",
45+
"BaseUnits": {
46+
"L": "Foot",
47+
"Θ": "DegreeFahrenheit"
48+
},
49+
"FromUnitToBaseFunc": "(x / 0.3048) * 5/9",
50+
"FromBaseToUnitFunc": "(x * 0.3048) * 9/5",
51+
"Localization": [
52+
{
53+
"Culture": "en-US",
54+
"Abbreviations": [ "∆°F/ft" ]
55+
}
56+
]
57+
},
58+
{
59+
"SingularName": "DegreeCelsiusPerKilometer",
60+
"PluralName": "DegreesCelciusPerKilometer",
61+
"BaseUnits": {
62+
"L": "Kilometer",
63+
"Θ": "DegreeCelsius"
64+
},
65+
"FromUnitToBaseFunc": "x / 1e3",
66+
"FromBaseToUnitFunc": "x * 1e3",
67+
"Localization": [
68+
{
69+
"Culture": "en-US",
70+
"Abbreviations": [ "∆°C/km" ]
71+
}
72+
]
73+
}
74+
]
75+
}

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

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

UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 generate-code.bat to generate new units or quantities.
13+
//
14+
// </auto-generated>
15+
//------------------------------------------------------------------------------
16+
17+
// Licensed under MIT No Attribution, see LICENSE file at the root.
18+
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.
19+
20+
using System;
21+
22+
namespace UnitsNet.Tests.CustomCode
23+
{
24+
public class TemperatureGradientTests : TemperatureGradientTestsBase
25+
{
26+
protected override bool SupportsSIUnitSystem => true;
27+
28+
protected override double DegreesCelciusPerKilometerInOneKelvinPerMeter => 1000;
29+
30+
protected override double DegreesCelciusPerMeterInOneKelvinPerMeter => 1;
31+
32+
protected override double DegreesFahrenheitPerFootInOneKelvinPerMeter => 0.54864;
33+
34+
protected override double KelvinsPerMeterInOneKelvinPerMeter => 1;
35+
}
36+
}

UnitsNet.Tests/GeneratedCode/IQuantityTests.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.

0 commit comments

Comments
 (0)