diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs index 4761f9e33b1bea9c9ca3cfb4572cdf660af2c690..950eec19dec9f1ab0d9b8379e5eb7b3f9b9c79ed 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -600,8 +600,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #endregion - public override XmlElement ADASNode => null; - public override AngledriveType AngledriveType => AngledriveType.None; public override RetarderType RetarderType => RetarderType.None; diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/XMLManufacturerReportExemptedTruck.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/XMLManufacturerReportExemptedTruck.cs index 1fe9400d30dc7511c957873c074bad77509cf8f8..1a2d964f310788f97dd9fce12ec778d2c0e2f222 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/XMLManufacturerReportExemptedTruck.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/XMLManufacturerReportExemptedTruck.cs @@ -42,16 +42,28 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport private XElement[] ExemptedData(VectoRunData modelData) { - return new[] { - modelData.VehicleData.HybridElectricHDV - ? new XElement( - tns + XMLNames.Vehicle_MaxNetPower1, XMLHelper.ValueAsUnit(modelData.VehicleData.MaxNetPower1, XMLNames.Unit_W)) - : null, - modelData.VehicleData.HybridElectricHDV - ? new XElement( - tns + XMLNames.Vehicle_MaxNetPower2, XMLHelper.ValueAsUnit(modelData.VehicleData.MaxNetPower2, XMLNames.Unit_W)) - : null - }; + var retVal = new List<XElement>(); + + if (modelData.VehicleData.AxleConfiguration != AxleConfiguration.AxleConfig_Undefined) { + retVal.Add(new XElement(tns + XMLNames.Vehicle_AxleConfiguration, + modelData.VehicleData.AxleConfiguration.GetName())); + retVal.Add(new XElement(tns + XMLNames.Report_Vehicle_VehicleGroup, + modelData.VehicleData.VehicleClass.GetClassNumber())); + } + + if (modelData.VehicleData.SleeperCab.HasValue) { + retVal.Add(new XElement(tns + XMLNames.Vehicle_SleeperCab, modelData.VehicleData.SleeperCab.Value)); + } + + if (modelData.VehicleData.MaxNetPower1 != null) + retVal.Add(new XElement(tns + XMLNames.Vehicle_MaxNetPower1, + XMLHelper.ValueAsUnit(modelData.VehicleData.MaxNetPower1, XMLNames.Unit_W))); + if (modelData.VehicleData.MaxNetPower2 != null) { + retVal.Add(new XElement(tns + XMLNames.Vehicle_MaxNetPower2, + XMLHelper.ValueAsUnit(modelData.VehicleData.MaxNetPower2, XMLNames.Unit_W))); + } + + return retVal.ToArray(); } } diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs index 46bec9b30a77f889c26d81e3bee348be4405cd4f..de0d9c3755678ec3c3e5a11eb292ba92649d4903 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs @@ -230,14 +230,17 @@ namespace TUGraz.VectoCore.OutputData.XML public override void InitializeReport(VectoRunData modelData, List<List<FuelData.Entry>> fuelModes) { - var weightingGroup = modelData.Exempted - ? WeightingGroup.Unknown - : DeclarationData.WeightingGroup.Lookup( - modelData.VehicleData.VehicleClass, modelData.VehicleData.SleeperCab, + if (modelData.Exempted) { + WeightingGroup = WeightingGroup.Unknown; + } else { + if (modelData.VehicleData.SleeperCab == null) { + throw new VectoException("SleeperCab parameter is required"); + } + + WeightingGroup = DeclarationData.WeightingGroup.Lookup( + modelData.VehicleData.VehicleClass, modelData.VehicleData.SleeperCab.Value, modelData.EngineData.RatedPowerDeclared); - _weightingFactors = weightingGroup == WeightingGroup.Unknown - ? ZeroWeighting - : DeclarationData.WeightingFactors.Lookup(weightingGroup); + } InstantiateReports(modelData); @@ -245,6 +248,8 @@ namespace TUGraz.VectoCore.OutputData.XML CustomerRpt.Initialize(modelData, fuelModes); } + public WeightingGroup WeightingGroup { get; protected set; } + protected virtual void InstantiateReports(VectoRunData modelData) { if (modelData.Exempted) {