before candybox editor update
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using Ninject;
|
||||
using Ninject.Extensions.ChildKernel;
|
||||
using OpenCvSharp;
|
||||
using VisionBuilder.UI.Common;
|
||||
using VisionBuilder.UI.Common.Plugins;
|
||||
using VisionBuilder.UI.Common.Processing;
|
||||
using VisionBuilder.UI.Common.ViewModel.Classes;
|
||||
|
||||
namespace TestPlugin
|
||||
{
|
||||
@@ -31,6 +34,58 @@ namespace TestPlugin
|
||||
public void RegisterCameraModules(IKernel kernel, string cameraName)
|
||||
{
|
||||
kernel.RegisterModule<TestCameraPlugin>();
|
||||
|
||||
kernel.Bind<TestRecognitionControlSettings, ISettings>().ToConstant(new TestRecognitionControlSettings(cameraName));
|
||||
kernel.Rebind<IRecognitionControl>().To<TestImageProcessingControl>().InSingletonScope();
|
||||
}
|
||||
}
|
||||
|
||||
public class TestRecognitionControlSettings : BaseRecognitionControlSettings
|
||||
{
|
||||
public TestRecognitionControlSettings(string cameraName) : base(cameraName)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class TestImageProcessingControl : BaseRecognitionControl
|
||||
{
|
||||
public TestImageProcessingControl(TestRecognitionControlSettings settings, ILoadingService loadingService) : base(settings, loadingService)
|
||||
{
|
||||
}
|
||||
|
||||
public override List<RecipeData> GetRecipesData()
|
||||
{
|
||||
return new List<RecipeData>()
|
||||
{
|
||||
new RecipeData()
|
||||
{
|
||||
Image = new Mat(100, 100, MatType.CV_8UC3, new Scalar(0, 0, 255)),
|
||||
RecipeName = "Hello"
|
||||
},
|
||||
new RecipeData()
|
||||
{
|
||||
Image = new Mat(100, 100, MatType.CV_8UC3, new Scalar(0, 0, 255)),
|
||||
RecipeName = "World"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Initialize(RecipeData currentRecipe)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void WarmUp()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override (Mat originalImage, Mat analysisImage, TimeSpan processingTime, TimeSpan acquisitionTime, string[] errorNames)?
|
||||
ProcessImage(CancellationToken token)
|
||||
{
|
||||
var img = new Mat(100, 100, MatType.CV_8UC3, new Scalar(0, 0, 255));
|
||||
return (img, img, TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(5), new string[] { "TestError" });
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user