diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IInternalResultWriterFactory.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IInternalResultWriterFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..63c0bb1841804ca93b913a19f8a6c84f4337cb34 --- /dev/null +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IInternalResultWriterFactory.cs @@ -0,0 +1,10 @@ +using TUGraz.VectoCore.Utils.Ninject; + +namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.ResultWriter +{ + public interface IInternalResultWriterFactory + { + IResultsWriter GetCIFResultsWriter( + VehicleTypeAndArchitectureStringHelperResults.ResultsVehicleClassification vehicleClasiClassification); + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriter.cs index 7a996d1487ef606128059f5aa36d5c03ee400153..e60af7a75c51aabd26f66c946bb9de45c27eb48b 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriter.cs @@ -1,54 +1,15 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; -using TUGraz.VectoCore.Utils.Ninject; namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.ResultWriter { - public interface IResultsWriterFactory - { - IResultsWriter GetCIFResultsWriter(string vehicleCategory, VectoSimulationJobType jobType, bool ovc, - bool exempted); - } - - public interface IInternalResultWriterFactory - { - IResultsWriter GetCIFResultsWriter( - VehicleTypeAndArchitectureStringHelperResults.ResultsVehicleClassification vehicleClasiClassification); - } - - public class ResultWriterFactory : IResultsWriterFactory - { - private readonly IInternalResultWriterFactory _internalFactory; - - public ResultWriterFactory(IInternalResultWriterFactory internalFactory) - { - _internalFactory = internalFactory; - } - - #region Implementation of IResultsWriterFactory - - public IResultsWriter GetCIFResultsWriter(string vehicleCategory, VectoSimulationJobType jobType, bool ovc, bool exempted) - { - try { - return _internalFactory.GetCIFResultsWriter( - new VehicleTypeAndArchitectureStringHelperResults.ResultsVehicleClassification(vehicleCategory, - jobType, ovc, exempted)); - } catch (Exception e) { - throw new Exception($"Could not create ResultsWriter for vehicle category {vehicleCategory}, {jobType}, ovc: {ovc}, exempted: {exempted}", e); - } - } - - #endregion - } - public interface IResultsWriter { XElement GenerateResults(List<IResultEntry> results); } + public class ExemptedResultsWriter : IResultsWriter { protected XNamespace XmlNS => XNamespace.Get("urn:tugraz:ivt:VectoAPI:CustomerOutput:v0.9"); diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriterFactory.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriterFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..58b3b79fdd5832a679f3e44964285d8b37566c7c --- /dev/null +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/IResultsWriterFactory.cs @@ -0,0 +1,10 @@ +using TUGraz.VectoCommon.InputData; + +namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.ResultWriter +{ + public interface IResultsWriterFactory + { + IResultsWriter GetCIFResultsWriter(string vehicleCategory, VectoSimulationJobType jobType, bool ovc, + bool exempted); + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/ResultWriterFactory.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/ResultWriterFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..c1f05540aa7958a55f268e6b4e5861a9e4da40aa --- /dev/null +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/ResultWriterFactory.cs @@ -0,0 +1,31 @@ +using System; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils.Ninject; + +namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.ResultWriter +{ + public class ResultWriterFactory : IResultsWriterFactory + { + private readonly IInternalResultWriterFactory _internalFactory; + + public ResultWriterFactory(IInternalResultWriterFactory internalFactory) + { + _internalFactory = internalFactory; + } + + #region Implementation of IResultsWriterFactory + + public IResultsWriter GetCIFResultsWriter(string vehicleCategory, VectoSimulationJobType jobType, bool ovc, bool exempted) + { + try { + return _internalFactory.GetCIFResultsWriter( + new VehicleTypeAndArchitectureStringHelperResults.ResultsVehicleClassification(vehicleCategory, + jobType, ovc, exempted)); + } catch (Exception e) { + throw new Exception($"Could not create ResultsWriter for vehicle category {vehicleCategory}, {jobType}, ovc: {ovc}, exempted: {exempted}", e); + } + } + + #endregion + } +} \ No newline at end of file