Files
HawkeyeVision/Plugins/CandyboxPlugin/Plugin.cs
2025-09-16 10:42:43 +02:00

37 lines
1.3 KiB
C#

using CandyboxPlugin.Module;
using Inspectron.Settings;
using Ninject;
using System.Reflection;
using CandyboxPlugin.Modules.Barcode;
using VisionBuilder.UI.Common;
using VisionBuilder.UI.Common.Plugins;
using VisionBuilder.UI.Common.Processing;
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
namespace CandyboxPlugin
{
public class Plugin: IPlugin
{
public void RegisterGlobalModules(IKernel kernel)
{
TypeConverterRegistry.Register<List<BarcodeRecipeMapping>>(new ListBarcodeRecipeMappingConverter());
kernel.Rebind<IRecipeCreationTool>().To<CandyboxRecipeCreationTool>().InSingletonScope();
}
public void RegisterCameraModules(IKernel kernel, string cameraName)
{
kernel.Bind<CandyboxRecognitionControlSettings, ISettings>().ToConstant(new CandyboxRecognitionControlSettings(cameraName));
kernel.Rebind<IRecognitionControl>().To<CandyboxImageProcessingControl>().InSingletonScope();
kernel.Rebind<ILearningTool>().To<CandyboxLearningTool>().InSingletonScope();
kernel.Bind<CandyboxBarcodeReaderSettings, ISettings>()
.ToConstant(new CandyboxBarcodeReaderSettings(cameraName));
kernel.RegisterModule<CandyboxBarcodeReader>();
}
}
}