public void FrameworkPlugins_SingleContextGet() { // engine data objects (not plugin-able business logic) Model model = CreateModel(); var measurement = new Measurement(); // plugin definition (unique and parameters) const string commandUnique = "pluginB_single_get"; const string commandParameters = "parameter1=P1; parameter2=P2; material1=M1; material2=M2; threshold=0.4"; var containerFramework = new ContainerFramework(); var dataFramework = new DataFramework(containerFramework); dataFramework.Add<IModelDataEntity>(new ModelDataEntity(model)); dataFramework.Add<IMeasurementDataEntity>(new MeasurementDataEntity(measurement)); var commandFramework = new CommandFramework(containerFramework, dataFramework); commandFramework.AddPluginsFolder(new DataFolder(@"..\..\..\@PluginsBinaries")); commandFramework.AddPluginsBinary(new DataFile(@".\EngineAPI.dll")); commandFramework.Init(); // var service1 = commandFramework.FindPlugin("model_get_measurement_properties").Value as IMeasurementPropertiesService; //TODO should be implemented automatically // commandFramework.RegisterService<IMeasurementPropertiesService>(service1); // var service2 = commandFramework.FindPlugin("get_material_properties").Value as IMaterialPropertiesService; //TODO should be implemented automatically // commandFramework.RegisterService<IMaterialPropertiesService>(service2); IDataEntity commandResult = commandFramework.RunCommand(commandUnique, commandParameters); Assert.IsInstanceOf<ModelParametersDataEntity>(commandResult); }
public void FrameworkPlugins_SingleContextGet() { // engine data objects (not plugin-able business logic) Model model = CreateModel(); var measurement = new Measurement(); // plugin definition (unique and parameters) const string commandUnique = "pluginB_single_get"; const string commandParameters = "parameter1=P1; parameter2=P2; material1=M1; material2=M2; threshold=0.4"; var containerFramework = new ContainerFramework(); var dataFramework = new DataFramework(containerFramework); dataFramework.Add <IModelDataEntity>(new ModelDataEntity(model)); dataFramework.Add <IMeasurementDataEntity>(new MeasurementDataEntity(measurement)); var commandFramework = new CommandFramework(containerFramework, dataFramework); commandFramework.AddPluginsFolder(new DataFolder(@"..\..\..\@PluginsBinaries")); commandFramework.AddPluginsBinary(new DataFile(@".\EngineAPI.dll")); commandFramework.Init(); // var service1 = commandFramework.FindPlugin("model_get_measurement_properties").Value as IMeasurementPropertiesService; //TODO should be implemented automatically // commandFramework.RegisterService<IMeasurementPropertiesService>(service1); // var service2 = commandFramework.FindPlugin("get_material_properties").Value as IMaterialPropertiesService; //TODO should be implemented automatically // commandFramework.RegisterService<IMaterialPropertiesService>(service2); IDataEntity commandResult = commandFramework.RunCommand(commandUnique, commandParameters); Assert.IsInstanceOf <ModelParametersDataEntity>(commandResult); }
public void FrameworkPlugins_Intro() { // engine data objects (not plugin-able business logic) Model model = CreateModel(); var measurement = new Measurement(); // plugin definition (unique and parameters) const string commandUnique = "pluginB_stright"; const string commandParameters = "parameter1=P1; parameter2=P2; material1=M1; material2=M2; threshold=0.4"; var containerFramework = new ContainerFramework(); var dataFramework = new DataFramework(containerFramework); dataFramework.Add <IModelDataEntity>(new ModelDataEntity(model)); dataFramework.Add <IMeasurementDataEntity>(new MeasurementDataEntity(measurement)); var commandFramework = new CommandFramework(containerFramework, dataFramework); commandFramework.AddPluginsFolder(new DataFolder(@"..\..\..\@PluginsBinaries")); commandFramework.AddPluginsBinary(new DataFile(@".\EngineAPI.dll")); commandFramework.Init(); IDataEntity commandResult = commandFramework.RunCommand(commandUnique, commandParameters); Assert.IsInstanceOf <ModelParametersDataEntity>(commandResult); }
public UserDefinedCommand(Client client, string commandUnique, string commandName, string commandParameters) { this.commandFramework = client.CommandFramework; this.dataFramework = client.DataFramework; Name = commandName; Body = commandParameters; CommandUnique = commandUnique; }
public UserDefinedCommand(Client client, string commandUnique, string commandName, string commandParameters) { this.commandFramework = client.CommandFramework; this.dataFramework = client.DataFramework; Name = commandName; Body = commandParameters; CommandUnique = commandUnique; }
public void Init() { DataFramework.Add <IModelDataEntity>(new ModelDataEntity(Model)); DataFramework.Add <IMeasurementDataEntity>(new MeasurementDataEntity(Measurement)); CommandFramework.AddPluginsFolder(new DataFolder(@"..\..\..\@PluginsBinaries")); CommandFramework.AddPluginsBinary(new DataFile(@".\EngineAPI.dll")); CommandFramework.Init(); // var service1 = CommandFramework.FindPlugin("model_get_measurement_properties").Value as IMeasurementPropertiesService; //TODO should be implemented automatically // CommandFramework.RegisterService<IMeasurementPropertiesService>(service1); // var service2 = CommandFramework.FindPlugin("get_material_properties").Value as IMaterialPropertiesService; //TODO should be implemented automatically // CommandFramework.RegisterService<IMaterialPropertiesService>(service2); }
public void FrameworkPlugins_Intro() { // engine data objects (not plugin-able business logic) Model model = CreateModel(); var measurement = new Measurement(); // plugin definition (unique and parameters) const string commandUnique = "pluginB_stright"; const string commandParameters = "parameter1=P1; parameter2=P2; material1=M1; material2=M2; threshold=0.4"; var containerFramework = new ContainerFramework(); var dataFramework = new DataFramework(containerFramework); dataFramework.Add<IModelDataEntity>(new ModelDataEntity(model)); dataFramework.Add<IMeasurementDataEntity>(new MeasurementDataEntity(measurement)); var commandFramework = new CommandFramework(containerFramework, dataFramework); commandFramework.AddPluginsFolder(new DataFolder(@"..\..\..\@PluginsBinaries")); commandFramework.AddPluginsBinary(new DataFile(@".\EngineAPI.dll")); commandFramework.Init(); IDataEntity commandResult = commandFramework.RunCommand(commandUnique, commandParameters); Assert.IsInstanceOf<ModelParametersDataEntity>(commandResult); }
public Client() { DataFramework = new DataFramework(containerFramework); CommandFramework = new CommandFramework(containerFramework, DataFramework); }
public Client() { DataFramework = new DataFramework(containerFramework); CommandFramework = new CommandFramework(containerFramework, DataFramework); }