diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs index 234b01ae10728383296f67babb7e3f9e4a120fb6..775cf9c36919d79e99ac48a1ea501825951df8ef 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/IFollowUpSimulatorFactoryCreator.cs @@ -8,6 +8,9 @@ using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.FileIO; using TUGraz.VectoCore.OutputData.XML; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationFile.VehicleInformationFile_0_1; namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory { @@ -54,22 +57,31 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory private readonly IDeclarationReport _originalDeclarationReport; private readonly IDeclarationInputDataProvider _currentStageInputData; + private readonly IManufacturerReportFactory _mrfFactory; + private readonly IVIFReportFactory _vifFactory; + public InterimAfterPrimaryFactoryCreator(IMultistagePrimaryAndStageInputDataProvider originalStageInputData, IOutputDataWriter originalReportWriter, IDeclarationReport originalDeclarationReport, ISimulatorFactoryFactory simFactoryFactory, - IXMLInputDataReader inputDataReader, bool validate) : base(simFactoryFactory, validate) + IXMLInputDataReader inputDataReader, + IManufacturerReportFactory mrfFactory, + IVIFReportFactory vifFactory, + bool validate) : base(simFactoryFactory, validate) { _originalStageInputData = originalStageInputData; _inputDataReader = inputDataReader; _originalReportWriter = originalReportWriter; _originalDeclarationReport = originalDeclarationReport; + _mrfFactory = mrfFactory; + _vifFactory = vifFactory; + _currentStageOutputDataWriter = new TempFileOutputWriter(originalReportWriter, ReportType.DeclarationReportManufacturerXML) ; _currentStageDeclarationReport = - new XMLDeclarationReportPrimaryVehicle_09(_currentStageOutputDataWriter); + new XMLDeclarationReportPrimaryVehicle(_currentStageOutputDataWriter,_mrfFactory, _vifFactory); _currentStageInputData = originalStageInputData.PrimaryVehicle; } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactoryDeclaration.cs b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactoryDeclaration.cs index 57130ddcfa7d59abcb6ad4e12d9fb9aa9049c1f3..3fc5aa35ee24bc46d612b4d1a35b068e9409ba58 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactoryDeclaration.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactoryDeclaration.cs @@ -10,6 +10,8 @@ using TUGraz.VectoCore.InputData.Reader.Impl; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.FileIO; using TUGraz.VectoCore.OutputData.XML; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationFile.VehicleInformationFile_0_1; namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory { @@ -21,6 +23,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory private IDeclarationReport _currentStageDeclarationReport; private IVTPReport _currentStageVTPReport; protected readonly IXMLDeclarationReportFactory _xmlDeclarationReportFactory; + private IVIFReportFactory _vifFactory; + private IManufacturerReportFactory _mrfFactory; public SimulatorFactoryDeclaration(IInputDataProvider dataProvider, @@ -31,13 +35,14 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory IXMLInputDataReader xmlInputDataReader, ISimulatorFactoryFactory simulatorFactoryFactory, IXMLDeclarationReportFactory xmlDeclarationReportFactory, - IVectoRunDataFactoryFactory runDataFactoryFactory - ) : base(ExecutionMode.Declaration, writer, validate) + IVectoRunDataFactoryFactory runDataFactoryFactory, IVIFReportFactory vifFactory, IManufacturerReportFactory mrfFactory) : base(ExecutionMode.Declaration, writer, validate) { _xmlInputDataReader = xmlInputDataReader; _simFactoryFactory = simulatorFactoryFactory; _currentStageInputData = dataProvider; _xmlDeclarationReportFactory = xmlDeclarationReportFactory; + _vifFactory = vifFactory; + _mrfFactory = mrfFactory; _currentStageDeclarationReport = declarationReport ?? xmlDeclarationReportFactory.CreateReport(dataProvider, writer); @@ -84,7 +89,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory IXMLInputDataReader xmlInputDataReader, ISimulatorFactoryFactory simulatorFactoryFactory, IXMLDeclarationReportFactory xmlDeclarationReportFactory, - IVectoRunDataFactoryFactory runDataFactoryFactory) : this( + IVectoRunDataFactoryFactory runDataFactoryFactory, IVIFReportFactory vifFactory, IManufacturerReportFactory mrfFactory) : this( dataProvider: dataProvider, declarationReport: null, writer: writer, @@ -93,7 +98,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory xmlInputDataReader: xmlInputDataReader, simulatorFactoryFactory: simulatorFactoryFactory, xmlDeclarationReportFactory: xmlDeclarationReportFactory, - runDataFactoryFactory: runDataFactoryFactory) + runDataFactoryFactory: runDataFactoryFactory, vifFactory: vifFactory, mrfFactory: mrfFactory) { } @@ -125,7 +130,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory multistagePrimaryAndStageInputDataProvider, ReportWriter, currentStageDeclarationReport, - _simFactoryFactory, _xmlInputDataReader, Validate); + _simFactoryFactory, _xmlInputDataReader, _mrfFactory, _vifFactory, Validate); case IMultistageVIFInputData multistageVifInputData: if (multistageVifInputData.VehicleInputData != null) { return new CompletedAfterInterimPrimaryFactoryCreator( diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VTPReport/XMLVTPReport.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VTPReport/XMLVTPReport.cs index 826aee0066813c1df8857fbfe6f90e1b8a06e95d..9273061e2123c8234fd10e2cadcc6408d9df5f13 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VTPReport/XMLVTPReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VTPReport/XMLVTPReport.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Xml; using System.Xml.Linq; using NLog.Config; @@ -56,6 +57,8 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCore.Models.SimulationComponent.Impl; using LogManager = NLog.LogManager; +[assembly: InternalsVisibleTo("VectoCoreTest")] + namespace TUGraz.VectoCore.OutputData.XML { internal class XMLVTPReport : DeclarationReport<XMLVTPReport.ResultEntry>, IVTPReport diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle_09.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs similarity index 95% rename from VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle_09.cs rename to VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs index 897d7e22e9a7d5cdf6be13bca038c4628e14b4e1..94fe556a131a1c299ad2b760bf0d396236993dc1 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle_09.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs @@ -19,11 +19,11 @@ namespace TUGraz.VectoCore.OutputData.XML /// <summary> /// Create MRF and CIF of the complete(d) step /// </summary> - public class XMLDeclarationReportCompletedVehicle_09 : XMLDeclarationReport + public class XMLDeclarationReportCompletedVehicle : XMLDeclarationReport { #region Constructors - //public XMLDeclarationReportCompletedVehicle_09(IReportWriter writer) : base(writer) { } - public XMLDeclarationReportCompletedVehicle_09(IReportWriter writer, IManufacturerReportFactory mrfFactory, + //public XMLDeclarationReportCompletedVehicle(IReportWriter writer) : base(writer) { } + public XMLDeclarationReportCompletedVehicle(IReportWriter writer, IManufacturerReportFactory mrfFactory, ICustomerInformationFileFactory cifFactory, IVIFReportFactory vifFactory) : base(writer, mrfFactory, cifFactory) { diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs index 9e3fe51470a26b52c30465f1401a121fd379bb7b..e631cd8e07465ed801875fb11bd59f5a10c66f79 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs @@ -69,14 +69,14 @@ namespace TUGraz.VectoCore.OutputData.XML { if (multistageVifInputData.VehicleInputData == null) { - var reportCompleted = new XMLDeclarationReportCompletedVehicle_09(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory) + var reportCompleted = new XMLDeclarationReportCompletedVehicle(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory) { PrimaryVehicleReportInputData = multistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle, }; return reportCompleted; } else { - var report = new XMLDeclarationReportInterimVehicle_09(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory, _vifInterimFactory); + var report = new XMLDeclarationReportInterimVehicle(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory, _vifInterimFactory); return report; } } @@ -94,12 +94,12 @@ namespace TUGraz.VectoCore.OutputData.XML switch (declarationInputDataProvider.JobInputData.Vehicle.VehicleCategory) { case VehicleCategory.HeavyBusCompletedVehicle: - return new XMLDeclarationReportCompletedVehicle_09(outputDataWriter) + return new XMLDeclarationReportCompletedVehicle(outputDataWriter,_mrfFactory,_cifFactory,_vifFactory) { PrimaryVehicleReportInputData = declarationInputDataProvider.PrimaryVehicleData, }; case VehicleCategory.HeavyBusPrimaryVehicle: - return new XMLDeclarationReportPrimaryVehicle_09(outputDataWriter); + return new XMLDeclarationReportPrimaryVehicle(outputDataWriter, _mrfFactory, _vifFactory); default: break; diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportInterimVehicle_09.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportInterimVehicle.cs similarity index 94% rename from VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportInterimVehicle_09.cs rename to VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportInterimVehicle.cs index 68d621f80590b09e7660ecb880d7d4f15c73b9d3..e252ed1f39655b8934babe6903de157dd37319db 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportInterimVehicle_09.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportInterimVehicle.cs @@ -13,14 +13,14 @@ 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 : XMLDeclarationReport { protected readonly IVIFReportFactory _vifFactory; protected IXMLMultistepIntermediateReport MultistepIntermediateBusReport; protected readonly IVIFReportInterimFactory _interimFactory; - public XMLDeclarationReportInterimVehicle_09(IReportWriter writer, + public XMLDeclarationReportInterimVehicle(IReportWriter writer, IManufacturerReportFactory mrfFactory, ICustomerInformationFileFactory cifFactory, IVIFReportFactory vifFactory, IVIFReportInterimFactory interimFactory) : base(writer, mrfFactory, cifFactory) diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportPrimaryVehicle_09.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportPrimaryVehicle.cs similarity index 94% rename from VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportPrimaryVehicle_09.cs rename to VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportPrimaryVehicle.cs index 1dc4298633ea76bc033784837b08c5dbbe34ef36..a45cdf4f7d6a122e6c2a60cf6d031691748e05e5 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportPrimaryVehicle_09.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportPrimaryVehicle.cs @@ -12,7 +12,7 @@ namespace TUGraz.VectoCore.OutputData.XML /// <summary> /// Create MRF and VIF for primary bus /// </summary> - public class XMLDeclarationReportPrimaryVehicle_09 : XMLDeclarationReport + public class XMLDeclarationReportPrimaryVehicle : XMLDeclarationReport { private readonly IVIFReportFactory _vifFactory; @@ -24,7 +24,7 @@ namespace TUGraz.VectoCore.OutputData.XML public override XDocument PrimaryVehicleReport => VehicleInformationFile?.Report; - public XMLDeclarationReportPrimaryVehicle_09(IReportWriter writer, + public XMLDeclarationReportPrimaryVehicle(IReportWriter writer, IManufacturerReportFactory mrfFactory, IVIFReportFactory vifFactory) : base(writer, mrfFactory, null) { diff --git a/VectoCore/VectoCoreTest/Integration/Multistage/MultistageVehicleTest.cs b/VectoCore/VectoCoreTest/Integration/Multistage/MultistageVehicleTest.cs index 5a00ac0d0606ad22ab5344076613d684082df76a..1e30eb8c6d64f755a4c9df057c76edc6e56f4688 100644 --- a/VectoCore/VectoCoreTest/Integration/Multistage/MultistageVehicleTest.cs +++ b/VectoCore/VectoCoreTest/Integration/Multistage/MultistageVehicleTest.cs @@ -22,6 +22,8 @@ using TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.FileIO; using TUGraz.VectoCore.OutputData.XML; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationFile.VehicleInformationFile_0_1; using TUGraz.VectoCore.Tests.Integration.Declaration; using TUGraz.VectoCore.Tests.Models.Simulation; using TUGraz.VectoCore.Utils; @@ -427,7 +429,9 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage var writer = new FileOutputWriter(outputFile); - var xmlreport = new XMLDeclarationReportPrimaryVehicle_09(writer); + var mrfFactory = _kernel.Get<IManufacturerReportFactory>(); + var vifFactory = _kernel.Get<IVIFReportFactory>(); + var xmlreport = new XMLDeclarationReportPrimaryVehicle(writer, mrfFactory, vifFactory); var factory = SimulatorFactory.CreateSimulatorFactory(ExecutionMode.Declaration, inputData, writer, xmlreport); factory.WriteModalResults = true; factory.Validate = false; diff --git a/VectoMockup/VectoMockup/Reports/MockupReportFactory.cs b/VectoMockup/VectoMockup/Reports/MockupReportFactory.cs index 9f6d8f16f2caaf25d314e67b0d09bac562cae200..e841f6e9fc8155059206e663083117772cd31ba2 100644 --- a/VectoMockup/VectoMockup/Reports/MockupReportFactory.cs +++ b/VectoMockup/VectoMockup/Reports/MockupReportFactory.cs @@ -106,7 +106,8 @@ namespace TUGraz.VectoMockup.Reports { case VehicleCategory.HeavyBusCompletedVehicle: throw new NotImplementedException(); - return new XMLDeclarationReportCompletedVehicle_09(outputDataWriter) + return new XMLDeclarationReportCompletedVehicle(outputDataWriter, _mrfFactory, _cifFactory, + _vifFactory) { PrimaryVehicleReportInputData = declarationInputDataProvider.PrimaryVehicleData, }; diff --git a/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupPrimaryReport.cs b/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupPrimaryReport.cs index be9a19230fac2c216501ae1ee1f2f120676780e5..774218a674bf7fd6e349d2a0e193ccb7afe56642 100644 --- a/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupPrimaryReport.cs +++ b/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupPrimaryReport.cs @@ -15,7 +15,7 @@ namespace TUGraz.VectoMockup.Reports /// <summary> /// Create MRF and VIF for primary bus /// </summary> - public class XMLDeclarationMockupPrimaryReport : XMLDeclarationReportPrimaryVehicle_09 + public class XMLDeclarationMockupPrimaryReport : XMLDeclarationReportPrimaryVehicle { private readonly bool _exempted; @@ -25,13 +25,12 @@ namespace TUGraz.VectoMockup.Reports IVIFReportFactory vifFactory, bool exempted) : base(writer, mrfFactory, - cifFactory, vifFactory) { _exempted = exempted; } - #region Overrides of XMLDeclarationReportPrimaryVehicle_09 + #region Overrides of XMLDeclarationReportPrimaryVehicle protected override void DoStoreResult(ResultEntry entry, VectoRunData runData, IModalDataContainer modData) { diff --git a/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupReportCompletedVehicle.cs b/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupReportCompletedVehicle.cs index 1e7169b8ad82b4cc41fa7dee3ea1431088c1a1f0..cc77d3ef778bf2e400c7d0b6087aa3fae240264a 100644 --- a/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupReportCompletedVehicle.cs +++ b/VectoMockup/VectoMockup/Reports/XMLDeclarationMockupReportCompletedVehicle.cs @@ -21,7 +21,7 @@ namespace TUGraz.VectoMockup.Reports /// <summary> /// Create VIF of an interim (or the complete(d) step /// </summary> - public class XMLDeclarationMockupReportInterimVehicle : XMLDeclarationReportInterimVehicle_09 + public class XMLDeclarationMockupReportInterimVehicle : XMLDeclarationReportInterimVehicle { private readonly bool _exempted; @@ -38,7 +38,7 @@ namespace TUGraz.VectoMockup.Reports /// <summary> /// Create MRF and CIF of the complete(d) step /// </summary> - public class XMLDeclarationMockupReportCompletedVehicle : XMLDeclarationReportCompletedVehicle_09 + public class XMLDeclarationMockupReportCompletedVehicle : XMLDeclarationReportCompletedVehicle { //private readonly IManufacturerReportFactory _mrfFactory; //private readonly ICustomerInformationFileFactory _cifFactory;