Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

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
Branches
Tags
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.
Please register or to comment