Skip to content

Commit

Permalink
✨Define base units for Pressure, PressureChangeRate (#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
angularsen authored Jul 11, 2023
1 parent 8ddaf50 commit 4630593
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 12 deletions.
35 changes: 35 additions & 0 deletions Common/UnitDefinitions/Pressure.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
{
"SingularName": "KilogramForcePerSquareCentimeter",
"PluralName": "KilogramsForcePerSquareCentimeter",
"BaseUnits": {
"L": "Centimeter",
"M": "Kilogram",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 9.80665e4",
"FromBaseToUnitFunc": "{x} / 9.80665e4",
"Localization": [
Expand Down Expand Up @@ -197,6 +202,11 @@
{
"SingularName": "PoundForcePerSquareInch",
"PluralName": "PoundsForcePerSquareInch",
"BaseUnits": {
"L": "Inch",
"M": "Pound",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 6.894757293168361e3",
"FromBaseToUnitFunc": "{x} / 6.894757293168361e3",
"Prefixes": [ "Kilo" ],
Expand All @@ -216,6 +226,11 @@
{
"SingularName": "PoundForcePerSquareMil",
"PluralName": "PoundsForcePerSquareMil",
"BaseUnits": {
"L": "Mil",
"M": "Pound",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 6.894757293168361e9",
"FromBaseToUnitFunc": "{x} / 6.894757293168361e9",
"Prefixes": [ "Kilo" ],
Expand All @@ -230,6 +245,11 @@
{
"SingularName": "PoundForcePerSquareFoot",
"PluralName": "PoundsForcePerSquareFoot",
"BaseUnits": {
"L": "Foot",
"M": "Pound",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 4.788025898033584e1",
"FromBaseToUnitFunc": "{x} / 4.788025898033584e1",
"Prefixes": [ "Kilo" ],
Expand All @@ -244,6 +264,11 @@
{
"SingularName": "TonneForcePerSquareMillimeter",
"PluralName": "TonnesForcePerSquareMillimeter",
"BaseUnits": {
"L": "Millimeter",
"M": "Tonne",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 9.80665e9",
"FromBaseToUnitFunc": "{x} / 9.80665e9",
"Localization": [
Expand All @@ -256,6 +281,11 @@
{
"SingularName": "TonneForcePerSquareMeter",
"PluralName": "TonnesForcePerSquareMeter",
"BaseUnits": {
"L": "Meter",
"M": "Tonne",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 9.80665e3",
"FromBaseToUnitFunc": "{x} / 9.80665e3",
"Localization": [
Expand All @@ -280,6 +310,11 @@
{
"SingularName": "TonneForcePerSquareCentimeter",
"PluralName": "TonnesForcePerSquareCentimeter",
"BaseUnits": {
"L": "Centimeter",
"M": "Tonne",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 9.80665e7",
"FromBaseToUnitFunc": "{x} / 9.80665e7",
"Localization": [
Expand Down
20 changes: 20 additions & 0 deletions Common/UnitDefinitions/PressureChangeRate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
{
"SingularName": "PascalPerSecond",
"PluralName": "PascalsPerSecond",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
"T": "Second"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Prefixes": [ "Kilo", "Mega" ],
Expand All @@ -28,6 +33,11 @@
{
"SingularName": "PascalPerMinute",
"PluralName": "PascalsPerMinute",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
"T": "Minute"
},
"FromUnitToBaseFunc": "{x} / 60",
"FromBaseToUnitFunc": "{x} * 60",
"Prefixes": [ "Kilo", "Mega" ],
Expand Down Expand Up @@ -77,6 +87,11 @@
{
"SingularName": "PoundForcePerSquareInchPerSecond",
"PluralName": "PoundsForcePerSquareInchPerSecond",
"BaseUnits": {
"L": "Inch",
"M": "Pound",
"T": "Second"
},
"FromUnitToBaseFunc": "{x} * 6.894757293168361e3",
"FromBaseToUnitFunc": "{x} / 6.894757293168361e3",
"Prefixes": [ "Kilo", "Mega" ],
Expand All @@ -96,6 +111,11 @@
{
"SingularName": "PoundForcePerSquareInchPerMinute",
"PluralName": "PoundsForcePerSquareInchPerMinute",
"BaseUnits": {
"L": "Inch",
"M": "Pound",
"T": "Minute"
},
"FromUnitToBaseFunc": "{x} * 6.894757293168361e3 / 60",
"FromBaseToUnitFunc": "{x} / 6.894757293168361e3 * 60",
"Prefixes": [ "Kilo", "Mega" ],
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/PressureChangeRateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace UnitsNet.Tests
{
public class PressureChangeRateTests : PressureChangeRateTestsBase
{
protected override bool SupportsSIUnitSystem => false;
protected override bool SupportsSIUnitSystem => true;
protected override double AtmospheresPerSecondInOnePascalPerSecond => 9.8692 * 1E-6;

protected override double KilopascalsPerSecondInOnePascalPerSecond => 1e-3;
Expand Down
14 changes: 7 additions & 7 deletions UnitsNet/GeneratedCode/Quantities/Pressure.g.cs

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

8 changes: 4 additions & 4 deletions UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs

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

0 comments on commit 4630593

Please sign in to comment.