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

Skip to content
Snippets Groups Projects
Commit a1b24344 authored by Harald MARTINI's avatar Harald MARTINI
Browse files

updated Simulator factory to create mockup runs if property is set

parent f85e6ba4
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ using System.Threading;
using System.Xml;
using Newtonsoft.Json;
using Ninject;
using NLog.LayoutRenderers;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
......@@ -49,6 +50,7 @@ using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using TUGraz.VectoCore.InputData.Reader.Impl;
using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.Simulation.Impl.Mockup;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.FileIO;
......@@ -165,10 +167,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
var current = i++;
var d = data;
data.JobRunId = current;
yield return data.Exempted || data.MultistageRun ? GetExemptedRun(data) : GetNonExemptedRun(data, current, d, ref warning1Hz);
yield return (data.Exempted || data.MultistageRun) ? GetExemptedRun(data) : GetNonExemptedRun(data, current, d, ref warning1Hz);
}
}
private IVectoRun GetExemptedRun(VectoRunData data)
{
if (data.Report != null) {
......@@ -184,6 +187,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
private IVectoRun GetNonExemptedRun(VectoRunData data, int current, VectoRunData d, ref bool warning1Hz)
{
var addReportResult = PrepareReport(data);
if (MockUpRun) {
return new MockupRun(new VehicleContainer(ExecutionMode.Declaration,
new ModalDataContainer(data, ReportWriter, addReportResult)) {RunData = data});
}
if (!data.Cycle.CycleType.IsDistanceBased() && ModalResults1Hz && !warning1Hz) {
Log.Error("Output filter for 1Hz results is only available for distance-based cycles!");
warning1Hz = 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