using Inspectron.Settings;

namespace VisionBuilder.UI.Common.Processing;

public abstract class BaseRecognitionControlSettings(string cameraName) : ISettings
{
    public string CameraName { get; } = cameraName;

    public int MinimumProcessingTime { get; set; }
    public string RecipeNameFilter { get; set; } = "*";
    public int ErrorsInSequenceAlarm { get; set; } = 5;

    public virtual void RegisterSettings(InspectronSettings settings)
    {
        settings.RegisterSimple(this, () => this.MinimumProcessingTime, CameraName + "/Recognition", "Minimum processing time (ms)");
        settings.RegisterSimple(this, () => this.RecipeNameFilter, CameraName + "/Recognition", nameof(RecipeNameFilter));
        settings.RegisterSimple(this, () => this.ErrorsInSequenceAlarm, CameraName + "/Recognition", nameof(ErrorsInSequenceAlarm));
    }
}