hawkeye camera support(not tested)
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Hawkeye.VisionBuilder.Features.ImageStatistics
|
||||
_goodNode.Nodes.Add(new TreeNode(nodeText) { Tag = filePath });
|
||||
_allFiles.Add(filePath);
|
||||
UpdateBranchText(_goodNode, "Good");
|
||||
treeView.ExpandAll();
|
||||
//treeView.ExpandAll();
|
||||
}
|
||||
|
||||
public void AddBadImage(string filePath, string[]? defects = null)
|
||||
@@ -66,7 +66,7 @@ namespace Hawkeye.VisionBuilder.Features.ImageStatistics
|
||||
_badNode.Nodes.Add(new TreeNode(nodeText) { Tag = filePath });
|
||||
_allFiles.Add(filePath);
|
||||
UpdateBranchText(_badNode, "Bad");
|
||||
treeView.ExpandAll();
|
||||
//treeView.ExpandAll();
|
||||
}
|
||||
|
||||
private void UpdateBranchText(TreeNode node, string name)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
btnTest = new Button();
|
||||
button1 = new Button();
|
||||
Indicator = new DataGridViewTextBoxColumn();
|
||||
Link = new DataGridViewTextBoxColumn();
|
||||
Enabled = new DataGridViewCheckBoxColumn();
|
||||
UserName = new DataGridViewTextBoxColumn();
|
||||
Result = new DataGridViewTextBoxColumn();
|
||||
TypeName = new DataGridViewTextBoxColumn();
|
||||
@@ -50,14 +50,13 @@
|
||||
dataGridView1.AllowUserToAddRows = false;
|
||||
dataGridView1.AllowUserToDeleteRows = false;
|
||||
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { Indicator, Link, UserName, Result, TypeName, Time });
|
||||
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { Indicator, Enabled, UserName, Result, TypeName, Time });
|
||||
dataGridView1.Dock = DockStyle.Fill;
|
||||
dataGridView1.Location = new Point(0, 40);
|
||||
dataGridView1.MultiSelect = false;
|
||||
dataGridView1.Name = "dataGridView1";
|
||||
dataGridView1.ReadOnly = true;
|
||||
dataGridView1.RowHeadersVisible = false;
|
||||
dataGridView1.RowTemplate.Height = 25;
|
||||
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView1.Size = new Size(540, 562);
|
||||
dataGridView1.TabIndex = 0;
|
||||
@@ -126,12 +125,12 @@
|
||||
Indicator.ReadOnly = true;
|
||||
Indicator.Width = 32;
|
||||
//
|
||||
// Link
|
||||
// Enabled
|
||||
//
|
||||
Link.HeaderText = "";
|
||||
Link.Name = "Link";
|
||||
Link.ReadOnly = true;
|
||||
Link.Width = 32;
|
||||
Enabled.HeaderText = "";
|
||||
Enabled.Name = "Enabled";
|
||||
Enabled.ReadOnly = true;
|
||||
Enabled.Width = 32;
|
||||
//
|
||||
// UserName
|
||||
//
|
||||
@@ -182,7 +181,7 @@
|
||||
private Label lblProcessingTime;
|
||||
private Label label1;
|
||||
private DataGridViewTextBoxColumn Indicator;
|
||||
private DataGridViewTextBoxColumn Link;
|
||||
private DataGridViewCheckBoxColumn Enabled;
|
||||
private DataGridViewTextBoxColumn UserName;
|
||||
private DataGridViewTextBoxColumn Result;
|
||||
private DataGridViewTextBoxColumn TypeName;
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace Hawkeye.VisionBuilder.Features.VisionSteps
|
||||
|
||||
dataGridView1.DataSource = _bindingSource;
|
||||
dataGridView1.Columns[0].DataPropertyName = nameof(BaseOperationDecorator.Result);
|
||||
dataGridView1.Columns[1].DataPropertyName = nameof(BaseOperationDecorator.IsEnabled);
|
||||
dataGridView1.Columns[2].DataPropertyName = nameof(BaseOperationDecorator.Label);
|
||||
dataGridView1.Columns[2].ReadOnly = false;
|
||||
dataGridView1.ReadOnly = false;
|
||||
@@ -88,56 +89,41 @@ namespace Hawkeye.VisionBuilder.Features.VisionSteps
|
||||
|
||||
private void DataGridView1_Paint(object? sender, PaintEventArgs e)
|
||||
{
|
||||
var g = e.Graphics;
|
||||
var c1 = dataGridView1.GetCellDisplayRectangle(1, 0, true);
|
||||
var c2 = dataGridView1.GetCellDisplayRectangle(1, 1, true);
|
||||
|
||||
Pen start = new Pen(Color.Blue, 2);
|
||||
|
||||
Pen body = new Pen(Color.Blue, 2);
|
||||
|
||||
Pen end = new Pen(Color.Blue, 2);
|
||||
|
||||
end.EndCap = LineCap.Custom;
|
||||
|
||||
AdjustableArrowCap bigArrow = new AdjustableArrowCap(5, 5);
|
||||
end.CustomEndCap = bigArrow;
|
||||
|
||||
g.DrawLine(start, c1.Right, (c1.Bottom - c1.Top) / 2 + c1.Top, (c1.Right - c1.Left) / 2 + c1.Left,
|
||||
(c1.Bottom - c1.Top) / 2 + c1.Top);
|
||||
|
||||
g.DrawLine(body, (c1.Right - c1.Left) / 2 + c1.Left, (c1.Bottom - c1.Top) / 2 + c1.Top,
|
||||
(c2.Right - c2.Left) / 2 + c1.Left, (c2.Bottom - c2.Top) / 2 + c2.Top);
|
||||
|
||||
g.DrawLine(end, (c2.Right - c2.Left) / 2 + c2.Left, (c2.Bottom - c2.Top) / 2 + c2.Top, c2.Right,
|
||||
(c2.Bottom - c2.Top) / 2 + c2.Top);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void DataGridView1_CellPainting(object? sender, DataGridViewCellPaintingEventArgs e)
|
||||
{
|
||||
|
||||
if (e.ColumnIndex == 0 && e.RowIndex > -1 && e.Value != null)
|
||||
|
||||
if (e.RowIndex > -1)
|
||||
{
|
||||
var cx = e.CellBounds.Width / 2 + e.CellBounds.Left;
|
||||
var cy = e.CellBounds.Height / 2 + e.CellBounds.Top;
|
||||
var radius = e.CellBounds.Height / 2 - 3;
|
||||
var c1 = dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
|
||||
var row = dataGridView1.Rows[e.RowIndex];
|
||||
var rowValue = row.DataBoundItem as BaseOperationDecorator;
|
||||
e.PaintBackground(c1, true);
|
||||
|
||||
if ((bool)e.Value)
|
||||
if (e.ColumnIndex == 0 && e.Value != null)
|
||||
{
|
||||
e.Graphics.FillEllipse(Brushes.Green, cx - radius, cy - radius, radius * 2, radius * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.FillEllipse(Brushes.Red, cx - radius, cy - radius, radius * 2, radius * 2);
|
||||
}
|
||||
var cx = e.CellBounds.Width / 2 + e.CellBounds.Left;
|
||||
var cy = e.CellBounds.Height / 2 + e.CellBounds.Top;
|
||||
var radius = e.CellBounds.Height / 2 - 3;
|
||||
|
||||
e.Handled = true;
|
||||
|
||||
|
||||
if ((bool) e.Value)
|
||||
{
|
||||
e.Graphics.FillEllipse(Brushes.Green, cx - radius, cy - radius, radius * 2, radius * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.FillEllipse(Brushes.Red, cx - radius, cy - radius, radius * 2, radius * 2);
|
||||
}
|
||||
e.Handled = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,64 @@
|
||||
<root>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
@@ -60,7 +120,7 @@
|
||||
<metadata name="Indicator.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Link.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Enabled.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="UserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
Reference in New Issue
Block a user