Skip to content
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

Add Mass Distance Quantity used in transportation industry #1388

Closed
Closed
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
83 changes: 83 additions & 0 deletions Common/UnitDefinitions/MassDistance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"Name": "MassDistance",
"BaseUnit": "KilogramKilometer",
"XmlDocSummary": "Freight is measured in mass-distance. A simple unit of freight is the kilogram-kilometre (kgkm), the service of moving one kilogram of payload a distance of one kilometre.",
"BaseDimensions": {
"M": 1,
"L": -2
},
"Units": [
{
"SingularName": "KilogramKilometer",
"PluralName": "KilogramKilometers",
"BaseUnits": {
"M": "Kilogram",
"L": "Kilometer"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": ["kg⋅km", "kgkm"]
},
{
"Culture": "ru-RU",
"Abbreviations": ["кг⋅км", "кгкм"]
},
{
"Culture": "zh-CN",
"Abbreviations": ["公斤·公里", "公斤公里"]
}
]
},
{
"SingularName": "TonneKilometer",
"PluralName": "TonneKilometers",
"BaseUnits": {
"M": "Tonne",
"L": "Kilometer"
},
"FromUnitToBaseFunc": "{x} * 1e3",
"FromBaseToUnitFunc": "{x} / 1e3",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": ["t⋅km", "km⋅t", "tkm", "kmt"]
},
{
"Culture": "ru-RU",
"Abbreviations": ["т⋅км", "км⋅т", "ткм", "кмт"]
},
{
"Culture": "zh-CN",
"Abbreviations": ["t·公里", "公里·t", "特公里", "国民党"]
}
]
},
{
"SingularName": "ShortTonnMile",
"PluralName": "ShortTonMiles",
"BaseUnits": {
"M": "ShortTon",
"L": "Mile"
},
"FromUnitToBaseFunc": "{x} * 1.46e3",
"FromBaseToUnitFunc": "{x} / 1.46e3",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": ["t⋅mi", "tmi"]
},
{
"Culture": "ru-RU",
"Abbreviations": ["т⋅ми", "Тми"]
},
{
"Culture": "zh-CN",
"Abbreviations": ["t·mi", "特米"]
}
]
}
]
}
7 changes: 7 additions & 0 deletions Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -1855,5 +1855,12 @@
"Sievert": 9,
"Kilosievert": 3,
"Megasievert": 6
},
"MassDistance": {
"KilogramKilometre": 6,
"ShortTonnMile": 8,
"TonneKilometre": 3,
"KilogramKilometer": 9,
"TonneKilometer": 2
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<NanoFrameworkProjectSystemPath>$(MSBuildExtensionsPath)\nanoFramework\v1.0\</NanoFrameworkProjectSystemPath>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.Default.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.Default.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{cc19100b-68ff-e4f7-e328-7bf05d167782}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<FileAlignment>512</FileAlignment>
<RootNamespace>UnitsNet</RootNamespace>
<AssemblyName>UnitsNet.MassDistance</AssemblyName>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<ItemGroup>
<Compile Include="..\Quantities\MassDistance.g.cs" />
<Compile Include="..\Units\MassDistanceUnit.g.cs" />
<Compile Include="..\Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib, Version=1.15.6.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\packages\nanoFramework.CoreLibrary.1.15.5\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
</ProjectCapabilities>
</ProjectExtensions>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.MassDistance</id>
<version>5.50.0</version>
<title>Units.NET MassDistance - nanoFramework</title>
<authors>Andreas Gullberg Larsen,nanoframework</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT-0</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds MassDistance units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
<copyright>Copyright 2013 Andreas Gullberg Larsen ([email protected]).</copyright>
<language>en-US</language>
<tags>nanoframework massdistance unit units quantity quantities measurement si metric imperial abbreviation abbreviations convert conversion parse immutable</tags>
<dependencies>
<dependency id="nanoFramework.CoreLibrary" version="1.15.5" />
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\MassDistance\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.15.5" targetFramework="netnanoframework10" />
</packages>
185 changes: 185 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/MassDistance.g.cs

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

34 changes: 34 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Units/MassDistanceUnit.g.cs

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

Loading
Loading