using LB_VisionControls;
|
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 LB_VisionProcesses.Processes
|
{
|
public partial class RecordControl : UserControl
|
{
|
ProcessCollections<object> Inputs = new ProcessCollections<object>();
|
public RecordControl(int index = 0, UserRecord record = null, ProcessCollections<object> Inputs = null)
|
{
|
InitializeComponent();
|
|
if (Inputs == null)
|
this.Inputs = new ProcessCollections<object>();
|
|
if (record == null)
|
record = new UserRecord();
|
|
lblIndex.Text = index.ToString();
|
txtMsg.Text = record.MsgMap;
|
txtShape.Text = record.ShapeMap;
|
txtResult.Text = record.ResultMap;
|
txtX.Text = record.XMap;
|
txtY.Text = record.YMap;
|
|
//cmbText.MouseClick += MouseClick;
|
//cmbShape.MouseClick += MouseClick;
|
//cmbResult.MouseClick += MouseClick;
|
//cmbX.MouseClick += MouseClick;
|
//cmbY.MouseClick += MouseClick;
|
}
|
|
public UserRecord GetUserRecord()
|
{
|
UserRecord record = new UserRecord();
|
record.MsgMap = txtMsg.Text;
|
record.ShapeMap = txtShape.Text;
|
record.ResultMap = txtResult.Text;
|
record.XMap = txtX.Text;
|
record.YMap = txtY.Text;
|
return record;
|
}
|
|
//private void MouseClick(object sender, EventArgs e)
|
//{
|
// switch ((sender as ComboBox).Name)
|
// {
|
// case "cmbText":
|
// cmbText.Items.Clear();
|
// foreach (var input in Inputs)
|
// {
|
// if (string.IsNullOrEmpty(input.Value?.ToString()))
|
// continue;
|
// cmbText.Items.Add($"{{{input.Name}}}");
|
// }
|
// break;
|
// case "cmbShape":
|
// cmbShape.Items.Clear();
|
// foreach (var input in Inputs)
|
// {
|
// if (input.Value == null || !(input.Value is ROI))
|
// continue;
|
// cmbShape.Items.Add($"{{{input.Name}}}");
|
// }
|
// break;
|
// case "cmbResult":
|
// cmbResult.Items.Clear();
|
// foreach (var input in Inputs)
|
// {
|
// if (input.Value == null || !(bool.TryParse(input.Value?.ToString(), out _)))
|
// continue;
|
// cmbResult.Items.Add($"{{{input.Name}}}");
|
// }
|
// break;
|
// case "cmbX":
|
// cmbX.Items.Clear();
|
// foreach (var input in Inputs)
|
// {
|
// if (input.Value == null || !(double.TryParse(input.Value?.ToString(), out _)))
|
// continue;
|
// cmbX.Items.Add($"{{{input.Name}}}");
|
// }
|
// break;
|
// case "cmbY":
|
// cmbY.Items.Clear();
|
// foreach (var input in Inputs)
|
// {
|
// if (input.Value == null || !(double.TryParse(input.Value?.ToString(), out _)))
|
// continue;
|
// cmbY.Items.Add($"{{{input.Name}}}");
|
// }
|
// break;
|
// default:
|
// break;
|
// }
|
//}
|
}
|
}
|