From 069ecfeef6e3dba2574e801ec2740f8a6bfff4ea Mon Sep 17 00:00:00 2001 From: Roberto Alves Date: Tue, 28 Nov 2023 16:33:27 +0000 Subject: [PATCH 1/3] Remove duplicate extension method for ValueArray that is already present on the SDK. --- .../Extensions/ValueArrayExtensions.cs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/COMET.Web.Common/Extensions/ValueArrayExtensions.cs b/COMET.Web.Common/Extensions/ValueArrayExtensions.cs index e723d7a6..985e8f65 100644 --- a/COMET.Web.Common/Extensions/ValueArrayExtensions.cs +++ b/COMET.Web.Common/Extensions/ValueArrayExtensions.cs @@ -32,28 +32,6 @@ namespace COMET.Web.Common.Extensions /// public static class ValueArrayExtensions { - /// - /// Checks if two contains the same exact values - /// - /// the type of the parameter - /// the first value array to compare - /// the second value array to compare - /// True if the contained values are the same, false otherwise - public static bool ContainsSameValues(this ValueArray valueArray, ValueArray comparison) where T : class - { - if (comparison is null) - { - throw new ArgumentNullException(nameof(comparison)); - } - - if (valueArray.Count != comparison.Count) - { - return false; - } - - return !valueArray.Where((t, i) => !t.Equals(comparison[i])).Any(); - } - /// /// Adds new default values inside a /// From 0104f66d3f6b8e7dbaddf3bc66e4ff11b54dc3d0 Mon Sep 17 00:00:00 2001 From: Roberto Alves Date: Tue, 28 Nov 2023 16:33:38 +0000 Subject: [PATCH 2/3] Update usages so that we're using the SDK helper method instead. --- .../Extensions/ValueArrayExtensionsTestFixture.cs | 1 + COMETwebapp/Extensions/ParameterValueSetRelationExtensions.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/COMET.Web.Common.Tests/Extensions/ValueArrayExtensionsTestFixture.cs b/COMET.Web.Common.Tests/Extensions/ValueArrayExtensionsTestFixture.cs index 2cc71817..b6bdc51a 100644 --- a/COMET.Web.Common.Tests/Extensions/ValueArrayExtensionsTestFixture.cs +++ b/COMET.Web.Common.Tests/Extensions/ValueArrayExtensionsTestFixture.cs @@ -27,6 +27,7 @@ namespace COMET.Web.Common.Tests.Extensions { using System.Collections.Generic; + using CDP4Common.Helpers; using CDP4Common.Types; using COMET.Web.Common.Extensions; diff --git a/COMETwebapp/Extensions/ParameterValueSetRelationExtensions.cs b/COMETwebapp/Extensions/ParameterValueSetRelationExtensions.cs index e2f1e333..ee8fd26b 100644 --- a/COMETwebapp/Extensions/ParameterValueSetRelationExtensions.cs +++ b/COMETwebapp/Extensions/ParameterValueSetRelationExtensions.cs @@ -25,6 +25,7 @@ namespace COMETwebapp.Extensions { using CDP4Common.EngineeringModelData; + using CDP4Common.Helpers; using COMET.Web.Common.Extensions; From f18c47268e2b78e212a7878910201b90821cf633 Mon Sep 17 00:00:00 2001 From: Roberto Alves Date: Tue, 28 Nov 2023 16:41:32 +0000 Subject: [PATCH 3/3] Use InvariantCulture when parsing the doubles on OnMatrixValuesChanged --- .../Components/ParameterEditors/OrientationViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COMET.Web.Common/ViewModels/Components/ParameterEditors/OrientationViewModel.cs b/COMET.Web.Common/ViewModels/Components/ParameterEditors/OrientationViewModel.cs index 282d654b..4525e893 100644 --- a/COMET.Web.Common/ViewModels/Components/ParameterEditors/OrientationViewModel.cs +++ b/COMET.Web.Common/ViewModels/Components/ParameterEditors/OrientationViewModel.cs @@ -138,7 +138,7 @@ public Task OnMatrixValuesChanged(int index, string value) { var orientationMatrix = this.Orientation.Matrix; - if (double.TryParse(value, out var valueParsed)) + if (double.TryParse(value, CultureInfo.InvariantCulture, out var valueParsed)) { orientationMatrix[index] = valueParsed; this.Orientation = new Orientation(orientationMatrix, this.AngleFormat);