Skip to content

Commit

Permalink
Fixed measure information.
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenghi committed Apr 1, 2024
1 parent 9feeccf commit 931cdd2
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ids-lib.codegen/buildingSMART/units.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The order of dimensional exponent units is `(m, Kg, s, A, K, mol, cd)`.
| IFCMAGNETICFLUXMEASURE | Magnetic flux | weber | Wb | Wb | (2, 1, -2, -1, 0, 0, 0) | IfcDerivedUnitEnum.MAGNETICFLUXUNIT |
| IFCMASSDENSITYMEASURE | Mass density | | | Kg / m3 | (-3, 1, 0, 0, 0, 0, 0) | IfcDerivedUnitEnum.MASSDENSITYUNIT |
| IFCMASSFLOWRATEMEASURE | Mass flow rate | | | Kg / s | (0, 1, -1, 0, 0, 0, 0) | IfcDerivedUnitEnum.MASSFLOWRATEUNIT |
| IFCMASSMEASURE | Mass | kilogram | | Kg | (0, 1, 0, 0, 0, 0, 0) | IfcUnitEnum.MASSUNIT |
| IFCMASSMEASURE | Mass | kilogram | Kg | Kg | (0, 1, 0, 0, 0, 0, 0) | IfcUnitEnum.MASSUNIT |
| IFCMASSPERLENGTHMEASURE | Mass per length | | | Kg / m | (-1, 1, 0, 0, 0, 0, 0) | IfcDerivedUnitEnum.MASSPERLENGTHUNIT |
| IFCMODULUSOFELASTICITYMEASURE | Modulus of elasticity | | | N / m2 | (-1, 1, -2, 0, 0, 0, 0) | IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT |
| IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE | Modulus of linear subgrade reaction | | | N / m2 | (-1, 1, -2, 0, 0, 0, 0) | IfcDerivedUnitEnum.MODULUSOFLINEARSUBGRADEREACTIONUNIT |
Expand Down
15 changes: 9 additions & 6 deletions ids-lib/IfcSchema/IfcMeasureInformation.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
namespace IdsLib.IfcSchema;
using System.Diagnostics;

namespace IdsLib.IfcSchema;

/// <summary>
/// Metadata about measure conversion behaviours.
/// </summary>
[DebuggerDisplay("{Id}, {Description}")]
public readonly struct IfcMeasureInformation
{
/// <summary>
/// basic constructor
/// </summary>
public IfcMeasureInformation(string measure, string description, string unit, string symbol, string defDisplayUnit, string exponents, string unitTypeEnum)
public IfcMeasureInformation(string measureId, string description, string unit, string unitSymbol, string defDisplayUnit, string exponents, string unitTypeEnum)
{
Id = measure;
IfcMeasure = measure;
Id = measureId;
IfcMeasure = measureId;
Description = description;
Unit = unit;
UnitSymbol = symbol;
DefaultDisplay = symbol;
UnitSymbol = unitSymbol;
DefaultDisplay = defDisplayUnit;
Exponents = DimensionalExponents.FromString(exponents) ?? new DimensionalExponents();
UnitTypeEnum = unitTypeEnum;
}
Expand Down
2 changes: 1 addition & 1 deletion ids-lib/IfcSchema/SchemaInfo.MeasureNames.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static IEnumerable<IfcDataTypeInformation> AllDataTypes
yield return new IfcDataTypeInformation("IFCMARINEPARTTYPEENUM", new[] { "Ifc4x3" }, "xs:string");
yield return new IfcDataTypeInformation("IFCMASSDENSITYMEASURE", new[] { "Ifc2x3", "Ifc4", "Ifc4x3" }, new IfcMeasureInformation("IFCMASSDENSITYMEASURE","Mass density","","","Kg / m3","(-3, 1, 0, 0, 0, 0, 0)","IfcDerivedUnitEnum.MASSDENSITYUNIT"), "xs:double");
yield return new IfcDataTypeInformation("IFCMASSFLOWRATEMEASURE", new[] { "Ifc2x3", "Ifc4", "Ifc4x3" }, new IfcMeasureInformation("IFCMASSFLOWRATEMEASURE","Mass flow rate","","","Kg / s","(0, 1, -1, 0, 0, 0, 0)","IfcDerivedUnitEnum.MASSFLOWRATEUNIT"), "xs:double");
yield return new IfcDataTypeInformation("IFCMASSMEASURE", new[] { "Ifc2x3", "Ifc4", "Ifc4x3" }, new IfcMeasureInformation("IFCMASSMEASURE","Mass","kilogram","","Kg","(0, 1, 0, 0, 0, 0, 0)","IfcUnitEnum.MASSUNIT"), "xs:double");
yield return new IfcDataTypeInformation("IFCMASSMEASURE", new[] { "Ifc2x3", "Ifc4", "Ifc4x3" }, new IfcMeasureInformation("IFCMASSMEASURE","Mass","kilogram","Kg","Kg","(0, 1, 0, 0, 0, 0, 0)","IfcUnitEnum.MASSUNIT"), "xs:double");
yield return new IfcDataTypeInformation("IFCMASSPERLENGTHMEASURE", new[] { "Ifc2x3", "Ifc4", "Ifc4x3" }, new IfcMeasureInformation("IFCMASSPERLENGTHMEASURE","Mass per length","","","Kg / m","(-1, 1, 0, 0, 0, 0, 0)","IfcDerivedUnitEnum.MASSPERLENGTHUNIT"), "xs:double");
yield return new IfcDataTypeInformation("IFCMECHANICALFASTENERTYPEENUM", new[] { "Ifc4", "Ifc4x3" }, "xs:string");
yield return new IfcDataTypeInformation("IFCMEDICALDEVICETYPEENUM", new[] { "Ifc4", "Ifc4x3" }, "xs:string");
Expand Down
2 changes: 1 addition & 1 deletion ids-lib/LibraryInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public static class LibraryInformation
/// <summary>
/// Static field with hardcoded DLL version number.
/// </summary>
public static string AssemblyVersion => "1.0.67";
public static string AssemblyVersion => "1.0.68";
}
2 changes: 1 addition & 1 deletion ids-lib/ids-lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageReleaseNotes>First implementation.</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<!-- Github actions are setup so that when this version is bumped the nuget package is uploaded -->
<AssemblyVersion>1.0.67</AssemblyVersion>
<AssemblyVersion>1.0.68</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<Version>$(AssemblyVersion)</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
12 changes: 12 additions & 0 deletions ids-tool.tests/IfcSchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ public void CanParseMeasure()
}
}

[Fact]
public void HasMeasureInfo()
{
var m = IdsLib.IfcSchema.SchemaInfo.AllMeasureInformation.ToList();
m.Should().HaveCount(83);
foreach (var measure in m)
{
Debug.WriteLine($"{measure.UnitSymbol}\t{measure.DefaultDisplay}");
}
}


[Fact]
public void CanGetTopLevelClassesByAttribute()
{
Expand Down
2 changes: 1 addition & 1 deletion ids-tool/ids-tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageIcon>icon.png</PackageIcon>
<PackageTags>IDS, buildingSmart</PackageTags>
<!-- Github actions are setup so that when this version is bumped the nuget package is uploaded -->
<AssemblyVersion>1.0.67</AssemblyVersion>
<AssemblyVersion>1.0.68</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<Version>$(AssemblyVersion)</Version>
<RepositoryUrl>https://github.com/buildingSMART/IDS-Audit-tool.git</RepositoryUrl>
Expand Down

0 comments on commit 931cdd2

Please sign in to comment.