From 38af637e3f79b602e495ae6947cb752a16ca21da Mon Sep 17 00:00:00 2001 From: Harald Martini <harald.martini@student.tugraz.at> Date: Tue, 17 May 2022 08:41:37 +0200 Subject: [PATCH] added output types to xmlnames, implemented summary writing --- .../AbstractCustomerReport.cs | 11 ++++++++++- .../CustomerInformationFile.cs | 10 +++++----- .../ManufacturerReport/LorryManufacturerReports.cs | 10 +++++----- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/AbstractCustomerReport.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/AbstractCustomerReport.cs index c8989250e9..375a9170cd 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/AbstractCustomerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/AbstractCustomerReport.cs @@ -24,6 +24,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation protected abstract string OutputDataType { get; } + private bool _ovc = false; protected AbstractCustomerReport(ICustomerInformationFileFactory cifFactory) { _cifFactory = cifFactory; @@ -37,6 +38,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public void Initialize(VectoRunData modelData, List<List<FuelData.Entry>> fuelModes) { InitializeVehicleData(modelData.InputData); + _ovc = modelData.VehicleData.Ocv; Results = new XElement(Cif + "Results"); } @@ -66,7 +68,14 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public void WriteMockupResult(XMLDeclarationReport.ResultEntry resultValue) { - Results.Add(MockupResultReader.GetCIFMockupResult(OutputDataType, resultValue, Cif + "Result")); + Results.Add(MockupResultReader.GetCIFMockupResult(OutputDataType, resultValue, Cif + "Result", _ovc)); + } + + public void WriteMockupSummary(XMLDeclarationReport.ResultEntry resultValue) + { + Results.AddFirst(new XElement(Cif + "Status", "success")); + Results.AddFirst(new XComment("Always prints success at the moment")); + Results.Add(MockupResultReader.GetCIFMockupResult(OutputDataType, resultValue, Cif + "Summary", _ovc)); } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CustomerInformationFile/CustomerInformationFile.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CustomerInformationFile/CustomerInformationFile.cs index 8aa2511c59..315c55be0a 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CustomerInformationFile/CustomerInformationFile.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CustomerInformationFile/CustomerInformationFile.cs @@ -48,7 +48,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public class HEV_PxLorry_CIF : CustomerInformationFile { - protected override string OutputDataType => "HEV_Px_LorryOutputType"; + protected override string OutputDataType => XMLNames.CIF_OutputDataType_HEV_Px_LorryOutputType; public HEV_PxLorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { } #region Overrides of AbstractCustomerReport @@ -63,7 +63,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public class HEV_S2_Lorry_CIF : CustomerInformationFile { - protected override string OutputDataType => "HEV_S2_LorryOutputType"; + protected override string OutputDataType => XMLNames.CIF_OutputDataType_HEV_S2_LorryOutputType; public HEV_S2_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { } #region Overrides of AbstractCustomerReport @@ -78,7 +78,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public class HEV_S3_Lorry_CIF : CustomerInformationFile { - protected override string OutputDataType => "HEV_S3_LorryOutputType"; + protected override string OutputDataType => XMLNames.CIF_OutputDataType_HEV_S3_LorryOutputType; public HEV_S3_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { } #region Overrides of AbstractCustomerReport @@ -93,7 +93,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public class HEV_S4_Lorry_CIF : CustomerInformationFile { - protected override string OutputDataType => "HEV_S4_LorryOutputType"; + protected override string OutputDataType => XMLNames.CIF_OutputDataType_HEV_S4_LorryOutputType; public HEV_S4_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { } #region Overrides of AbstractCustomerReport @@ -108,7 +108,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation public class HEV_IEPC_Lorry_CIF : CustomerInformationFile { - protected override string OutputDataType => "HEV_IEPC_S_LorryOutputType"; + protected override string OutputDataType => XMLNames.CIF_OutputDataType_HEV_IEPC_S_LorryOutputType; public HEV_IEPC_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { } #region Overrides of AbstractCustomerReport diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/LorryManufacturerReports.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/LorryManufacturerReports.cs index af9f14df1d..45bdf572ba 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/LorryManufacturerReports.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/LorryManufacturerReports.cs @@ -59,7 +59,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #region Overrides of AbstractManufacturerReport - public override string OutputDataType => "HEV-Px_IHPCLorryManufacturerOutputDataType"; + public override string OutputDataType => XMLNames.MRF_OutputDataType_HEV_Px_IHPCLorryManufacturerOutputDataType; public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { @@ -79,7 +79,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #region Overrides of AbstractManufacturerReport - public override string OutputDataType => "HEV-S2_LorryManufacturerOutputDataType"; + public override string OutputDataType => XMLNames.MRF_OutputDataType_HEV_S2_LorryManufacturerOutputDataType; public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { @@ -92,7 +92,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. internal class HEV_S3_LorryManufacturerReport : LorryManufacturerReportBase { - public override string OutputDataType => "HEV-S3_LorryManufacturerOutputDataType"; + public override string OutputDataType => XMLNames.MRF_OutputDataType_HEV_S3_LorryManufacturerOutputDataType; public HEV_S3_LorryManufacturerReport(IManufacturerReportFactory MRFReportFactory) : base(MRFReportFactory) { @@ -116,7 +116,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #region Overrides of AbstractManufacturerReport - public override string OutputDataType => "HEV-S4_LorryManufacturerOutputDataType"; + public override string OutputDataType => XMLNames.MRF_OutputDataType_HEV_S4_LorryManufacturerOutputDataType; public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { @@ -132,7 +132,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #region Overrides of AbstractManufacturerReport - public override string OutputDataType => "HEV-IEPC-S_LorryManufacturerOutputDataType"; + public override string OutputDataType => XMLNames.MRF_OutputDataType_HEV_IEPC_S_LorryManufacturerOutputDataType; public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { -- GitLab