using Inspectron.Settings; using Inspectron.Settings.Attributes; using VisionBuilder.UI.Common; namespace VisionBuilder.UI.Statistics; public class VisionBuilderStatisticsSettings: ISettings { public string CameraName { get; } public VisionBuilderStatisticsSettings(string cameraName) { CameraName = cameraName; } [SettingDescription( @" Specifies directory, in which MaxBad and MaxGood are applied. You can use the following system variables: $RECIPE_NAME - name of the current recipe $DEFECT_NAME - name of the current defect(for bad images) $CAMERA_NAME - name of the camera $HOUR - hour of the image $MINUTE - minute of the image $SECOND - second of the image $MS - milliseconds of the image $DAY - day of the image $MONTH - month of the image $YEAR - year of the image $SS_HOUR - hour of the session start $SS_MINUTE - minute of the session start $SS_SECOND - second of the session start $SS_DAY - day of the session start $SS_MONTH - month of the session start $SS_YEAR - year of the session start " )] public string PathTemplate { get; set; }= @$"..\Data\Statistics\$SS_MONTH $SS_YEAR\$RECIPE_NAME\"; public string StartDateColumnName { get; set; } = "Start Date"; public string StartTimeColumnName { get; set; } = "Start time"; public string EndDateColumnName { get; set; } = "End Date"; public string EndTimeColumnName { get; set; } = "End time"; public string ErrorTimeColumnName { get; set; } = "Error time"; public string ProductColumnName { get; set; } = "Product"; public string ErrorColumnName { get; set; } = "Error"; public void RegisterSettings(InspectronSettings settings) { settings.RegisterSimple(this,()=>this.PathTemplate,CameraName+"/"+"Statistics",nameof(PathTemplate)); settings.RegisterSimple(this,()=>this.StartDateColumnName,CameraName+"/"+"Statistics",nameof(StartDateColumnName)); settings.RegisterSimple(this,()=>this.StartTimeColumnName,CameraName+"/"+"Statistics",nameof(StartTimeColumnName)); settings.RegisterSimple(this,()=>this.EndDateColumnName,CameraName+"/"+"Statistics",nameof(EndDateColumnName)); settings.RegisterSimple(this,()=>this.EndTimeColumnName,CameraName+"/"+"Statistics",nameof(EndTimeColumnName)); settings.RegisterSimple(this,()=>this.ErrorTimeColumnName,CameraName+"/"+"Statistics",nameof(ErrorTimeColumnName)); settings.RegisterSimple(this,()=>this.ProductColumnName,CameraName+"/"+"Statistics",nameof(ProductColumnName)); settings.RegisterSimple(this,()=>this.ErrorColumnName,CameraName+"/"+"Statistics",nameof(ErrorColumnName)); } }