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

fix: fuel type has no density; fix: time share per gear

parent e1d95f01
No related branches found
No related tags found
No related merge requests found
......@@ -369,7 +369,7 @@ namespace TUGraz.VectoCore.OutputData
public static SI FuelConsumptionFinalLiterPer100Kilometer(this IModalDataContainer data)
{
var fuelConsumptionFinal = data.FuelConsumptionFinal();
if (fuelConsumptionFinal == null) {
if (fuelConsumptionFinal == null || data.FuelData.FuelDensity == null) {
return null;
}
......@@ -538,12 +538,15 @@ namespace TUGraz.VectoCore.OutputData
retVal[i] = 0.SI<Scalar>();
}
data.GetValues(x => {
var gear = x.Field<uint>((int)ModalResultField.Gear);
retVal[gear] += x.Field<Second>((int)ModalResultField.simulationInterval).Value();
return gear; // not used
var gearData = data.GetValues(x => new {
Gear = x.Field<uint>((int)ModalResultField.Gear),
dt = x.Field<Second>((int)ModalResultField.simulationInterval)
});
foreach (var entry in gearData) {
retVal[entry.Gear] += entry.dt.Value();
}
var duration = Duration(data).Value();
for (uint i = 0; i <= gearCount; i++) {
retVal[i] = 100 * retVal[i] / duration;
......
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