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

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

extend xml declaration input tests to read out allowed options from XSD

parent 6b9817c3
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter ...@@ -50,6 +50,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
{ {
public class DeclarationDataAdapter : AbstractSimulationDataAdapter public class DeclarationDataAdapter : AbstractSimulationDataAdapter
{ {
public static readonly GearboxType[] SupportedGearboxTypes = {GearboxType.MT, GearboxType.AMT, GearboxType.ATPowerSplit, GearboxType.ATSerial};
public DriverData CreateDriverData() public DriverData CreateDriverData()
{ {
var lookAheadData = new DriverData.LACData { var lookAheadData = new DriverData.LACData {
...@@ -208,13 +210,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter ...@@ -208,13 +210,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
WarnDeclarationMode("GearboxData"); WarnDeclarationMode("GearboxData");
} }
var retVal = SetCommonGearboxData(gearbox); var retVal = SetCommonGearboxData(gearbox);
switch (gearbox.Type) {
case GearboxType.DrivingCycle: if (!SupportedGearboxTypes.Contains(gearbox.Type)) {
case GearboxType.ATPowerSplit: throw new VectoSimulationException("Unsupported gearbox type: {0}!", retVal.Type);
throw new VectoSimulationException(
"Unsupported gearbox type: {0}!", retVal.Type);
//case GearboxType.Custom:
// throw new VectoSimulationException("Custom Transmission not supported in DeclarationMode!");
} }
var gearsInput = gearbox.Gears; var gearsInput = gearbox.Gears;
if (gearsInput.Count < 1) { if (gearsInput.Count < 1) {
......
...@@ -70,6 +70,11 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -70,6 +70,11 @@ namespace TUGraz.VectoCore.Models.Declaration
return Lookup(vehicleCategory, axleConfiguration, grossVehicleMassRating, curbWeight, false); return Lookup(vehicleCategory, axleConfiguration, grossVehicleMassRating, curbWeight, false);
} }
public VehicleCategory[] GetVehicleCategories(bool declarationOnly = true)
{
return _segmentTable.AsEnumerable().Where(r => !declarationOnly || r.Field<string>("valid") == "1").Select(r => EnumHelper.ParseEnum<VehicleCategory>(r.Field<string>("vehiclecategory"))).Distinct().ToArray();
}
public Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration, public Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration,
Kilogram grossVehicleMassRating, Kilogram curbWeight, bool considerInvalid) Kilogram grossVehicleMassRating, Kilogram curbWeight, bool considerInvalid)
{ {
......
This diff is collapsed.
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