Skip to content

Add units to ForceChangeRate, PressureChangeRate, fix abbreviations #914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions Common/UnitDefinitions/Force.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@
"PluralName": "PoundsForce",
"FromUnitToBaseFunc": "x*4.4482216152605095551842641431421",
"FromBaseToUnitFunc": "x/4.4482216152605095551842641431421",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lbf" ]
"Abbreviations": [ "lbf" ],
"AbbreviationsForPrefixes": { "Kilo": [ "kipf", "kip", "k" ] }
},
{
"Culture": "ru-RU",
"Abbreviations": [ "фунт-сила" ]
"Abbreviations": [ "фунт-сила" ],
"AbbreviationsForPrefixes": { "Kilo": [ "кипф", "койка", "К" ] }
}
]
},
Expand All @@ -148,22 +151,6 @@
}
]
},
{
"SingularName": "KilopoundForce",
"PluralName": "KilopoundsForce",
"FromUnitToBaseFunc": "x*4448.2216152605095551842641431421",
"FromBaseToUnitFunc": "x/4448.2216152605095551842641431421",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "kipf", "kip", "k" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "кипф", "койка", "К" ]
}
]
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that you merged these two definitions. Support for Prefixes was added long after this unit was added.

{
"SingularName": "ShortTonForce",
"PluralName": "ShortTonsForce",
Expand Down
28 changes: 28 additions & 0 deletions Common/UnitDefinitions/ForceChangeRate.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,34 @@
"Abbreviations": [ "N/s" ]
}
]
},
{
"SingularName": "PoundForcePerMinute",
"PluralName": "PoundsForcePerMinute",
"FromUnitToBaseFunc": "x*4.4482216152605095551842641431421/60",
"FromBaseToUnitFunc": "x/4.4482216152605095551842641431421*60",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lbf/min" ],
"AbbreviationsForPrefixes": { "Kilo": [ "kipf/min", "kip/min", "k/min" ] }
}
]
},
{
"SingularName": "PoundForcePerSecond",
"PluralName": "PoundsForcePerSecond",
"FromUnitToBaseFunc": "x*4.4482216152605095551842641431421",
"FromBaseToUnitFunc": "x/4.4482216152605095551842641431421",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lbf/s" ],
"AbbreviationsForPrefixes": { "Kilo": [ "kipf/s", "kip/s", "k/s" ] }
}
]
}
]
}
4 changes: 2 additions & 2 deletions Common/UnitDefinitions/Pressure.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@
{
"Culture": "en-US",
"Abbreviations": [ "psi", "lb/in²" ],
"AbbreviationsForPrefixes": { "Kilo": "kipf/in²" }
"AbbreviationsForPrefixes": { "Kilo": [ "ksi", "kipf/in²" ]}
},
{
"Culture": "ru-RU",
"Abbreviations": [ "psi", "lb/in²" ],
"AbbreviationsForPrefixes": { "Kilo": "kipf/in²" }
"AbbreviationsForPrefixes": { "Kilo": [ "ksi", "kipf/in²" ]}
}
]
},
Expand Down
40 changes: 39 additions & 1 deletion Common/UnitDefinitions/PressureChangeRate.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
{
"Culture": "ru-RU",
"Abbreviations": [ "Па/с" ]
"Abbreviations": [ "Па/мин" ]
}
]
},
Expand All @@ -57,6 +57,44 @@
"Abbreviations": [ "атм/с" ]
}
]
},
{
"SingularName": "PoundForcePerSquareInchPerSecond",
"PluralName": "PoundsForcePerSquareInchPerSecond",
"FromUnitToBaseFunc": "x*6.894757293168361e3",
"FromBaseToUnitFunc": "x/6.894757293168361e3",
"Prefixes": [ "Kilo", "Mega" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "psi/s", "lb/in²/s" ],
"AbbreviationsForPrefixes": { "Kilo": [ "ksi/s", "kipf/in²/s" ]}
},
{
"Culture": "ru-RU",
"Abbreviations": [ "psi/с", "lb/in²/с" ],
"AbbreviationsForPrefixes": { "Kilo": [ "ksi/с", "kipf/in²/с" ]}
}
]
},
{
"SingularName": "PoundForcePerSquareInchPerMinute",
"PluralName": "PoundsForcePerSquareInchPerMinute",
"FromUnitToBaseFunc": "x*6.894757293168361e3/60",
"FromBaseToUnitFunc": "x/6.894757293168361e3*60",
"Prefixes": [ "Kilo", "Mega" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "psi/min", "lb/in²/min" ],
"AbbreviationsForPrefixes": { "Kilo": [ "ksi/min", "kipf/in²/min" ]}
},
{
"Culture": "ru-RU",
"Abbreviations": [ "psi/мин", "lb/in²/мин" ],
"AbbreviationsForPrefixes": { "Kilo": [ "ksi/мин", "kipf/in²/мин" ]}
}
]
}
]
}

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.

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.

4 changes: 4 additions & 0 deletions UnitsNet.Tests/CustomCode/ForceChangeRateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ public class ForceChangeRateTests : ForceChangeRateTestsBase
protected override double DecanewtonsPerMinuteInOneNewtonPerSecond => 6;
protected override double KilonewtonsPerMinuteInOneNewtonPerSecond => 0.06;
protected override double KilonewtonsPerSecondInOneNewtonPerSecond => 1E-3;
protected override double KilopoundsForcePerMinuteInOneNewtonPerSecond => 0.22481e-3*60;
protected override double KilopoundsForcePerSecondInOneNewtonPerSecond => 0.22481e-3;
protected override double DecanewtonsPerSecondInOneNewtonPerSecond => 1E-1;
protected override double NewtonsPerSecondInOneNewtonPerSecond => 1;
protected override double PoundsForcePerMinuteInOneNewtonPerSecond => 0.22481 * 60;
protected override double PoundsForcePerSecondInOneNewtonPerSecond => 0.22481;
protected override double DecinewtonsPerSecondInOneNewtonPerSecond => 1E1;
protected override double CentinewtonsPerSecondInOneNewtonPerSecond => 1E2;
protected override double MillinewtonsPerSecondInOneNewtonPerSecond => 1E3;
Expand Down
12 changes: 12 additions & 0 deletions UnitsNet.Tests/CustomCode/PressureChangeRateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@ public class PressureChangeRateTests : PressureChangeRateTestsBase

protected override double KilopascalsPerSecondInOnePascalPerSecond => 1e-3;

protected override double KilopoundsForcePerSquareInchPerMinuteInOnePascalPerSecond => 1.450377377302092e-7 * 60;

protected override double KilopoundsForcePerSquareInchPerSecondInOnePascalPerSecond => 1.450377377302092e-7;

protected override double MegapascalsPerSecondInOnePascalPerSecond => 1E-6;

protected override double MegapoundsForcePerSquareInchPerMinuteInOnePascalPerSecond => 1.450377377302092e-10 * 60;

protected override double MegapoundsForcePerSquareInchPerSecondInOnePascalPerSecond => 1.450377377302092e-10;

protected override double PascalsPerSecondInOnePascalPerSecond => 1;

protected override double PoundsForcePerSquareInchPerMinuteInOnePascalPerSecond => 1.450377377302092e-4 * 60;

protected override double PoundsForcePerSquareInchPerSecondInOnePascalPerSecond => 1.450377377302092e-4;

protected override double MegapascalsPerMinuteInOnePascalPerSecond => 6e-5;

protected override double KilopascalsPerMinuteInOnePascalPerSecond => 6e-2;
Expand Down
4 changes: 2 additions & 2 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