Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 5c885dd3 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

throw exception if no power demand can be found

parent 286a2a78
No related branches found
No related tags found
No related merge requests found
......@@ -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];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment