2.0.10
This commit is contained in:
@@ -18,14 +18,16 @@ namespace Lindt.Candybox.Demo
|
||||
public partial class MapEditor : MaterialForm
|
||||
{
|
||||
private readonly Mat _original;
|
||||
private readonly HistoRecipe _runningRecipe;
|
||||
private HistoRecipe _recipe;
|
||||
|
||||
public MapEditor(Mat original, HistoRecipe currentRecipe)
|
||||
public MapEditor(Mat original, HistoRecipe runningRecipe)
|
||||
{
|
||||
_original = original;
|
||||
_runningRecipe = runningRecipe;
|
||||
InitializeComponent();
|
||||
|
||||
_recipe = currentRecipe.Clone();
|
||||
_recipe = runningRecipe.Clone();
|
||||
|
||||
_recipe.ProcessImage(original);
|
||||
|
||||
@@ -124,7 +126,7 @@ namespace Lindt.Candybox.Demo
|
||||
|
||||
_recipe.LearnedParameters.Configuration.MemoryBuffer = (int)udMemoryBuffer.Value;
|
||||
_recipe.LearnContours(contours.ToArray(), _original, maskControl1.VectorLines.Select(x => x.Scale(512f / 1800f, 512f / 1408f).Sub(_recipe.BlisterCenter)).ToList(),relearn:true);
|
||||
|
||||
_runningRecipe.Reload();
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
private void materialRaisedButton1_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -47,10 +47,13 @@ namespace CandyboxPlugin.Recipe
|
||||
|
||||
public void Reload()
|
||||
{
|
||||
if (File.Exists(_configurationPath))
|
||||
lock (_lockObject)
|
||||
{
|
||||
_learnedParameters =
|
||||
JsonSerializer.Deserialize<LearningParameters>(File.ReadAllText(_configurationPath));
|
||||
if (File.Exists(_configurationPath))
|
||||
{
|
||||
_learnedParameters =
|
||||
JsonSerializer.Deserialize<LearningParameters>(File.ReadAllText(_configurationPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace VisionBuilder.UI.Statistics
|
||||
private string _fileName;
|
||||
private string _directoryPath;
|
||||
private int _total = 0;
|
||||
private int _errors = 0;
|
||||
|
||||
private const string BY_EVENTS_FILE_NAME = "statistics_by_events.csv";
|
||||
private const string MONTHLY_FILE_NAME = "statistics_month.csv";
|
||||
@@ -79,6 +80,7 @@ namespace VisionBuilder.UI.Statistics
|
||||
_total++;
|
||||
if (obj.HasError)
|
||||
{
|
||||
_errors++;
|
||||
RecordBadImage(obj.ErrorNames.ToArray());
|
||||
}
|
||||
sw.Stop();
|
||||
@@ -89,6 +91,7 @@ namespace VisionBuilder.UI.Statistics
|
||||
{
|
||||
_startTime = obj.SessionStarted;
|
||||
_total = 0;
|
||||
_errors= 0;
|
||||
_currentRecipe = obj.RecipeName;
|
||||
_fileName = BY_EVENTS_FILE_NAME;
|
||||
_directoryPath = PathSettingsUtils.ConvertVariables(_settings.PathTemplate, _startTime, _startTime,
|
||||
@@ -155,21 +158,17 @@ namespace VisionBuilder.UI.Statistics
|
||||
);
|
||||
}
|
||||
|
||||
var totalDefects = 0;
|
||||
foreach (var defect in _defects)
|
||||
{
|
||||
totalDefects += defect.Value;
|
||||
}
|
||||
|
||||
|
||||
monthStatistics.WriteLine([]);
|
||||
monthStatistics.WriteLine(
|
||||
["Total errors", totalDefects.ToString()]
|
||||
["Total error images", _errors.ToString()]
|
||||
);
|
||||
monthStatistics.WriteLine(
|
||||
["Total produced(including errors)", _total.ToString()]
|
||||
);
|
||||
|
||||
var percentage = _total > 0 ? (double)totalDefects / _total * 100 : 0;
|
||||
var percentage = _total > 0 ? (double)_errors / _total * 100 : 0;
|
||||
|
||||
monthStatistics.WriteLine(
|
||||
["Error rate", percentage.ToString("F2") + "%"]
|
||||
|
||||
@@ -20,19 +20,20 @@ internal static class Program
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
// In your application startup code
|
||||
MaterialSkin.MaterialSkinManager.ConfigureForInspectron();
|
||||
CommandLineParser commandLineParser = new CommandLineParser(args);
|
||||
|
||||
InspectronSettings settings = new InspectronSettings("..\\Data\\Config");
|
||||
|
||||
var mainKernel = VisionBuilder.UI.Common.VisionBuilder.CreateMainKernel(settings);
|
||||
|
||||
mainKernel.UsePlugins();
|
||||
var profile = commandLineParser.GetStringArgument("profile", 'p');
|
||||
mainKernel.UsePlugins(profile);
|
||||
|
||||
|
||||
mainKernel
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationIcon>Inspectron icon-512.ico</ApplicationIcon>
|
||||
<Deterministic>false</Deterministic>
|
||||
<Version>2.0.9</Version>
|
||||
<Version>2.0.10</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ApplicationIcon>Inspectron icon-512.ico</ApplicationIcon>
|
||||
<Deterministic>false</Deterministic>
|
||||
<Version>2.0.9</Version>
|
||||
<Version>2.0.10</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
@@ -127,12 +127,13 @@ namespace Inspectron.HawkEye.View
|
||||
//
|
||||
lblErrName.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
lblErrName.BackColor = Color.White;
|
||||
lblErrName.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
lblErrName.Location = new Point(16, 32);
|
||||
lblErrName.Name = "lblErrName";
|
||||
lblErrName.Size = new Size(1536, 16);
|
||||
lblErrName.Size = new Size(1536, 24);
|
||||
lblErrName.TabIndex = 6;
|
||||
lblErrName.Text = "label1";
|
||||
lblErrName.TextAlign = ContentAlignment.MiddleCenter;
|
||||
lblErrName.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// ImagePreview
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user