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 87bd32e6 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

add property to indicate successful completion of a run

parent 91a53216
No related branches found
No related tags found
No related merge requests found
......@@ -17,5 +17,7 @@ namespace TUGraz.VectoCore.Models.Simulation
/// </summary>
/// <returns></returns>
IVehicleContainer GetContainer();
bool FinishedWithoutErrors { get; }
}
}
\ No newline at end of file
......@@ -36,6 +36,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
ds = r.MaxDistance;
}).
Case<ResponseCycleFinished>(r => {
FinishedWithoutErrors = true;
Log.Info("========= Driving Cycle Finished");
}).
Default(r => {
......
......@@ -23,6 +23,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
//protected IModalDataWriter DataWriter { get; set; }
protected IVehicleContainer Container { get; set; }
public bool FinishedWithoutErrors { get; protected set; }
protected VectoRun(IVehicleContainer container)
{
Container = container;
......@@ -50,14 +52,20 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
}
} while (response is ResponseSuccess);
} catch (VectoSimulationException vse) {
Log.Error("SIMULATION RUN ABORTED! ========================");
Log.Error(vse);
Container.FinishSimulation();
throw new VectoSimulationException("{6} - absTime: {0}, distance: {1}, dt: {2}, v: {3}, Gear: {4} | {5}", vse,
AbsTime, Container.Distance, dt, Container.VehicleSpeed, Container.Gear, vse.Message, Name);
} catch (VectoException ve) {
Log.Error("SIMULATION RUN ABORTED! ========================");
Log.Error(ve);
Container.FinishSimulation();
throw new VectoSimulationException("{6} - absTime: {0}, distance: {1}, dt: {2}, v: {3}, Gear: {4} | {5}", ve,
AbsTime, Container.Distance, dt, Container.VehicleSpeed, Container.Gear, ve.Message, Name);
} catch (Exception e) {
Log.Error("SIMULATION RUN ABORTED! ========================");
Log.Error(e);
Container.FinishSimulation();
throw new VectoSimulationException("{6} - absTime: {0}, distance: {1}, dt: {2}, v: {3}, Gear: {4} | {5}", e, AbsTime,
Container.Distance, dt, Container.VehicleSpeed, Container.Gear, e.Message, Name);
......
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