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 864bed71 authored by Harald Martini's avatar Harald Martini
Browse files

added MockupEngineeringSimulatorFactory

parent 65b40647
Branches
Tags
No related merge requests found
...@@ -18,6 +18,7 @@ namespace TUGraz.VectoMockup.Ninject ...@@ -18,6 +18,7 @@ namespace TUGraz.VectoMockup.Ninject
public override void Load() public override void Load()
{ {
Kernel.Rebind<ISimulatorFactory>().To<MockupDeclarationSimulatorFactory>().Named(ExecutionMode.Declaration.ToString()); Kernel.Rebind<ISimulatorFactory>().To<MockupDeclarationSimulatorFactory>().Named(ExecutionMode.Declaration.ToString());
Kernel.Rebind<ISimulatorFactory>().To<MockupEngineeringSimulatorFactory>().Named(ExecutionMode.Engineering.ToString());
//Bind<ISimulatorFactory>().To<SimulatorFactoryEngineering>().Named(ExecutionMode.Engineering.ToString()); //Bind<ISimulatorFactory>().To<SimulatorFactoryEngineering>().Named(ExecutionMode.Engineering.ToString());
} }
......
...@@ -3,9 +3,11 @@ using System.Collections.Generic; ...@@ -3,9 +3,11 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.InputData; using TUGraz.VectoCore.InputData;
using TUGraz.VectoCore.InputData.FileIO.JSON;
using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML;
using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation;
using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Data;
...@@ -17,20 +19,45 @@ using TUGraz.VectoMockup.Reports; ...@@ -17,20 +19,45 @@ using TUGraz.VectoMockup.Reports;
namespace TUGraz.VectoMockup.Simulation.SimulatorFactory namespace TUGraz.VectoMockup.Simulation.SimulatorFactory
{ {
internal class MockupEngineeringSimulatorFactory : SimulatorFactoryEngineering
{
public MockupEngineeringSimulatorFactory(IInputDataProvider dataProvider, IOutputDataWriter writer,
bool validate) : base(dataProvider, writer, validate)
{
throw new VectoException("Engineering mode is not supported in Mockup Vecto");
}
}
internal class MockupDeclarationSimulatorFactory : SimulatorFactoryDeclaration internal class MockupDeclarationSimulatorFactory : SimulatorFactoryDeclaration
{ {
private void CheckInputData(IInputDataProvider dataProvider)
{
if (dataProvider is JSONFile json && !(dataProvider is JSONInputDataV10_PrimaryAndStageInputBus)) {
throw new VectoException($"JSON input data is not supported in Mockup Vecto");
}
}
public MockupDeclarationSimulatorFactory(IInputDataProvider dataProvider, IOutputDataWriter writer, public MockupDeclarationSimulatorFactory(IInputDataProvider dataProvider, IOutputDataWriter writer,
IDeclarationReport declarationReport, IVTPReport vtpReport, bool validate, IDeclarationReport declarationReport, IVTPReport vtpReport, bool validate,
IXMLInputDataReader xmlInputDataReader, ISimulatorFactoryFactory simulatorFactoryFactory, IXMLInputDataReader xmlInputDataReader, ISimulatorFactoryFactory simulatorFactoryFactory,
IXMLDeclarationReportFactory xmlDeclarationReportFactory, IVectoRunDataFactoryFactory runDataFactoryFactory) IXMLDeclarationReportFactory xmlDeclarationReportFactory, IVectoRunDataFactoryFactory runDataFactoryFactory)
: base(dataProvider, writer, declarationReport, vtpReport, validate, xmlInputDataReader, : base(dataProvider, writer, declarationReport, vtpReport, validate, xmlInputDataReader,
simulatorFactoryFactory, xmlDeclarationReportFactory, runDataFactoryFactory) { } simulatorFactoryFactory, xmlDeclarationReportFactory, runDataFactoryFactory)
{
CheckInputData(dataProvider);
}
public MockupDeclarationSimulatorFactory(IInputDataProvider dataProvider, public MockupDeclarationSimulatorFactory(IInputDataProvider dataProvider,
IOutputDataWriter writer, bool validate, IOutputDataWriter writer, bool validate,
IXMLInputDataReader xmlInputDataReader, IXMLInputDataReader xmlInputDataReader,
ISimulatorFactoryFactory simulatorFactoryFactory, ISimulatorFactoryFactory simulatorFactoryFactory,
IXMLDeclarationReportFactory xmlDeclarationReportFactory, IXMLDeclarationReportFactory xmlDeclarationReportFactory,
IVectoRunDataFactoryFactory runDataFactoryFactory) : base(dataProvider, writer, validate, xmlInputDataReader, simulatorFactoryFactory, xmlDeclarationReportFactory, runDataFactoryFactory) { } IVectoRunDataFactoryFactory runDataFactoryFactory) : base(dataProvider, writer, validate,
xmlInputDataReader, simulatorFactoryFactory, xmlDeclarationReportFactory, runDataFactoryFactory)
{
CheckInputData(dataProvider);
}
#region Overrides of SimulatorFactory #region Overrides of SimulatorFactory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment