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 cded0132 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Added HEV/BEV Check in AbstractDeclarationVectoRunDataFactory

parent e236f050
No related branches found
No related tags found
No related merge requests found
......@@ -335,5 +335,10 @@ namespace TUGraz.VectoCommon.Utils
item7 = enumerator.Current;
}
}
/// <summary>
/// Checks if a value is one of the candidate values.
/// </summary>
public static bool IsOneOf<T>(this T self, params T[] candidates) => candidates.Contains(self);
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
......@@ -13,6 +14,7 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Impl;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.Utils;
using static TUGraz.VectoCommon.InputData.VectoSimulationJobType;
namespace TUGraz.VectoCore.InputData.Reader.Impl {
public abstract class AbstractDeclarationVectoRunDataFactory : LoggingObject, IVectoRunDataFactory
......@@ -41,6 +43,10 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl {
IDeclarationInputDataProvider dataProvider, IDeclarationReport report)
{
InputDataProvider = dataProvider;
if (dataProvider.JobInputData.JobType.IsOneOf(BatteryElectricVehicle, ParallelHybridVehicle, SerialHybridVehicle)){
throw new VectoSimulationException("Electric and Hybrid Vehicles are not supported in Declaration Mode. Aborting Simulation.");
}
Report = report;
_allowVocational = true;
......
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