From ea9910a559074f84e6b46201000993ccf12c1dc7 Mon Sep 17 00:00:00 2001 From: Andrew Vardeman Date: Fri, 23 Jan 2026 10:33:15 -0600 Subject: [PATCH] Fix a casting bug in GetNumberOfInstalledSections --- .../Import/CondensedWorkStateMeterCreator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ISOv4Plugin/Mappers/LoggedDataMappers/Import/CondensedWorkStateMeterCreator.cs b/ISOv4Plugin/Mappers/LoggedDataMappers/Import/CondensedWorkStateMeterCreator.cs index b1e5c3e..a4facd0 100644 --- a/ISOv4Plugin/Mappers/LoggedDataMappers/Import/CondensedWorkStateMeterCreator.cs +++ b/ISOv4Plugin/Mappers/LoggedDataMappers/Import/CondensedWorkStateMeterCreator.cs @@ -133,7 +133,7 @@ public List CreateMeters(IEnumerable spatialR public EnumeratedValue GetValueForMeter(SpatialValue value, ISOEnumeratedMeter meter)// EnumeratedWorkingData meter) { - var sectionValue = GetSectionValue((uint)(int)value.Value, meter.SectionIndex); //Mac arm processors fail to correctly decode the value without the double (uint)(int) cast + var sectionValue = GetSectionValue((uint)(int)value.Value, meter.SectionIndex); //Mac arm processors fail to correctly decode the value without the double (uint)(int) cast. Same behavior seen on .NET 10 for Windows. See https://stackoverflow.com/questions/79762063/different-result-by-cast-negative-double-to-uint-with-net-framework-4-7-2-and var enumerationMember = SectionValueToEnumerationMember[(int)sectionValue]; return new EnumeratedValue @@ -148,7 +148,7 @@ public EnumeratedValue GetValueForMeter(SpatialValue value, ISOEnumeratedMeter m private int GetNumberOfInstalledSections(SpatialValue spatialValue) { - var value = (uint)spatialValue.Value; + var value = (uint)(int)spatialValue.Value; //Mac arm processors fail to correctly decode the value without the double (uint)(int) cast. Same behavior seen on .NET 10 for Windows. See https://stackoverflow.com/questions/79762063/different-result-by-cast-negative-double-to-uint-with-net-framework-4-7-2-and const uint notInstalledValue = 0x03; for (int i = 1; i < 17; i++)