You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get correct values for the conversion from "F" to "mK" I have to change this line in the UnitSystem.xml from <UnitOfMeasure domainID="mK" scale="0.001" baseOffset="-0.27315">
to <UnitOfMeasure domainID="mK" scale="0.001" baseOffset="-273.15">
Sample code to reproduce: using RepresentationUnitSystem = AgGateway.ADAPT.Representation.UnitSystem; ... private void erroneousConversion() { RepresentationUnitSystem.UnitOfMeasure sourceUOM = RepresentationUnitSystem.InternalUnitSystemManager.Instance.UnitOfMeasures["F"]; // Fahrenheit // RepresentationUnitSystem.UnitOfMeasure targetUOM = RepresentationUnitSystem.InternalUnitSystemManager.Instance.UnitOfMeasures["K"]; // Kelvin RepresentationUnitSystem.UnitOfMeasure targetUOM = RepresentationUnitSystem.InternalUnitSystemManager.Instance.UnitOfMeasures["mK"]; // Millikelvin RepresentationUnitSystem.UnitOfMeasureConverter converter = new RepresentationUnitSystem.UnitOfMeasureConverter(); double convertedValue = converter.Convert(sourceUOM, targetUOM, 0); // 0° F == 255.4 K System.Diagnostics.Debug.Print($"{convertedValue}"); convertedValue = converter.Convert(sourceUOM, targetUOM, 98.6); // 98.6° F == 310.1 K System.Diagnostics.Debug.Print($"{convertedValue}"); }
Activity