hawkeye camera support(not tested)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user