before candybox editor update
This commit is contained in:
30
Plugins/CandyboxPlugin/Modules/CandyboxLearningTool.cs
Normal file
30
Plugins/CandyboxPlugin/Modules/CandyboxLearningTool.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using CandyboxPlugin.Recipe;
|
||||
using Inspectron.HawkEye.View;
|
||||
using Lindt.Candybox.Demo;
|
||||
using OpenCvSharp;
|
||||
using VisionBuilder.UI.Common.Processing;
|
||||
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
|
||||
using VisionBuilder.UI.Windows.Settings;
|
||||
|
||||
namespace CandyboxPlugin.Module;
|
||||
|
||||
public class CandyboxLearningTool: ILearningTool
|
||||
{
|
||||
|
||||
private ImagePreview _activeWindow;
|
||||
public CandyboxLearningTool(IImagePreviewService imagePreviewService)
|
||||
{
|
||||
_activeWindow = (imagePreviewService as WindowsImagePreviewService)!.CurrentWindow!;
|
||||
}
|
||||
|
||||
public bool IsLearningEnabled(string recipeName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Learn(string recipeName, Mat image)
|
||||
{
|
||||
var editor = new MapEditor(image, new HistoRecipe(recipeName));
|
||||
editor.ShowDialog(_activeWindow);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user