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

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

moddata: calculate ice max load time share and gearshift count only if ICE and...

moddata: calculate ice max load time share and gearshift count only if ICE and transmission are present
parent 79d6784b
No related branches found
No related tags found
No related merge requests found
......@@ -615,6 +615,9 @@ namespace TUGraz.VectoCore.OutputData
public static Scalar ICEMaxLoadTimeShare(this IModalDataContainer data)
{
if (!data.HasCombustionEngine) {
return 0.SI<Scalar>();
}
var tmp = data.GetValues(x => new {
tMax = x.Field<NewtonMeter>(ModalResultField.T_ice_full.GetName()).DefaultIfNull(-1),
tEng = x.Field<NewtonMeter>(ModalResultField.T_ice_fcmap.GetName()).DefaultIfNull(0),
......@@ -656,6 +659,9 @@ namespace TUGraz.VectoCore.OutputData
/// <returns></returns>
public static Scalar GearshiftCount(this IModalDataContainer data)
{
if (!data.HasGearbox) {
return 0.SI<Scalar>();
}
var prevGear = data.GetValues<uint>(ModalResultField.Gear).First();
var lastGear = prevGear;
var gearCount = 0;
......
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