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

Skip to content
Snippets Groups Projects
Commit 96396423 authored by Harald Martini's avatar Harald Martini
Browse files

throw exception if pto transmission is specified but the vehicle has no gearbox

parent ea60de4e
No related branches found
No related tags found
No related merge requests found
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.Reader.ComponentData;
using TUGraz.VectoCore.Models.Declaration;
......@@ -71,6 +72,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen
public override PTOData CreatePTOTransmissionData(IPTOTransmissionInputData pto, IGearboxDeclarationInputData gbx)
{
if (gbx == null && pto != null && (pto.PTOTransmissionType != "None")) {
throw new VectoException("PTO specified but the vehicle has no gearbox");
}
if ((gbx != null) && (pto != null) && (pto.PTOTransmissionType != "None"))
{
var powerDemand = DeclarationData.PTOTransmission.Lookup(pto.PTOTransmissionType).PowerDemand;
......@@ -81,6 +86,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen
LossMap = PTOIdleLossMapReader.GetZeroLossMap(),
};
}
return null;
}
}
......
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