leerform recipe subsystem created
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using Inspectron.Settings;
|
||||
using LindtLeerformPlugin.Models;
|
||||
using Ninject;
|
||||
using VisionBuilder.UI.Common;
|
||||
using VisionBuilder.UI.Common.Plugins;
|
||||
using VisionBuilder.UI.Common.Processing;
|
||||
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
|
||||
|
||||
namespace LindtLeerformPlugin;
|
||||
|
||||
@@ -10,12 +10,25 @@ public class Plugin : IPlugin
|
||||
{
|
||||
public void RegisterGlobalModules(IKernel kernel)
|
||||
{
|
||||
TypeConverterRegistry.Register<CalibrationData>(new CalibrationDataConverter());
|
||||
kernel.Rebind<IRecipeCreationTool>().To<LeerformRecipeCreationTool>().InSingletonScope();
|
||||
}
|
||||
|
||||
public void RegisterCameraModules(IKernel kernel, string cameraName)
|
||||
{
|
||||
kernel.Bind<LeerformSettings, ISettings>().ToConstant(new LeerformSettings(cameraName));
|
||||
|
||||
// Remove existing recognition settings ISettings binding before rebinding
|
||||
var existingRecognitionControlSettings = kernel.GetBindings(typeof(BaseRecognitionControlSettings)).First();
|
||||
var toRemove = kernel.GetBindings(typeof(ISettings))
|
||||
.First(x => x.ProviderCallback.Target == existingRecognitionControlSettings.ProviderCallback.Target);
|
||||
kernel.RemoveBinding(toRemove);
|
||||
|
||||
kernel.Bind<LeerformRecognitionControlSettings, BaseRecognitionControlSettings, ISettings>()
|
||||
.ToConstant(new LeerformRecognitionControlSettings(cameraName));
|
||||
kernel.Rebind<IRecognitionControl>()
|
||||
.To<LeerformRecognitionControl>()
|
||||
.InSingletonScope();
|
||||
|
||||
kernel.RegisterModule<LeerformModule>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user