diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 556164df237d25e206c5992a102e2f5b8d0c3b2e..9041915e16d55ef2788ae855c8d1b5f79d578a58 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -769,6 +769,14 @@ namespace TUGraz.VectoCommon.InputData //double OverloadRecoveryFactor { get; } } + public static class IElectricMotorInputDataHelper + { + public static bool IsIHPC(this IElectricMotorDeclarationInputData em) + { + return ((!em.IHPCType.IsNullOrEmpty()) && (em.IHPCType != "None")); + } + } + public interface IElectricMotorVoltageLevel { Volt VoltageLevel { get; } @@ -833,7 +841,23 @@ namespace TUGraz.VectoCommon.InputData public PowertrainPosition Position { get; set; } - public double RatioADC { get; set; } + private double? _ratioADC = null; + /// <summary> + /// If not overridden RatioADC == ADC?.Ratio ?? 1; + /// Can only be overridden when ADC == null; + /// </summary> + public double RatioADC { + get + { + //Engineering mode sets RatioADC, decl mode sets ADC + if (_ratioADC.HasValue && ADC == null) { + return _ratioADC.Value; + } else { + return ADC?.Ratio ?? 1; + } + } + set => _ratioADC = value; + } public double[] RatioPerGear { get; set; }