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

Skip to content
Snippets Groups Projects
Commit 06bb7200 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

xml reports: set input to correct property for buses

parent da504e10
No related branches found
No related tags found
No related merge requests found
......@@ -217,6 +217,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation
_ovc = modelData.VehicleData.OffVehicleCharging;
var inputData = modelData.InputData as IMultistepBusInputDataProvider;
Input = inputData.JobInputData.PrimaryVehicle.Vehicle;
if (inputData == null) {
throw new VectoException("CompletedBus CustomerInformationFile requires MultistepBusInputData");
}
......
......@@ -59,7 +59,17 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.
{
if (modelData.VehicleData.VehicleClass.IsBus())
{
Input = modelData.InputData.PrimaryVehicleData.Vehicle;
switch (modelData.InputData) {
case ISingleBusInputDataProvider single:
Input = single.PrimaryVehicle;
break;
case IMultistepBusInputDataProvider multistep:
Input = multistep.JobInputData.PrimaryVehicle.Vehicle;
break;
case IDeclarationInputDataProvider declaration:
Input = declaration.JobInputData.Vehicle;
break;
}
}
else
{
......
......@@ -26,6 +26,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.
InitializeVehicleData(modelData.InputData);
_ovc = modelData.VehicleData.OffVehicleCharging;
var inputData = modelData.InputData as IMultistepBusInputDataProvider;
Input = inputData.JobInputData.PrimaryVehicle.Vehicle;
if (inputData == null) {
throw new VectoException("CompletedBus ManrufacturersRecordFile requires MultistepBusInputData");
}
......
......@@ -115,7 +115,7 @@ namespace TUGraz.VectoCore.OutputData.XML
public IFuelConsumptionCorrection FuelConsumptionFinal(FuelType fuelType)
{
return CorrectedFinalFuelConsumption[fuelType];
return CorrectedFinalFuelConsumption.ContainsKey(fuelType) ? CorrectedFinalFuelConsumption[fuelType] : null;
}
public WattSecond ElectricEnergyConsumption { get; private set; }
......
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