Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit a28a3a4c authored by Harald Martini's avatar Harald Martini
Browse files

added interface IMockupReport

parent ad5159a8
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ using TUGraz.VectoCore.Models.Declaration; ...@@ -13,6 +13,7 @@ using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.XML;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9; using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9;
namespace TUGraz.VectoCore.InputData.Reader.Impl.MockupRunDataFactories namespace TUGraz.VectoCore.InputData.Reader.Impl.MockupRunDataFactories
...@@ -22,7 +23,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.MockupRunDataFactories ...@@ -22,7 +23,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.MockupRunDataFactories
public DeclarationModeMockupTruckVectoRunDataFactory(IDeclarationInputDataProvider dataProvider, public DeclarationModeMockupTruckVectoRunDataFactory(IDeclarationInputDataProvider dataProvider,
IDeclarationReport report) : base(dataProvider, report, false) IDeclarationReport report) : base(dataProvider, report, false)
{ {
if (report is IMockupReport mockupReport) {
mockupReport.Mockup = true;
}
} }
#region Overrides of AbstractDeclarationVectoRunDataFactory #region Overrides of AbstractDeclarationVectoRunDataFactory
......
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile; using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile;
...@@ -12,7 +14,11 @@ using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.Manu ...@@ -12,7 +14,11 @@ using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.Manu
namespace TUGraz.VectoCore.OutputData.XML namespace TUGraz.VectoCore.OutputData.XML
{ {
public class XMLDeclarationReport09 : XMLDeclarationReport public interface IMockupReport
{
bool Mockup { set; }
}
public class XMLDeclarationReport09 : XMLDeclarationReport, IMockupReport
{ {
private readonly IReportWriter _writer; private readonly IReportWriter _writer;
private readonly IManufacturerReportFactory _mrfFactory; private readonly IManufacturerReportFactory _mrfFactory;
...@@ -50,9 +56,43 @@ namespace TUGraz.VectoCore.OutputData.XML ...@@ -50,9 +56,43 @@ namespace TUGraz.VectoCore.OutputData.XML
} }
#region Overrides of XMLDeclarationReport
protected override void DoStoreResult(ResultEntry entry, VectoRunData runData, IModalDataContainer modData)
{
if (!Mockup) {
base.DoStoreResult(entry, runData, modData);
return;
}
}
protected override void WriteResult(ResultEntry result)
{
var sumWeightinFactors = _weightingFactors.Values.Sum(x => x);
if (!sumWeightinFactors.IsEqual(0) && !sumWeightinFactors.IsEqual(1))
{
throw new VectoException("Mission Profile Weighting factors do not sum up to 1!");
}
if (Mockup) {
(ManufacturerRpt as IXMLMockupReport).WriteMockupResult(result);
} else {
ManufacturerRpt.WriteResult(result);
CustomerRpt.WriteResult(result);
}
}
#endregion
#endregion
#region Implementation of IMockupReport
public bool Mockup { private get; set; }
#endregion #endregion
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment