diff --git a/VectoCore/Models/SimulationComponent/Data/AuxiliariesDemandAdapter.cs b/VectoCore/Models/SimulationComponent/Data/AuxiliariesDemandAdapter.cs index e4933fddb28c0a6d7e2b4941e1b92f07c328de6b..308719bfae171d9fb84c07db65ed7e53d3963946 100644 --- a/VectoCore/Models/SimulationComponent/Data/AuxiliariesDemandAdapter.cs +++ b/VectoCore/Models/SimulationComponent/Data/AuxiliariesDemandAdapter.cs @@ -32,7 +32,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data // Log.ErrorFormat("could not find entry in driving cycle for time {0}", absTime.TotalSeconds); // return 0; //} - Log.ErrorFormat("Found Entry at index {0}", entry); + if (entry == -1) { + Log.ErrorFormat("time: {0} could not find power demand for auxiliary {1}", absTime.TotalSeconds, _auxiliaryId); + throw new VectoSimulationException(String.Format("time: {0} could not find power demand for auxiliary {1}", absTime.TotalSeconds, _auxiliaryId)); + } return _auxiliaryId == null ? _drivingCycle.Entries[entry].AdditionalAuxPowerDemand : _drivingCycle.Entries[entry].AuxiliarySupplyPower[_auxiliaryId]; }