diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAngleDriveType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAngleDriveType.cs index 71665bdef412ee440d13d21f1354003ab28ec2aa..d39ddf2bc91db1fbefb9183385e7ba63a818e0e0 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAngleDriveType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAngleDriveType.cs @@ -17,8 +17,9 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF public XElement GetElement(IDeclarationInputDataProvider inputData) { var angelDrive = inputData.JobInputData.Vehicle.Components.AngledriveInputData; - if (angelDrive == null) + if (angelDrive?.Type == AngledriveType.None || angelDrive == null) { return null; + } return new XElement(_vif + XMLNames.Component_Angledrive, new XElement(_vif + XMLNames.ComponentDataWrapper, diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs index e6946487e5b81f3441a5caa39e36d89be7204f4e..1255de6fb7ef8ad85c48c8514ac5db1836dbd869 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport_0_9.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml.Linq; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; @@ -14,21 +15,56 @@ namespace TUGraz.VectoCore.OutputData.XML /// <summary> /// Create MRF and VIF for primary bus /// </summary> - public class XMLDeclarationReportPrimaryVehicle_09 : XMLDeclarationReportPrimaryVehicle + public class XMLDeclarationReportPrimaryVehicle_09 : XMLDeclarationReport09 { - private readonly IManufacturerReportFactory _mrfFactory; + private readonly IManufacturerReportFactory _mrfFactory; private readonly IVIFReportFactory _vifFactory; + protected IXMLVehicleInformationFile VehicleInformationFile; + + public override XDocument CustomerReport => null; + + public override XDocument PrimaryVehicleReport => VehicleInformationFile?.Report; + public XMLDeclarationReportPrimaryVehicle_09(IReportWriter writer, IManufacturerReportFactory mrfFactory, ICustomerInformationFileFactory cifFactory, - IVIFReportFactory vifFactory) : base(writer) + IVIFReportFactory vifFactory) : base(writer, mrfFactory, cifFactory) { _mrfFactory = mrfFactory; //_cifFactory = cifFactory; _vifFactory = vifFactory; } + public override void InitializeReport(VectoRunData modelData, List<List<FuelData.Entry>> fuelModes) + { + base.InitializeReport(modelData, fuelModes); + VehicleInformationFile.Initialize(modelData, fuelModes); + } + + + + protected override void WriteResult(ResultEntry result) + { + base.WriteResult(result); + VehicleInformationFile.WriteResult(result); + } + + protected override void GenerateReports() + { + ManufacturerRpt.GenerateReport(); + var fullReportHash = GetSignature(ManufacturerRpt.Report); + CustomerRpt.GenerateReport(fullReportHash); + VehicleInformationFile.GenerateReport(fullReportHash); + } + + + + protected override void OutputReports() + { + Writer.WriteReport(ReportType.DeclarationReportManufacturerXML, ManufacturerRpt.Report); + Writer.WriteReport(ReportType.DeclarationReportPrimaryVehicleXML, VehicleInformationFile.Report); + } @@ -63,7 +99,7 @@ namespace TUGraz.VectoCore.OutputData.XML /// <summary> /// Create VIF of an interim (or the complete(d) step /// </summary> - public class XMLDeclarationReportInterimVehicle_09 : XMLDeclarationReport + public class XMLDeclarationReportInterimVehicle_09 : XMLDeclarationReport09 { protected readonly IVIFReportFactory _vifFactory; @@ -73,7 +109,7 @@ namespace TUGraz.VectoCore.OutputData.XML public XMLDeclarationReportInterimVehicle_09(IReportWriter writer, IManufacturerReportFactory mrfFactory, ICustomerInformationFileFactory cifFactory, - IVIFReportFactory vifFactory, IVIFReportInterimFactory interimFactory) : base(writer) + IVIFReportFactory vifFactory, IVIFReportInterimFactory interimFactory) : base(writer, mrfFactory, cifFactory) { _vifFactory = vifFactory; _interimFactory = interimFactory;