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

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

fixes for running exempted vehicles from GUI

parent bac4b974
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
{
return
Runs.Select(
r => new CycleTypeDescription { Name = r.Run.CycleName, CycleType = r.Run.GetContainer().RunData.Cycle.CycleType })
r => new CycleTypeDescription { Name = r.Run.CycleName, CycleType = r.Run.GetContainer().RunData.Cycle?.CycleType ?? CycleType.None })
.Distinct();
}
......
......@@ -47,7 +47,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
MeasuredSpeed,
MeasuredSpeedGear,
PTO,
VTP
VTP,
None
}
public static class CycleTypeHelper
......
......@@ -55,8 +55,8 @@ namespace TUGraz.VectoCore.Utils {
public static object[] ValueAsUnit(Watt power, string unit, uint? decimals = 0)
{
switch (unit) {
case "kW": return GetValueAsUnit(power.ConvertToKiloWatt(), unit, decimals);
case "W": return GetValueAsUnit(power.Value(), unit, decimals);
case "kW": return GetValueAsUnit(power?.ConvertToKiloWatt(), unit, decimals);
case "W": return GetValueAsUnit(power?.Value(), unit, decimals);
}
throw new NotImplementedException(string.Format("unknown unit '{0}'", unit));
}
......@@ -104,11 +104,14 @@ namespace TUGraz.VectoCore.Utils {
}
}
private static object[] GetValueAsUnit(double value, string unit, uint? decimals)
private static object[] GetValueAsUnit(double? value, string unit, uint? decimals)
{
if (value == null) {
return new object[0];
}
return new object[] {
new XAttribute(XMLNames.Report_Results_Unit_Attr, unit),
value.ToXMLFormat(decimals)
value.Value.ToXMLFormat(decimals)
};
}
......
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