Code development platform for open source projects from the European Union institutions

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

P2.5: make sure there is a transmission ratio for every gear

parent ff518ff1
No related branches found
No related tags found
No related merge requests found
using System;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Security.Cryptography;
using NLog.LayoutRenderers;
......@@ -41,7 +42,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
ModelData = data;
Position = position;
TransmissionRatioPerGear = Position == PowertrainPosition.HybridP2_5 ? ModelData.RatioPerGear : null;
if (Position == PowertrainPosition.HybridP2_5) {
TransmissionRatioPerGear = ModelData.RatioPerGear;
if (TransmissionRatioPerGear == null ||
TransmissionRatioPerGear.Length < container.RunData.GearboxData.GearList.Count()) {
throw new VectoException("For powertrain configuration P2.5 a EM ratio for every gear has to be provided!");
}
}
container.AddComponent(this); // We have to do this again because in the base class the position is unknown!
......
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