ringbuffer and statistics

This commit is contained in:
meelstorm
2025-07-18 10:13:46 +02:00
parent d3cb790bd9
commit 40d74d6da6
41 changed files with 1188 additions and 180 deletions

View File

@@ -1,5 +1,6 @@
using Inspectron.Settings;
using Inspectron.Settings.Attributes;
using Lindt.Colorballs.Duo.Utils;
using VisionBuilder.UI.Common;
namespace VisionBuilder.UI.Statistics;
@@ -16,31 +17,10 @@ public class VisionBuilderStatisticsSettings: ISettings
[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
"
"+PathSettingsUtils.INSTUCTIONS
)]
public string PathTemplate { get; set; }= @$"..\Data\Statistics\$SS_MONTH $SS_YEAR\$RECIPE_NAME\";
[SettingPreview(typeof(VisionBuilderStatisticsSettings), nameof(PathTemplatePreview))]
public string PathTemplate { get; set; }= @$"..\Data\Statistics\$SS_MONTH_NUM $SS_YEAR\$RECIPE_NAME\";
public string StartDateColumnName { get; set; } = "Start Date";
public string StartTimeColumnName { get; set; } = "Start time";
@@ -61,4 +41,10 @@ $SS_YEAR - year of the session start
settings.RegisterSimple(this,()=>this.ProductColumnName,CameraName+"/"+"Statistics",nameof(ProductColumnName));
settings.RegisterSimple(this,()=>this.ErrorColumnName,CameraName+"/"+"Statistics",nameof(ErrorColumnName));
}
public static string PathTemplatePreview(object template)
{
return PathSettingsUtils.ConvertVariables((string)template, DateTime.Now, DateTime.Now, "my recipe",
"my defect", "my camera");
}
}