Code development platform for open source projects from the European Union institutions

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

Updated Constructor of SimulatorFactoryCreators, added XMLReport Factory to...

Updated Constructor of SimulatorFactoryCreators, added XMLReport Factory to SimulatorFactoryDeclaration
parent 9e4ba0eb
No related branches found
No related tags found
No related merge requests found
......@@ -106,9 +106,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
if (followUpSimulatorFactoryFetched || !AllCompleted()) {
return null;
}
followUpSimulatorFactoryFetched = true;
return _simulatorFactory.FollowUpSimulatorFactory;
} finally {
}finally {
}
}
......
......@@ -44,7 +44,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
public abstract ISimulatorFactory GetNextFactory();
public abstract IOutputDataWriter CurrentStageOutputDataWriter { get; }
public abstract IDeclarationReport CurrentStageDeclarationReport { get; }
public abstract IInputDataProvider CurrentStageInputData { get; }
#endregion
......@@ -58,9 +57,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
private readonly IDeclarationReport _currentStageDeclarationReport = null;
private readonly IXMLInputDataReader _inputDataReader;
private readonly IMultistagePrimaryAndStageInputDataProvider _originalStageInputData;
private readonly IDeclarationReport _originalDeclarationReport;
public InterimAfterPrimaryFactoryCreator(IMultistagePrimaryAndStageInputDataProvider originalStageInputData,
IOutputDataWriter originalReportWriter,
IDeclarationReport originalDeclarationReport,
ISimulatorFactoryFactory simFactoryFactory,
IXMLInputDataReader inputDataReader, bool validate) : base(simFactoryFactory, validate)
{
......@@ -68,6 +69,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
_originalStageInputData = originalStageInputData;
_inputDataReader = inputDataReader;
_originalOriginalReportWriter = originalReportWriter;
_originalDeclarationReport = originalDeclarationReport;
_currentStageOutputDataWriter =
new TempFileOutputWriter(originalReportWriter, ReportType.DeclarationReportManufacturerXML)
;
......@@ -93,8 +95,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
nextStageInput.MultistageJobInputData.JobInputData.ManufacturingStages?.Count ?? -1;
_originalOriginalReportWriter.NumberOfManufacturingStages = manStagesCount;
return _simulatorFactoryFactory.Factory(ExecutionMode.Declaration, nextStageInput, _originalOriginalReportWriter, null,
return _simulatorFactoryFactory.Factory(ExecutionMode.Declaration, nextStageInput, _originalOriginalReportWriter, _originalDeclarationReport,
null, _validate);
}
......@@ -104,7 +105,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
#region Overrides of FollowUpSimulatorFactoryCreator
public override IInputDataProvider CurrentStageInputData => _originalStageInputData.PrimaryVehicle;
public override IOutputDataWriter CurrentStageOutputDataWriter => _currentStageOutputDataWriter;
public override IDeclarationReport CurrentStageDeclarationReport => _currentStageDeclarationReport;
......
......@@ -28,6 +28,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
private readonly ISimulatorFactoryFactory _simFactoryFactory;
private IInputDataProvider _currentStageInputData;
private IDeclarationReport _currentStageDeclarationReport;
private IVTPReport _currentStageVTPReport;
private readonly IXMLDeclarationReportFactory _xmlDeclarationReportFactory;
public SimulatorFactoryDeclaration(IInputDataProvider dataProvider,
IOutputDataWriter writer,
......@@ -35,13 +38,17 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
IVTPReport vtpReport,
bool validate,
IXMLInputDataReader xmlInputDataReader,
ISimulatorFactoryFactory simulatorFactoryFactory
ISimulatorFactoryFactory simulatorFactoryFactory,
IXMLDeclarationReportFactory xmlDeclarationReportFactory
) : base(ExecutionMode.Declaration, writer, validate)
{
_xmlInputDataReader = xmlInputDataReader;
_simFactoryFactory = simulatorFactoryFactory;
_currentStageInputData = dataProvider;
_currentStageDeclarationReport = declarationReport;
_currentStageDeclarationReport = declarationReport ?? xmlDeclarationReportFactory.CreateReport(dataProvider, writer);
_currentStageVTPReport = vtpReport ?? xmlDeclarationReportFactory.CreateVTPReport(dataProvider, writer);
_xmlDeclarationReportFactory = xmlDeclarationReportFactory;
_followUpSimulatorFactoryCreator = CreateFollowUpFactoryCreator();
UpdateCurrentStageInput();
_simulate = CanBeSimulated(dataProvider);
......@@ -50,6 +57,14 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
}
}
private void CreateReport()
{
if (_currentStageDeclarationReport != null && _currentStageInputData != null) {
}
}
/// <summary>
/// Modifies the input and output of the current simulation step based on the Following step
/// </summary>
......@@ -67,15 +82,17 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
[UsedImplicitly]
public SimulatorFactoryDeclaration(IInputDataProvider dataProvider,
IOutputDataWriter writer, IXMLInputDataReader xmlInputDataReader,
ISimulatorFactoryFactory simulatorFactoryFactory, bool validate) : this(
IOutputDataWriter writer,
bool validate, IXMLInputDataReader xmlInputDataReader,
ISimulatorFactoryFactory simulatorFactoryFactory, IXMLDeclarationReportFactory xmlDeclarationReportFactory) : this(
dataProvider: dataProvider,
declarationReport: null,
writer: writer,
vtpReport: null,
validate: true,
xmlInputDataReader: xmlInputDataReader,
simulatorFactoryFactory: simulatorFactoryFactory)
simulatorFactoryFactory: simulatorFactoryFactory,
xmlDeclarationReportFactory: xmlDeclarationReportFactory)
{
}
......@@ -104,8 +121,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
switch (_currentStageInputData) {
case IMultistagePrimaryAndStageInputDataProvider multistagePrimaryAndStageInputDataProvider:
return new InterimAfterPrimaryFactoryCreator(
multistagePrimaryAndStageInputDataProvider,
multistagePrimaryAndStageInputDataProvider,
ReportWriter,
_currentStageDeclarationReport,
_simFactoryFactory, _xmlInputDataReader, Validate);
case IMultistageVIFInputData multistageVifInputData:
if (multistageVifInputData.VehicleInputData != null) {
......
......@@ -44,7 +44,7 @@ using TUGraz.VectoHashing;
namespace TUGraz.VectoCore.Models.Simulation
{
public class SimulationFactoryNinjectModule : NinjectModule
public class SimulationFactoryNinjectModule : VectoNinjectModule
{
#region Overrides of NinjectModule
......@@ -59,9 +59,6 @@ namespace TUGraz.VectoCore.Models.Simulation
Bind<IDeclarationReport>().To<NullDeclarationReport>();
Bind<IVTPReport>().To<NullVTPReport>();
//if (Kernel != null && !Kernel.HasModule(typeof(PowertrainBuilderInjectModule).FullName)) {
// Kernel.Load(new[] { new PowertrainBuilderInjectModule() });
//}
}
#endregion
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment