Skip to content

Commit

Permalink
Add TemperatureGradient Quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
dglozano committed Nov 23, 2021
1 parent ba5513e commit 9de4859
Show file tree
Hide file tree
Showing 19 changed files with 2,485 additions and 3 deletions.
75 changes: 75 additions & 0 deletions Common/UnitDefinitions/TemperatureGradient.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"Name": "TemperatureGradient",
"BaseUnit": "KelvinPerMeter",
"XmlDoc": "The rate of change of temperature with displacement in a given direction (as with increase of height)",
"BaseDimensions": {
"L": -1,
"Θ": 1
},
"Units": [
{
"SingularName": "KelvinPerMeter",
"PluralName": "KelvinsPerMeter",
"BaseUnits": {
"L": "Meter",
"Θ": "Kelvin"
},
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "∆°K/m" ]
}
]
},
{
"SingularName": "DegreeCelsiusPerMeter",
"PluralName": "DegreesCelciusPerMeter",
"BaseUnits": {
"L": "Meter",
"Θ": "DegreeCelsius"
},
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "∆°C/m" ]
}
]
},
{
"SingularName": "DegreeFahrenheitPerFoot",
"PluralName": "DegreesFahrenheitPerFoot",
"BaseUnits": {
"L": "Foot",
"Θ": "DegreeFahrenheit"
},
"FromUnitToBaseFunc": "(x / 0.3048) * 5/9",
"FromBaseToUnitFunc": "(x * 0.3048) * 9/5",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "∆°F/ft" ]
}
]
},
{
"SingularName": "DegreeCelsiusPerKilometer",
"PluralName": "DegreesCelciusPerKilometer",
"BaseUnits": {
"L": "Kilometer",
"Θ": "DegreeCelsius"
},
"FromUnitToBaseFunc": "x / 1e3",
"FromBaseToUnitFunc": "x * 1e3",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "∆°C/km" ]
}
]
}
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions UnitsNet.Tests/CustomCode/TemperatureGradientTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
// Changes to this file will be lost when the code is regenerated.
// The build server regenerates the code before each build and a pre-build
// step will regenerate the code on each local build.
//
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using System;

namespace UnitsNet.Tests.CustomCode
{
public class TemperatureGradientTests : TemperatureGradientTestsBase
{
protected override bool SupportsSIUnitSystem => true;

protected override double DegreesCelciusPerKilometerInOneKelvinPerMeter => 1000;

protected override double DegreesCelciusPerMeterInOneKelvinPerMeter => 1;

protected override double DegreesFahrenheitPerFootInOneKelvinPerMeter => 0.54864;

protected override double KelvinsPerMeterInOneKelvinPerMeter => 1;
}
}
4 changes: 4 additions & 0 deletions UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9de4859

Please sign in to comment.