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

OGH-19-Uprev-OasysUnits #110

Merged
merged 5 commits into from
May 24, 2024
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
4 changes: 2 additions & 2 deletions GH_UnitNumber/GH_UnitNumber.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/arup-group/OasysGH</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>UnitNumberLogo64.png</PackageIcon>
<Version>1.0.4</Version>
<Version>1.1.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<BaseOutputPath>bin\</BaseOutputPath>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
Expand Down Expand Up @@ -46,7 +46,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile;build</IncludeAssets>
</PackageReference>
<PackageReference Include="OasysUnits" Version="1.0.0" />
<PackageReference Include="OasysUnits" Version="1.1.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion GH_UnitNumberTests/GH_UnitNumberTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions OasysGH/OasysGH.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<PackageProjectUrl>https://github.com/arup-group/OasysGH</PackageProjectUrl>
<RepositoryUrl>https://github.com/arup-group/OasysGH</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Version>1.0.4</Version>
<Version>1.1.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<LangVersion>8.0</LangVersion>
<Description>OasysGH is a library with shared content for Oasys Grasshopper plugins.</Description>
<PackageReleaseNotes>This is a release of OasysGH 1.0.4.</PackageReleaseNotes>
<PackageReleaseNotes>This is a release of OasysGH 1.1.0.</PackageReleaseNotes>
<PackageTags>oasys;grasshopper</PackageTags>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -81,8 +81,8 @@
<IncludeAssets>compile;build</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="OasysUnits" Version="1.0.0" />
<PackageReference Include="OasysUnits.Serialization.JsonNet" Version="1.0.0" />
<PackageReference Include="OasysUnits" Version="1.1.1" />
<PackageReference Include="OasysUnits.Serialization.JsonNet" Version="1.1.1" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion OasysGH/OasysPluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public static class OasysGHVersion {
public const bool IsBeta = false;
// this is the one place to set the version in VS:
// also update the version manually in OasysGH.csproj
public const string Version = "1.0.4";
public const string Version = "1.1.0";
}

public class OasysPluginInfo {
Expand Down
2 changes: 1 addition & 1 deletion OasysGH/Parameters/GH_UnitNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override bool CastTo<Q>(ref Q target) {
}

if (typeof(Q).IsAssignableFrom(typeof(GH_Number)) && Value != null) {
target = (Q)(object)new GH_Number(Value.Value);
target = (Q)(object)new GH_Number((double)Value.Value);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion OasysGH/Units/Helpers/FilteredUnits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class FilteredUnits {

public static List<string> FilteredAxialStiffnessUnits = new List<string>(Enum.GetNames(typeof(AxialStiffnessUnit)).Skip(1).ToList());

public static List<string> FilteredBendingStiffnessUnits = new List<string>(Enum.GetNames(typeof(BendingStiffnessUnit)).Skip(1).ToList());
public static List<string> FilteredBendingStiffnessUnits = new List<string>(Enum.GetNames(typeof(BendingStiffnessUnit)).ToList());

public static List<string> FilteredCurvatureUnits = new List<string>(Enum.GetNames(typeof(CurvatureUnit)).Skip(1).ToList());

Expand Down
38 changes: 16 additions & 22 deletions OasysGH/Units/Helpers/RhinoUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,22 @@ public static LengthUnit GetRhinoLengthUnit(RhinoDoc doc = null) {
}

public static LengthUnit GetRhinoLengthUnit(Rhino.UnitSystem rhinoUnits) {
var units = new List<LengthUnit>(new LengthUnit[] {
LengthUnit.Undefined,
LengthUnit.Micrometer,
LengthUnit.Millimeter,
LengthUnit.Centimeter,
LengthUnit.Meter,
LengthUnit.Kilometer,
LengthUnit.Microinch,
LengthUnit.Mil,
LengthUnit.Inch,
LengthUnit.Foot,
LengthUnit.Mile,
LengthUnit.Undefined,
LengthUnit.Undefined,
LengthUnit.Nanometer,
LengthUnit.Decimeter,
LengthUnit.Undefined,
LengthUnit.Hectometer,
LengthUnit.Undefined,
LengthUnit.Undefined,
LengthUnit.Yard
});
var units = new Dictionary<int, LengthUnit>() {
{ 1, LengthUnit.Micrometer },
{ 2, LengthUnit.Millimeter },
{ 3, LengthUnit.Centimeter },
{ 4, LengthUnit.Meter },
{ 5, LengthUnit.Kilometer },
{ 6, LengthUnit.Microinch },
{ 7, LengthUnit.Mil },
{ 8, LengthUnit.Inch },
{ 9, LengthUnit.Foot },
{ 10, LengthUnit.Mile },
{ 13, LengthUnit.Nanometer },
{ 14, LengthUnit.Decimeter },
{ 16, LengthUnit.Hectometer },
{ 19, LengthUnit.Yard }
};
return units[rhinoUnits.GetHashCode()];
}

Expand Down
2 changes: 1 addition & 1 deletion OasysGHTests/OasysGHTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions OasysGHTests/Units/DefaultUnitsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DefaultUnitsTests {
public static void GetRhinoTolerance() {
DefaultUnits.UseRhinoTolerance = true;
Assert.Equal(
new Length(1, LengthUnit.Centimeter),
new Length(0.01, LengthUnit.Meter),
DefaultUnits.Tolerance);
DefaultUnits.UseRhinoTolerance = false;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ public static void DefaultUnitsTest() {
Assert.False(DefaultUnits.UseRhinoTolerance);

Assert.Equal(
new Length(1, LengthUnit.Centimeter),
new Length(0.01, LengthUnit.Meter),
DefaultUnits.Tolerance);

Assert.Equal(
Expand Down
6 changes: 3 additions & 3 deletions build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ steps:
MSBUILDDISABLENODEREUSE: 1

- powershell: |
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\oasysgh .\OasysGHTests\bin\x64\Release\net48\OasysGHTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\unitnumber .\GH_UnitNumberTests\bin\x64\Release\net48\GH_UnitNumberTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\integration .\IntegrationTests\bin\x64\Release\net48\IntegrationTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\oasysgh .\OasysGHTests\bin\x64\Release\net48\OasysGHTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\unitnumber .\GH_UnitNumberTests\bin\x64\Release\net48\GH_UnitNumberTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\integration .\IntegrationTests\bin\x64\Release\net48\IntegrationTests.dll
displayName: dotnet test
failOnStderr: true

Expand Down
Binary file removed lib/Oasys.Interop.dll
Binary file not shown.
Binary file modified lib/Oasys.Taxonomy.Geometry.dll
Binary file not shown.
Binary file modified lib/Oasys.Taxonomy.IGeometry.dll
Binary file not shown.
Binary file modified lib/Oasys.Taxonomy.IProfiles.dll
Binary file not shown.
Binary file modified lib/Oasys.Taxonomy.Profiles.dll
Binary file not shown.
Loading