This commit is contained in:
meelstorm
2025-10-15 13:13:47 +02:00
parent 97ac18eac6
commit dec036dbcf
16 changed files with 534 additions and 678 deletions

View File

@@ -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);
}