diff --git a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs index 699d079b229657c0c5f6884ce8dc15197743429b..9850b5e55e4ea27732de7cc0a2e7e894cfba351e 100644 --- a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs @@ -615,6 +615,9 @@ namespace TUGraz.VectoCore.OutputData public static Scalar ICEMaxLoadTimeShare(this IModalDataContainer data) { + if (!data.HasCombustionEngine) { + return 0.SI<Scalar>(); + } var tmp = data.GetValues(x => new { tMax = x.Field<NewtonMeter>(ModalResultField.T_ice_full.GetName()).DefaultIfNull(-1), tEng = x.Field<NewtonMeter>(ModalResultField.T_ice_fcmap.GetName()).DefaultIfNull(0), @@ -656,6 +659,9 @@ namespace TUGraz.VectoCore.OutputData /// <returns></returns> public static Scalar GearshiftCount(this IModalDataContainer data) { + if (!data.HasGearbox) { + return 0.SI<Scalar>(); + } var prevGear = data.GetValues<uint>(ModalResultField.Gear).First(); var lastGear = prevGear; var gearCount = 0;