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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user