check point
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Features.ToolEditor
|
||||
{
|
||||
public class CodeCompletionControl : ListBox
|
||||
{
|
||||
private TextBox textBox;
|
||||
private readonly Form _form;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
static extern bool GetCaretPos(out Point lpPoint);
|
||||
|
||||
public CodeCompletionControl(TextBox textBox)
|
||||
{
|
||||
this.textBox = textBox;
|
||||
|
||||
this.Visible = false;
|
||||
this.Location = new Point(0, 0);
|
||||
this.Width = 200;
|
||||
_form = new Form();
|
||||
_form.Width = this.Width;
|
||||
_form.Height = 200;
|
||||
|
||||
_form.Controls.Add(this);
|
||||
this.Dock = DockStyle.Fill;
|
||||
_form.FormBorderStyle = FormBorderStyle.None;
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.TopMost = true;
|
||||
_form.StartPosition = FormStartPosition.Manual;
|
||||
|
||||
textBox.TextChanged += TextBox_TextChanged;
|
||||
textBox.KeyDown += TextBox_KeyDown;
|
||||
|
||||
this.KeyDown += CodeCompletionControl_KeyDown;
|
||||
}
|
||||
|
||||
private void CodeCompletionControl_KeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Up)
|
||||
{
|
||||
if (this.SelectedIndex == 0)
|
||||
{
|
||||
textBox.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
else if (e.KeyCode == Keys.Enter && this.Visible && this.SelectedIndex != -1)
|
||||
{
|
||||
Accept();
|
||||
}else if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
this.Visible = false;
|
||||
_form.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
this.Visible = false;
|
||||
_form.Hide();
|
||||
}
|
||||
|
||||
private void Accept()
|
||||
{
|
||||
var start = textBox.Text.LastIndexOf(".");
|
||||
if (start == -1)
|
||||
{
|
||||
textBox.Text = this.SelectedItem.ToString();
|
||||
textBox.SelectionStart = textBox.Text.Length;
|
||||
this.Visible = false;
|
||||
_form.Hide();
|
||||
return;
|
||||
}
|
||||
textBox.Text = textBox.Text.Substring(0,start+1);
|
||||
textBox.Text += this.SelectedItem.ToString();
|
||||
textBox.SelectionStart = textBox.Text.Length;
|
||||
this.Visible = false;
|
||||
_form.Hide();
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(int.TryParse(textBox.Text,out _))return;
|
||||
if (GetCaretPos(out Point point))
|
||||
{
|
||||
// Convert screen position to client position
|
||||
|
||||
|
||||
// Set location of this control
|
||||
_form.Location = textBox.PointToScreen(new Point(point.X, point.Y + textBox.Size.Height)); ; // Add offset to avoid overlap with text cursor
|
||||
}
|
||||
|
||||
// Update suggestions
|
||||
var suggestions = GetSuggestions(textBox.Text);
|
||||
this.Items.Clear();
|
||||
this.Items.AddRange(suggestions.ToArray());
|
||||
if (this.Items.Count > 0)
|
||||
{
|
||||
_form.Show();
|
||||
textBox.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
_form.Hide();
|
||||
}
|
||||
this.Visible = this.Items.Count > 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void TextBox_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Down && this.Visible)
|
||||
{
|
||||
this.Focus();
|
||||
this.SelectedIndex = 0;
|
||||
}
|
||||
else if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
else if (e.KeyCode == Keys.Enter && this.Visible && this.SelectedIndex != -1)
|
||||
{
|
||||
Accept();
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void NeedSugestionsDelegate(string input, List<string> suggestions);
|
||||
public event NeedSugestionsDelegate NeedSugestions =delegate{ };
|
||||
|
||||
private List<string> GetSuggestions(string input)
|
||||
{
|
||||
var source = new List<string>();
|
||||
|
||||
NeedSugestions(input, source);
|
||||
if (source.Count == 0)
|
||||
{
|
||||
Visible = false;
|
||||
_form.Hide();
|
||||
}
|
||||
return source.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
130
Hawkeye.VisionBuilder/Features/ToolEditor/ToolConfigurationPanel.Designer.cs
generated
Normal file
130
Hawkeye.VisionBuilder/Features/ToolEditor/ToolConfigurationPanel.Designer.cs
generated
Normal file
@@ -0,0 +1,130 @@
|
||||
namespace Hawkeye.VisionBuilder.Features.ToolEditor
|
||||
{
|
||||
partial class ToolConfigurationPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.cbAutoApply = new System.Windows.Forms.CheckBox();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoScroll = true;
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(800, 392);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
this.flowLayoutPanel1.WrapContents = false;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.panel2);
|
||||
this.panel1.Controls.Add(this.cbAutoApply);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 392);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(800, 58);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panel2.Controls.Add(this.btnOk);
|
||||
this.panel2.Controls.Add(this.btnCancel);
|
||||
this.panel2.Enabled = false;
|
||||
this.panel2.Location = new System.Drawing.Point(624, 8);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(168, 40);
|
||||
this.panel2.TabIndex = 3;
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(8, 8);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOk.TabIndex = 0;
|
||||
this.btnOk.Text = "Apply";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Location = new System.Drawing.Point(88, 8);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 1;
|
||||
this.btnCancel.Text = "Revert";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// cbAutoApply
|
||||
//
|
||||
this.cbAutoApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cbAutoApply.AutoSize = true;
|
||||
this.cbAutoApply.Location = new System.Drawing.Point(528, 16);
|
||||
this.cbAutoApply.Name = "cbAutoApply";
|
||||
this.cbAutoApply.Size = new System.Drawing.Size(86, 19);
|
||||
this.cbAutoApply.TabIndex = 2;
|
||||
this.cbAutoApply.Text = "Auto-apply";
|
||||
this.cbAutoApply.UseVisualStyleBackColor = true;
|
||||
this.cbAutoApply.Visible = false;
|
||||
//
|
||||
// ToolConfigurationPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "ToolConfigurationPanel";
|
||||
this.Text = "Tool Configuration";
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private FlowLayoutPanel flowLayoutPanel1;
|
||||
private Panel panel1;
|
||||
private Button btnCancel;
|
||||
private Button btnOk;
|
||||
private CheckBox cbAutoApply;
|
||||
private Panel panel2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
using System.Reflection;
|
||||
using Hawkeye.VisionBuilder.Features.ImagePreview;
|
||||
using Hawkeye.VisionBuilder.Features.VisionSteps;
|
||||
using Hawkeye.VisionBuilder.Panels;
|
||||
using Hawkeye.VisionBuilder.Workflow;
|
||||
using Hawkeye.VisionBuilder.Workflow.Datatypes;
|
||||
using Hawkeye.VisionBuilder.Workflow.Links;
|
||||
using Hawkeye.VisionBuilder.Workflow.Operations.Attributes;
|
||||
using Hawkeye.VisionBuilder.Workflow.Operations.Filters;
|
||||
using Rectangle = Hawkeye.VisionBuilder.Workflow.Datatypes.Elements.Rectangle.RectangleElement;
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Features.ToolEditor
|
||||
{
|
||||
public partial class ToolConfigurationPanel : BasePannel
|
||||
{
|
||||
private readonly WorkflowList _workflowList;
|
||||
private readonly VisionStepsPanel _visionStepsPanel;
|
||||
private BaseOperation _selectedOperation;
|
||||
private Dictionary<string, object> _parameters;
|
||||
|
||||
public ToolConfigurationPanel(WorkflowList workflowList,VisionStepsPanel visionStepsPanel)
|
||||
{
|
||||
_workflowList = workflowList;
|
||||
_visionStepsPanel = visionStepsPanel;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
public void SetOperation(BaseOperation operation)
|
||||
{
|
||||
_selectedOperation=operation;
|
||||
panel2.Enabled=false;
|
||||
|
||||
//todo: generate header
|
||||
|
||||
var parameters = operation.GetParameters();
|
||||
_parameters=parameters;
|
||||
this.flowLayoutPanel1.Controls.Clear();
|
||||
foreach (var p in parameters)
|
||||
{
|
||||
GenerateParameterField(parameters,p.Key, operation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void GenerateParameterField(Dictionary<string, object> toolParameter, string pKey,
|
||||
BaseOperation operation)
|
||||
{
|
||||
|
||||
|
||||
var value = toolParameter[pKey];
|
||||
if (value is int i)
|
||||
{
|
||||
var control = new NumericUpDown() { Minimum = -99999999, Maximum = 99999999, Value = i, };
|
||||
control.TextChanged += (sender, args) =>
|
||||
{
|
||||
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
control.ValueChanged += (sender, args) =>
|
||||
{
|
||||
|
||||
toolParameter[pKey] = ((int) control.Value);
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
}else if (value is double d)
|
||||
{
|
||||
var control = new NumericUpDown() { Minimum = -99999999, Maximum = 99999999, Value = (decimal)d, Increment = (decimal)0.1, DecimalPlaces = 2};
|
||||
control.TextChanged += (sender, args) =>
|
||||
{
|
||||
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
control.ValueChanged += (sender, args) =>
|
||||
{
|
||||
|
||||
toolParameter[pKey] = ((double) control.Value);
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
}else if (value is string s)
|
||||
{
|
||||
var control = new TextBox() { Text = s };
|
||||
control.TextChanged += (sender, args) =>
|
||||
{
|
||||
toolParameter[pKey] = (control.Text);
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
}
|
||||
else if (value is FilePath filePath)
|
||||
{
|
||||
|
||||
var control = new Button()
|
||||
{
|
||||
Text = filePath.Path,
|
||||
|
||||
};
|
||||
control.Click += (sender, args) =>
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog();
|
||||
dialog.Filter = filePath.Format;
|
||||
dialog.FileName = filePath.Path;
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
control.Text = dialog.FileName;
|
||||
filePath.Path = MakeRelative(dialog.FileName,Environment.CurrentDirectory);
|
||||
control.Text = filePath.Path;
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
}
|
||||
};
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
|
||||
}
|
||||
else if (value is SelectFromList selectFromList)
|
||||
{
|
||||
var control = new ComboBox()
|
||||
{
|
||||
DropDownStyle = ComboBoxStyle.DropDownList
|
||||
};
|
||||
control.Items.AddRange(selectFromList.GetList().ToArray());
|
||||
control.SelectedItem = selectFromList.Value;
|
||||
control.SelectedIndexChanged += (sender, args) =>
|
||||
{
|
||||
selectFromList.Value = (control.SelectedItem as string);
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
}
|
||||
else if (value is ScriptValue scriptValue)
|
||||
{
|
||||
var control = new TextBox() { Text = scriptValue.Script };
|
||||
control.TextChanged += (sender, args) =>
|
||||
{
|
||||
scriptValue.Script = (control.Text);
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
var cc = new CodeCompletionControl(control);
|
||||
cc.NeedSugestions += Cc_NeedSugestions;
|
||||
}
|
||||
else if (value is bool b)
|
||||
{
|
||||
var control = new CheckBox() { Checked = b };
|
||||
control.CheckedChanged += (sender, args) =>
|
||||
{
|
||||
toolParameter[pKey] = (control.Checked);
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
}
|
||||
if (value is Guid refId && pKey.StartsWith("Reference"))
|
||||
{
|
||||
var control = new ComboBox()
|
||||
{
|
||||
DropDownStyle = ComboBoxStyle.DropDownList
|
||||
};
|
||||
control.SelectedIndexChanged += (sender, args) =>
|
||||
{
|
||||
toolParameter[pKey] = ((control.SelectedItem)as BaseOperation)?.Id??NoOrigin.Instance.Id;
|
||||
panel2.Enabled = true;
|
||||
TriggerChanged();
|
||||
};
|
||||
var candidates = _workflowList.Operations.TakeWhile(x=> x.Id != operation.Id);
|
||||
control.Items.Add(NoOrigin.Instance);
|
||||
if (pKey.Contains("Edge"))
|
||||
{
|
||||
control.Items.AddRange(candidates.Where(x => x is IHaveEdge).Select(x => x as IHaveEdge).ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
control.Items.AddRange(candidates.Where(x => x is IHaveOrigin ).Select(x => x as IHaveOrigin).ToArray());
|
||||
}
|
||||
|
||||
|
||||
control.DisplayMember = nameof(BaseOperation.Label);
|
||||
control.SelectedItem = candidates.FirstOrDefault(x=>x.Id==refId)?? NoOrigin.Instance;
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
}
|
||||
else if(value is Action a)
|
||||
{
|
||||
var control = new Button()
|
||||
{
|
||||
Text = "Execute"
|
||||
};
|
||||
|
||||
control.Click += (sender, args) => a();
|
||||
var row = new ToolConfigurationRow(BaseOperation.MakeOperationName(pKey), control);
|
||||
row.Width = flowLayoutPanel1.Width - 50;
|
||||
this.flowLayoutPanel1.Controls.Add(row);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static string MakeRelative(string path, string basePath)
|
||||
{
|
||||
var uri = new Uri(path);
|
||||
var baseUri = new Uri(basePath);
|
||||
|
||||
// if path can't be made relative
|
||||
if (baseUri.Scheme != uri.Scheme)
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
var res= baseUri.MakeRelativeUri(uri).ToString();
|
||||
// ensure windows path separator
|
||||
return "..\\"+res.Replace("/", "\\");
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Cc_NeedSugestions(string input, List<string> suggestions)
|
||||
{
|
||||
|
||||
var start = input.IndexOf(".");
|
||||
if (start == -1)
|
||||
{
|
||||
|
||||
suggestions.AddRange(_workflowList.Operations.Select(x => x.Label).Where(x=>x.StartsWith(input)));
|
||||
suggestions.Add("config");
|
||||
return;
|
||||
}
|
||||
var word = input.Substring(0, start);
|
||||
if (word == "config")
|
||||
{
|
||||
GenerateSugestions(input.Substring(start + 1), _workflowList.Configuration, suggestions);
|
||||
return;
|
||||
}
|
||||
|
||||
var o = _workflowList.Operations.FirstOrDefault(x => x.Label == word);
|
||||
if (o!=null)
|
||||
{
|
||||
GenerateSugestions(input.Substring(start + 1), o, suggestions);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<PropertyInfo> GetAllowedProperties(Type type)
|
||||
{
|
||||
return type.GetProperties().Where(x => x.GetCustomAttribute<NotForToolAttribute>() == null);
|
||||
}
|
||||
private void GenerateSugestions(string input, object o, List<string> suggestions)
|
||||
{
|
||||
var start = input.IndexOf(".");
|
||||
if (start == -1)
|
||||
{
|
||||
var props = GetAllowedProperties(o.GetType()).Where(x => x.Name.StartsWith(input)).ToList();
|
||||
props.ForEach(x => suggestions.Add(x.Name));
|
||||
}
|
||||
else
|
||||
{
|
||||
var word = input.Substring(0, start);
|
||||
var prop = GetAllowedProperties(o.GetType()).FirstOrDefault(x => x.Name == word);
|
||||
if (prop != null)
|
||||
{
|
||||
GenerateSugestions(input.Substring(start + 1), prop.GetValue(o), suggestions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TriggerChanged()
|
||||
{
|
||||
if(cbAutoApply.Checked)
|
||||
btnOk_Click(null,null);
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
_selectedOperation.SetParameters(_parameters);
|
||||
SetOperation(_selectedOperation);
|
||||
_workflowList.ExecuteTill(_selectedOperation);
|
||||
_workflowList.ExecuteOne(_selectedOperation);
|
||||
_visionStepsPanel.UpdateView();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetOperation(_selectedOperation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<root>
|
||||
<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">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
73
Hawkeye.VisionBuilder/Features/ToolEditor/ToolConfigurationRow.Designer.cs
generated
Normal file
73
Hawkeye.VisionBuilder/Features/ToolEditor/ToolConfigurationRow.Designer.cs
generated
Normal file
@@ -0,0 +1,73 @@
|
||||
namespace Hawkeye.VisionBuilder.Features.ToolEditor
|
||||
{
|
||||
partial class ToolConfigurationRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(8, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(38, 15);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "label1";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panel1.Location = new System.Drawing.Point(128, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(419, 27);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// ToolConfigurationRow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Margin = new System.Windows.Forms.Padding(8);
|
||||
this.Name = "ToolConfigurationRow";
|
||||
this.Size = new System.Drawing.Size(543, 27);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label label1;
|
||||
private Panel panel1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Features.ToolEditor
|
||||
{
|
||||
public partial class ToolConfigurationRow : UserControl
|
||||
{
|
||||
private readonly Control _input;
|
||||
|
||||
public ToolConfigurationRow(string name,Control input)
|
||||
{
|
||||
_input = input;
|
||||
InitializeComponent();
|
||||
label1.Text = name;
|
||||
panel1.Controls.Add(input);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
_input.Width = this.Width - panel1.Left - 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<root>
|
||||
<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">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user