2.0.9
This commit is contained in:
@@ -10,11 +10,13 @@ namespace CandyboxPlugin.Module;
|
||||
|
||||
public class CandyboxImageProcessingControl : BaseRecognitionControl
|
||||
{
|
||||
private readonly CandyboxRecognitionControlSettings _settings;
|
||||
private readonly IImageSource _imageSource;
|
||||
private HistoRecipe _histoRecipe;
|
||||
|
||||
public CandyboxImageProcessingControl(CandyboxRecognitionControlSettings settings, IImageSource imageSource, ILoadingService loadingService) : base(settings, loadingService)
|
||||
{
|
||||
_settings = settings;
|
||||
_imageSource = imageSource;
|
||||
}
|
||||
|
||||
@@ -24,7 +26,7 @@ public class CandyboxImageProcessingControl : BaseRecognitionControl
|
||||
public override List<RecipeData> GetRecipesData()
|
||||
{
|
||||
var recipes = new List<RecipeData>();
|
||||
var recipeFiles = Directory.GetFiles(RECIPES_DIR, "*.json");
|
||||
var recipeFiles = Directory.GetFiles(RECIPES_DIR, _settings.RecipeNameFilter+".json");
|
||||
foreach (var file in recipeFiles)
|
||||
{
|
||||
var name = Path.GetFileNameWithoutExtension(file);
|
||||
@@ -99,6 +101,11 @@ public class CandyboxImageProcessingControl : BaseRecognitionControl
|
||||
res.ErrorReason.Where(x=>x != EErrorReason.Good).Select(x=>x.ToString())
|
||||
).ToArray();
|
||||
|
||||
if (_settings.AlwaysError)
|
||||
{
|
||||
allErrors = allErrors.Concat(new[] { "Always Error" }).ToArray();
|
||||
}
|
||||
|
||||
return (image, res.ProcessedImage, swTotal.Elapsed, swAcquision.Elapsed, allErrors);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
using VisionBuilder.UI.Common.Processing;
|
||||
using Inspectron.Settings;
|
||||
using Inspectron.Settings.Attributes;
|
||||
using VisionBuilder.UI.Common.Processing;
|
||||
|
||||
namespace CandyboxPlugin.Module;
|
||||
|
||||
public class CandyboxRecognitionControlSettings : BaseRecognitionControlSettings
|
||||
{
|
||||
|
||||
[SettingDescription("Usefull to learn on good images")]
|
||||
public bool AlwaysError { get; set; }
|
||||
|
||||
public CandyboxRecognitionControlSettings(string cameraName) : base(cameraName)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RegisterSettings(InspectronSettings settings)
|
||||
{
|
||||
base.RegisterSettings(settings);
|
||||
settings.RegisterSimple(this, () => AlwaysError, CameraName + "/" + "Recognition", nameof(AlwaysError));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user