using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Serialization;
using MMICfg;

namespace QDART_MFG_CfgEditor;

public class MMIPanel : UserControl
{
	public delegate void TargetFileChangedEventHandler(string targetfile);

	private MMICfg.root ori = new MMICfg.root();

	private RootConfig rc;

	private int max_dut;

	private int cur_dut;

	private string default_file;

	private string target_file;

	private BindingSource bsRoot = new BindingSource();

	private BindingSource bsDut = new BindingSource();

	private BindingSource bsFixture = new BindingSource();

	private BindingSource bsXytable = new BindingSource();

	private IContainer components;

	private Panel panel2;

	private CheckBox cbXytable;

	private ToolTip toolTip1;

	private Label label3;

	private Button btnResetAll;

	private ErrorProvider errorProvider1;

	private ComboBox cmbRevision;

	private ComboBox cmbId;

	private Label label4;

	private Label lbDut;

	private Label label10;

	private Label label7;

	private Label label6;

	private Label label5;

	private Panel panel3;

	private Panel panel1;

	private ComboBox cmbZspeedup;

	private ComboBox cmbXyspeed;

	private ComboBox cmbPort;

	private Panel plXyzTble;

	private CheckBox cbFixture;

	private Panel plFixture;

	public string DefaultFile
	{
		get
		{
			return default_file;
		}
		set
		{
			default_file = value;
		}
	}

	public string TargetFile
	{
		get
		{
			return target_file;
		}
		set
		{
			target_file = value;
		}
	}

	public event TargetFileChangedEventHandler TargetFileChanged;

	public MMIPanel(RootConfig cfg, int dutIndex)
	{
		InitializeComponent();
		InitVar(cfg, dutIndex);
		rc = cfg;
	}

	private void InitVar(RootConfig cfg, int currentDUT)
	{
		max_dut = 1;
		int.TryParse(cfg.DUTs, out max_dut);
		cur_dut = currentDUT;
		RootConfigAllPanel[] panel = cfg.All[0].Panel;
		foreach (RootConfigAllPanel rootConfigAllPanel in panel)
		{
			if (cfg.Station == rootConfigAllPanel.Name && rootConfigAllPanel.File.Length > 0)
			{
				DefaultFile = Common.GetPath(rootConfigAllPanel.File[0].Value);
			}
		}
		LoadTargetFile(cur_dut);
	}

	public bool OpenFile()
	{
		bool result = false;
		try
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "xml(*.xml)|*.xml";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				string fileName = openFileDialog.FileName;
				if (LoadTargetFile(fileName))
				{
					result = true;
				}
				else
				{
					ClearControls();
				}
			}
			return result;
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
			return false;
		}
	}

	public bool SaveResult(bool checkId = true)
	{
		bool result = false;
		try
		{
			string targetFile = TargetFile;
			if (!File.Exists(targetFile))
			{
				string directoryName = Path.GetDirectoryName(targetFile);
				if (!Directory.Exists(directoryName))
				{
					Directory.CreateDirectory(directoryName);
				}
				FileStream fileStream = File.Create(targetFile);
				fileStream.Close();
			}
			if (File.GetAttributes(targetFile).ToString().IndexOf("ReadOnly") != -1)
			{
				File.SetAttributes(targetFile, FileAttributes.Normal);
			}
			UiToData();
			SerialToFile(targetFile);
			if (checkId)
			{
				checkUniqueID();
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
			result = false;
		}
		return result;
	}

	private void checkUniqueID()
	{
		Dictionary<int, string> dictionary = new Dictionary<int, string>();
		Dictionary<int, string> dictionary2 = new Dictionary<int, string>();
		MMICfg.root root = new MMICfg.root();
		for (int num = cur_dut; num > 0; num--)
		{
			try
			{
				string path = Path.GetDirectoryName(DefaultFile) + "\\DUT_" + num + "\\" + Path.GetFileName(DefaultFile);
				using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
				{
					XmlSerializer xmlSerializer = new XmlSerializer(typeof(MMICfg.root));
					root = (MMICfg.root)xmlSerializer.Deserialize(fileStream);
					fileStream.Close();
				}
				if (num != cur_dut)
				{
					if (root != null)
					{
						if (root.FIXTURE.Enable.ToUpper() == "TRUE")
						{
							dictionary.Add(num, root.FIXTURE.ID);
						}
						if (root.XY_TABLE.Enable.ToUpper() == "TRUE")
						{
							dictionary2.Add(num, root.XY_TABLE.PORT);
						}
					}
				}
				else
				{
					if (ori.FIXTURE.Enable.ToUpper() == "TRUE")
					{
						dictionary.Add(num, ori.FIXTURE.ID);
					}
					if (ori.XY_TABLE.Enable.ToUpper() == "TRUE")
					{
						dictionary2.Add(num, ori.XY_TABLE.PORT);
					}
				}
			}
			catch
			{
			}
		}
		string text = "";
		if (dictionary.Count > 1)
		{
			foreach (KeyValuePair<int, string> kv in dictionary)
			{
				Func<KeyValuePair<int, string>, bool> predicate = delegate(KeyValuePair<int, string> q)
				{
					string value2 = q.Value;
					KeyValuePair<int, string> keyValuePair4 = kv;
					return value2 == keyValuePair4.Value;
				};
				IEnumerable<int> enumerable = from q in dictionary.Where(predicate)
					select q.Key;
				if (enumerable.Count() > 1)
				{
					string text2 = text;
					string[] array = new string[6]
					{
						text2,
						"DUT:",
						string.Join(",", enumerable),
						" with same Fixture ID: ",
						null,
						null
					};
					KeyValuePair<int, string> keyValuePair = kv;
					array[4] = keyValuePair.Value;
					array[5] = "\r\n";
					text = string.Concat(array);
				}
			}
		}
		if (dictionary2.Count > 1)
		{
			foreach (KeyValuePair<int, string> kv in dictionary2)
			{
				Func<KeyValuePair<int, string>, bool> predicate2 = delegate(KeyValuePair<int, string> q)
				{
					string value = q.Value;
					KeyValuePair<int, string> keyValuePair3 = kv;
					return value == keyValuePair3.Value;
				};
				IEnumerable<int> enumerable2 = from q in dictionary2.Where(predicate2)
					select q.Key;
				if (enumerable2.Count() > 1)
				{
					string text3 = text;
					string[] array2 = new string[6]
					{
						text3,
						"DUT:",
						string.Join(",", enumerable2),
						" with same XYZ port: ",
						null,
						null
					};
					KeyValuePair<int, string> keyValuePair2 = kv;
					array2[4] = keyValuePair2.Value;
					array2[5] = "\r\n";
					text = string.Concat(array2);
				}
			}
		}
		if (!string.IsNullOrEmpty(text))
		{
			MessageBox.Show(this, text, "Warning:");
		}
	}

	public bool SaveResultAs()
	{
		try
		{
			string targetFile = TargetFile;
			using (SaveFileDialog saveFileDialog = new SaveFileDialog())
			{
				saveFileDialog.Title = "Save file as Diag";
				saveFileDialog.InitialDirectory = Path.GetDirectoryName(targetFile);
				saveFileDialog.FileName = targetFile;
				saveFileDialog.Filter = "xmlfile|*.xml";
				if (saveFileDialog.ShowDialog() == DialogResult.OK)
				{
					targetFile = saveFileDialog.FileName;
					if (File.GetAttributes(targetFile).ToString().IndexOf("ReadOnly") != -1)
					{
						File.SetAttributes(targetFile, FileAttributes.Normal);
					}
					SerialToFile(targetFile);
					TargetFile = targetFile;
					OnFileChange(TargetFile);
				}
			}
			return true;
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
			return false;
		}
	}

	private void SerialToFile(string fileName)
	{
		XmlSerializer xmlSerializer = new XmlSerializer(typeof(MMICfg.root));
		using StreamWriter streamWriter = new StreamWriter(fileName);
		xmlSerializer.Serialize(streamWriter, ori);
		streamWriter.Close();
	}

	private bool LoadTargetFile(int index)
	{
		bool flag = false;
		try
		{
			string text = "";
			text = (TargetFile = ((index != 0) ? (Path.GetDirectoryName(DefaultFile) + "\\DUT_" + index + "\\" + Path.GetFileName(DefaultFile)) : DefaultFile));
			if (!File.Exists(text))
			{
				btnResetAll_Click(null, null);
				SaveResult(checkId: false);
				flag = true;
			}
			else
			{
				using (FileStream fileStream = new FileStream(text, FileMode.Open, FileAccess.Read, FileShare.Read))
				{
					XmlSerializer xmlSerializer = new XmlSerializer(typeof(MMICfg.root));
					ori = (MMICfg.root)xmlSerializer.Deserialize(fileStream);
					fileStream.Close();
					_ = ori;
				}
				BindingUI();
				InitControls();
				flag = true;
			}
			OnFileChange(TargetFile);
		}
		catch
		{
			flag = false;
		}
		return flag;
	}

	private bool LoadTargetFile(string resfile)
	{
		bool result = false;
		try
		{
			if (File.Exists(resfile))
			{
				using FileStream fileStream = new FileStream(resfile, FileMode.Open, FileAccess.Read, FileShare.Read);
				XmlSerializer xmlSerializer = new XmlSerializer(typeof(MMICfg.root));
				ori = (MMICfg.root)xmlSerializer.Deserialize(fileStream);
				fileStream.Close();
				if (ori != null)
				{
					TargetFile = resfile;
					BindingUI();
					InitControls();
					OnFileChange(resfile);
					result = true;
				}
			}
		}
		catch
		{
			result = false;
		}
		return result;
	}

	private void BindingUI()
	{
		try
		{
			List<string> list = new List<string>();
			for (int i = 0; i < 100; i++)
			{
				list.Add(i.ToString());
			}
			cmbPort.Items.Clear();
			cmbPort.Items.AddRange(list.ToArray());
			bsRoot = new BindingSource();
			cbFixture.DataBindings.Clear();
			cmbId.DataBindings.Clear();
			cmbRevision.DataBindings.Clear();
			cbXytable.DataBindings.Clear();
			cmbPort.DataBindings.Clear();
			cmbZspeedup.DataBindings.Clear();
			cmbXyspeed.DataBindings.Clear();
			if (ori != null)
			{
				bsRoot.Add(ori);
				bsFixture.DataSource = bsRoot;
				bsFixture.DataMember = "FIXTURE";
				bsXytable.DataSource = bsRoot;
				bsXytable.DataMember = "XY_TABLE";
				cbFixture.DataBindings.Add("Checked", bsFixture, "Enable");
				cbXytable.DataBindings.Add("Checked", bsXytable, "Enable");
				cmbId.DataBindings.Add("Text", bsFixture, "ID");
				cmbRevision.DataBindings.Add("Text", bsFixture, "FixtureRevision");
				cmbPort.DataBindings.Add("Text", bsXytable, "PORT");
				cmbXyspeed.DataBindings.Add("Text", bsXytable, "XY_SPEED");
				cmbZspeedup.DataBindings.Add("Text", bsXytable, "Z_SPEED_UP");
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
		}
	}

	private void InitControls()
	{
		cbFixture_CheckedChanged(null, null);
		cbXytable_CheckedChanged(null, null);
		if (cur_dut == 0)
		{
			lbDut.Text = "Diag port no need configure for single DUT test";
		}
		else
		{
			lbDut.Text = "Diag port for multi-DUT need configure in QMSCT tool for consistent.\r\nQMSCT -> Settings -> Station -> Ports";
		}
	}

	private void ClearControls()
	{
	}

	private void UiToData()
	{
	}

	private void OnFileChange(string resfileMMI)
	{
		if (this.TargetFileChanged != null)
		{
			this.TargetFileChanged(resfileMMI);
		}
	}

	public void TickFileChange()
	{
		OnFileChange(TargetFile);
	}

	private void btnResetAll_Click(object sender, EventArgs e)
	{
		ori = new MMICfg.root();
		ori.DUT = new rootDUT();
		ori.DUT.OPTIONAL = "";
		ori.FIXTURE = new rootFIXTURE();
		ori.FIXTURE.Enable = "True";
		ori.FIXTURE.ID = "0";
		ori.FIXTURE.FixtureRevision = "A";
		ori.FIXTURE.OPTIONAL = "";
		ori.XY_TABLE = new rootXY_TABLE();
		ori.XY_TABLE.CRADLE_TYPE = "2";
		ori.XY_TABLE.Enable = "False";
		ori.XY_TABLE.OPTIONAL = "";
		ori.XY_TABLE.PORT = "10";
		ori.XY_TABLE.XY_SPEED = "4";
		ori.XY_TABLE.Z_SPEED_UP = "False";
		BindingUI();
		InitControls();
	}

	private void cbFixture_CheckedChanged(object sender, EventArgs e)
	{
		plFixture.Enabled = cbFixture.Checked;
	}

	private void cbXytable_CheckedChanged(object sender, EventArgs e)
	{
		plXyzTble.Enabled = cbXytable.Checked;
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		this.panel2 = new System.Windows.Forms.Panel();
		this.cbXytable = new System.Windows.Forms.CheckBox();
		this.label3 = new System.Windows.Forms.Label();
		this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
		this.btnResetAll = new System.Windows.Forms.Button();
		this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
		this.panel1 = new System.Windows.Forms.Panel();
		this.label7 = new System.Windows.Forms.Label();
		this.cmbId = new System.Windows.Forms.ComboBox();
		this.cmbRevision = new System.Windows.Forms.ComboBox();
		this.label10 = new System.Windows.Forms.Label();
		this.label5 = new System.Windows.Forms.Label();
		this.label6 = new System.Windows.Forms.Label();
		this.panel3 = new System.Windows.Forms.Panel();
		this.lbDut = new System.Windows.Forms.Label();
		this.label4 = new System.Windows.Forms.Label();
		this.cmbPort = new System.Windows.Forms.ComboBox();
		this.cmbXyspeed = new System.Windows.Forms.ComboBox();
		this.cmbZspeedup = new System.Windows.Forms.ComboBox();
		this.plXyzTble = new System.Windows.Forms.Panel();
		this.cbFixture = new System.Windows.Forms.CheckBox();
		this.plFixture = new System.Windows.Forms.Panel();
		((System.ComponentModel.ISupportInitialize)this.errorProvider1).BeginInit();
		this.plXyzTble.SuspendLayout();
		this.plFixture.SuspendLayout();
		base.SuspendLayout();
		this.panel2.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
		this.panel2.Location = new System.Drawing.Point(86, 204);
		this.panel2.Margin = new System.Windows.Forms.Padding(4);
		this.panel2.Name = "panel2";
		this.panel2.Size = new System.Drawing.Size(640, 1);
		this.panel2.TabIndex = 13;
		this.cbXytable.AutoSize = true;
		this.cbXytable.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.cbXytable.Location = new System.Drawing.Point(86, 175);
		this.cbXytable.Margin = new System.Windows.Forms.Padding(4);
		this.cbXytable.Name = "cbXytable";
		this.cbXytable.Size = new System.Drawing.Size(482, 24);
		this.cbXytable.TabIndex = 32;
		this.cbXytable.Text = "XYZ Table ( Only For Assembled Device Automation )";
		this.toolTip1.SetToolTip(this.cbXytable, "Assembled device automation MMI test to configure");
		this.cbXytable.UseVisualStyleBackColor = true;
		this.cbXytable.CheckedChanged += new System.EventHandler(cbXytable_CheckedChanged);
		this.label3.AutoSize = true;
		this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label3.Location = new System.Drawing.Point(48, 15);
		this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(40, 20);
		this.label3.TabIndex = 23;
		this.label3.Text = "Port";
		this.toolTip1.SetToolTip(this.label3, "XYZ table searial port");
		this.btnResetAll.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.btnResetAll.Location = new System.Drawing.Point(557, 491);
		this.btnResetAll.Margin = new System.Windows.Forms.Padding(4);
		this.btnResetAll.Name = "btnResetAll";
		this.btnResetAll.Size = new System.Drawing.Size(169, 64);
		this.btnResetAll.TabIndex = 20;
		this.btnResetAll.Text = "Reset All";
		this.btnResetAll.UseVisualStyleBackColor = true;
		this.btnResetAll.Click += new System.EventHandler(btnResetAll_Click);
		this.errorProvider1.ContainerControl = this;
		this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
		this.panel1.Location = new System.Drawing.Point(86, 42);
		this.panel1.Margin = new System.Windows.Forms.Padding(4);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(640, 1);
		this.panel1.TabIndex = 11;
		this.label7.AutoSize = true;
		this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label7.Location = new System.Drawing.Point(47, 13);
		this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(26, 20);
		this.label7.TabIndex = 23;
		this.label7.Text = "ID";
		this.cmbId.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmbId.FormattingEnabled = true;
		this.cmbId.Items.AddRange(new object[8] { "0", "1", "2", "3", "4", "5", "6", "7" });
		this.cmbId.Location = new System.Drawing.Point(184, 9);
		this.cmbId.Name = "cmbId";
		this.cmbId.Size = new System.Drawing.Size(121, 24);
		this.cmbId.TabIndex = 36;
		this.cmbRevision.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmbRevision.FormattingEnabled = true;
		this.cmbRevision.Items.AddRange(new object[2] { "A", "B" });
		this.cmbRevision.Location = new System.Drawing.Point(184, 56);
		this.cmbRevision.Name = "cmbRevision";
		this.cmbRevision.Size = new System.Drawing.Size(121, 24);
		this.cmbRevision.TabIndex = 36;
		this.label10.AutoSize = true;
		this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label10.Location = new System.Drawing.Point(47, 60);
		this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label10.Name = "label10";
		this.label10.Size = new System.Drawing.Size(73, 20);
		this.label10.TabIndex = 23;
		this.label10.Text = "Revision";
		this.toolTip1.SetToolTip(this.label10, "Revision B for USB3.0 support HW");
		this.label5.AutoSize = true;
		this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label5.Location = new System.Drawing.Point(48, 63);
		this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(82, 20);
		this.label5.TabIndex = 23;
		this.label5.Text = "XY Speed";
		this.toolTip1.SetToolTip(this.label5, "SLOW = 16, MED = 4, FAST = 2,   HIGHEST = 1");
		this.label6.AutoSize = true;
		this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label6.Location = new System.Drawing.Point(48, 111);
		this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(96, 20);
		this.label6.TabIndex = 23;
		this.label6.Text = "Z Speed Up";
		this.toolTip1.SetToolTip(this.label6, "Z actuator speed up");
		this.panel3.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
		this.panel3.Location = new System.Drawing.Point(86, 401);
		this.panel3.Margin = new System.Windows.Forms.Padding(4);
		this.panel3.Name = "panel3";
		this.panel3.Size = new System.Drawing.Size(640, 1);
		this.panel3.TabIndex = 11;
		this.lbDut.AutoSize = true;
		this.lbDut.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lbDut.Location = new System.Drawing.Point(174, 423);
		this.lbDut.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lbDut.Name = "lbDut";
		this.lbDut.Size = new System.Drawing.Size(292, 20);
		this.lbDut.TabIndex = 23;
		this.lbDut.Text = "Port no need configure for single DUT";
		this.label4.AutoSize = true;
		this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.label4.Location = new System.Drawing.Point(82, 377);
		this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(166, 20);
		this.label4.TabIndex = 23;
		this.label4.Text = "Device Under Test";
		this.cmbPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmbPort.FormattingEnabled = true;
		this.cmbPort.Location = new System.Drawing.Point(185, 11);
		this.cmbPort.Name = "cmbPort";
		this.cmbPort.Size = new System.Drawing.Size(121, 24);
		this.cmbPort.TabIndex = 37;
		this.cmbXyspeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmbXyspeed.FormattingEnabled = true;
		this.cmbXyspeed.Items.AddRange(new object[4] { "16", "4", "2", "1" });
		this.cmbXyspeed.Location = new System.Drawing.Point(185, 59);
		this.cmbXyspeed.Name = "cmbXyspeed";
		this.cmbXyspeed.Size = new System.Drawing.Size(121, 24);
		this.cmbXyspeed.TabIndex = 37;
		this.cmbZspeedup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmbZspeedup.FormattingEnabled = true;
		this.cmbZspeedup.Items.AddRange(new object[2] { "True", "False" });
		this.cmbZspeedup.Location = new System.Drawing.Point(185, 107);
		this.cmbZspeedup.Name = "cmbZspeedup";
		this.cmbZspeedup.Size = new System.Drawing.Size(121, 24);
		this.cmbZspeedup.TabIndex = 37;
		this.plXyzTble.Controls.Add(this.cmbZspeedup);
		this.plXyzTble.Controls.Add(this.cmbXyspeed);
		this.plXyzTble.Controls.Add(this.cmbPort);
		this.plXyzTble.Controls.Add(this.label6);
		this.plXyzTble.Controls.Add(this.label5);
		this.plXyzTble.Controls.Add(this.label3);
		this.plXyzTble.Location = new System.Drawing.Point(126, 214);
		this.plXyzTble.Name = "plXyzTble";
		this.plXyzTble.Size = new System.Drawing.Size(494, 152);
		this.plXyzTble.TabIndex = 38;
		this.cbFixture.AutoSize = true;
		this.cbFixture.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.cbFixture.Location = new System.Drawing.Point(86, 15);
		this.cbFixture.Margin = new System.Windows.Forms.Padding(4);
		this.cbFixture.Name = "cbFixture";
		this.cbFixture.Size = new System.Drawing.Size(221, 24);
		this.cbFixture.TabIndex = 32;
		this.cbFixture.Text = "Fixture ( Box / Board )";
		this.cbFixture.UseVisualStyleBackColor = true;
		this.cbFixture.CheckedChanged += new System.EventHandler(cbFixture_CheckedChanged);
		this.plFixture.Controls.Add(this.cmbRevision);
		this.plFixture.Controls.Add(this.cmbId);
		this.plFixture.Controls.Add(this.label10);
		this.plFixture.Controls.Add(this.label7);
		this.plFixture.Location = new System.Drawing.Point(127, 51);
		this.plFixture.Name = "plFixture";
		this.plFixture.Size = new System.Drawing.Size(492, 104);
		this.plFixture.TabIndex = 39;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 16f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.Controls.Add(this.plFixture);
		base.Controls.Add(this.plXyzTble);
		base.Controls.Add(this.panel2);
		base.Controls.Add(this.cbFixture);
		base.Controls.Add(this.cbXytable);
		base.Controls.Add(this.label4);
		base.Controls.Add(this.lbDut);
		base.Controls.Add(this.panel3);
		base.Controls.Add(this.btnResetAll);
		base.Controls.Add(this.panel1);
		base.Name = "MMIPanel";
		base.Size = new System.Drawing.Size(749, 569);
		((System.ComponentModel.ISupportInitialize)this.errorProvider1).EndInit();
		this.plXyzTble.ResumeLayout(false);
		this.plXyzTble.PerformLayout();
		this.plFixture.ResumeLayout(false);
		this.plFixture.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
