Skip to content

Commit

Permalink
Add Molality (#1341)
Browse files Browse the repository at this point in the history
Closes #1340 

Added conversion for Molality covering the following units:
 - MolePerKilogram
 - MolePerGram
  • Loading branch information
peterjamesnugent authored Dec 22, 2023
1 parent a95e33f commit 33f6517
Show file tree
Hide file tree
Showing 17 changed files with 2,103 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Common/UnitDefinitions/Molality.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"Name": "Molality",
"BaseUnit": "MolePerKilogram",
"XmlDocSummary": "Molality is a measure of the amount of solute in a solution relative to a given mass of solvent.",
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Molality",
"BaseDimensions": {
"N": 1,
"M": -1
},
"Units": [
{
"SingularName": "MolePerKilogram",
"PluralName": "MolesPerKilogram",
"BaseUnits": {
"N": "Mole",
"M": "Kilogram"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "mol/kg" ]
}
]
},
{
"SingularName": "MolePerGram",
"PluralName": "MolesPerGram",
"BaseUnits": {
"N": "Mole",
"M": "Gram"
},
"FromUnitToBaseFunc": "{x} / 1e-3",
"FromBaseToUnitFunc": "{x} * 1e-3",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "mol/g" ]
}
]
}
]
}
4 changes: 4 additions & 0 deletions Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -1790,5 +1790,9 @@
"Picogray": 11,
"Rad": 17,
"Teragray": 14
},
"Molality": {
"MolePerGram": 4,
"MolePerKilogram": 1
}
}
42 changes: 42 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Molality/Molality.nfproj
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>{589b202c-e638-5c93-fefe-e1e3bab4a493}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<FileAlignment>512</FileAlignment>
<RootNamespace>UnitsNet</RootNamespace>
<AssemblyName>UnitsNet.Molality</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\Molality.g.cs" />
<Compile Include="..\Units\MolalityUnit.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.Molality</id>
<version>5.39.0</version>
<title>Units.NET Molality - nanoFramework</title>
<authors>Andreas Gullberg Larsen,nanoframework</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Molality 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 molality 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\Molality\UnitsNet.*" target="lib" />
</files>
</package>
4 changes: 4 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Molality/packages.config
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>
175 changes: 175 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Molality.g.cs

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

33 changes: 33 additions & 0 deletions UnitsNet.NanoFramework/GeneratedCode/Units/MolalityUnit.g.cs

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

Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "MassFraction", "MassFractio
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "MassMomentOfInertia", "MassMomentOfInertia\MassMomentOfInertia.nfproj", "{6218c061-3905-79b2-d3bc-bb7b8fc77a69}"
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Molality", "Molality\Molality.nfproj", "{589b202c-e638-5c93-fefe-e1e3bab4a493}"
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "MolarEnergy", "MolarEnergy\MolarEnergy.nfproj", "{9b77d4e0-863d-4a74-c30a-56f7b2bb7cb7}"
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "MolarEntropy", "MolarEntropy\MolarEntropy.nfproj", "{2053731b-90f5-5141-d15e-8d7be8c2662f}"
Expand Down Expand Up @@ -668,6 +670,12 @@ Global
{6218c061-3905-79b2-d3bc-bb7b8fc77a69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6218c061-3905-79b2-d3bc-bb7b8fc77a69}.Release|Any CPU.Build.0 = Release|Any CPU
{6218c061-3905-79b2-d3bc-bb7b8fc77a69}.Release|Any CPU.Deploy.0 = Release|Any CPU
{589b202c-e638-5c93-fefe-e1e3bab4a493}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{589b202c-e638-5c93-fefe-e1e3bab4a493}.Debug|Any CPU.Build.0 = Debug|Any CPU
{589b202c-e638-5c93-fefe-e1e3bab4a493}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{589b202c-e638-5c93-fefe-e1e3bab4a493}.Release|Any CPU.ActiveCfg = Release|Any CPU
{589b202c-e638-5c93-fefe-e1e3bab4a493}.Release|Any CPU.Build.0 = Release|Any CPU
{589b202c-e638-5c93-fefe-e1e3bab4a493}.Release|Any CPU.Deploy.0 = Release|Any CPU
{9b77d4e0-863d-4a74-c30a-56f7b2bb7cb7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9b77d4e0-863d-4a74-c30a-56f7b2bb7cb7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9b77d4e0-863d-4a74-c30a-56f7b2bb7cb7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
Expand Down

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

Loading

0 comments on commit 33f6517

Please sign in to comment.