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

namespace QDART_MFG_CfgEditor;

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

	public const string GPIB = "GPIB";

	public const string IP = "IP";

	public const string VISA = "VISA";

	public const string DEFUALT = "0(Default)";

	public const int MAX_GPIB_ADDRESS = 30;

	public const string DEFUALT_DLL = "Default dll";

	private string default_file;

	private string target_file;

	private int max_dut;

	private int cur_dut;

	private bool bLoadDefault;

	private Dictionary<string, string> pslist = new Dictionary<string, string>();

	private Dictionary<string, string> cplist = new Dictionary<string, string>();

	private Dictionary<string, string> cplistInvert = new Dictionary<string, string>();

	private Dictionary<string, string> linkNameCPSG = new Dictionary<string, string>();

	private Dictionary<string, string> tclist = new Dictionary<string, string>();

	private Dictionary<string, string> tclistInvert = new Dictionary<string, string>();

	private Dictionary<string, string> cplanlist = new Dictionary<string, string>();

	private EquipmentSet es = new EquipmentSet();

	private bool use_ps;

	private string name_ps;

	private string remote_ps;

	private string pad_ps;

	private string name_cp;

	private string remote_cp;

	private string pad_cp;

	private string sad_cp;

	private string ip_cp;

	private string visa_cp;

	private string lan_cp;

	private string board_id_cp;

	private string usrdll_cp;

	private bool use_cp2;

	private string name_cp2;

	private string remote_cp2;

	private string pad_cp2;

	private string sad_cp2;

	private string ip_cp2;

	private string lan_cp2;

	private string board_id_cp2;

	private string usrdll_cp2;

	private bool use_tc;

	private string name_tc;

	private string remote_tc;

	private string pad_tc;

	private IContainer components;

	public Label lb_cp_ip;

	public Label label5;

	public ComboBox cb_cp_sad;

	public Label label3;

	public Label label4;

	public Label label2;

	public ComboBox cb_cp_pad;

	public ComboBox comboBox1;

	public Label lb_cp;

	public CheckBox cb_ps;

	public ComboBox cb_ps_pad;

	public Label label7;

	public Label label8;

	public Label label9;

	public ComboBox cb_cp_name;

	public ComboBox cb_cp_remote;

	public ComboBox cb_ps_name;

	public ComboBox cb_ps_remote;

	private Panel pl_sad;

	private Panel pl_ip;

	private Panel pl_pad;

	private ToolTip toolTip1;

	private Panel pl_ps;

	public CustomizedTextBox tb_cp_ip;

	public Label lbLan;

	public ComboBox cb_cp_lan;

	public Label lbboardid;

	public ComboBox cb_cp_board_id;

	private Panel pl_tc;

	public Label label1;

	public Label label6;

	public Label label10;

	public ComboBox cbd_tc_pad;

	public ComboBox cbd_tc_rt;

	public ComboBox cbd_tc_name;

	public CheckBox cbTC;

	public ComboBox cmb_cp2_name;

	public ComboBox cmb_cp2_remote;

	public Label label12;

	public Label label13;

	private Panel pl_cp2_sad;

	public Label label14;

	public ComboBox cmb_cp2_sad;

	private Panel pl_cp2_ip;

	public CustomizedTextBox tb_cp2_ip;

	public Label lb_cp2_ip;

	private Panel pl_cp2_pad;

	public Label label16;

	public ComboBox cmb_cp2_pad;

	public ComboBox cmb_cp2_lan;

	public Label label17;

	public ComboBox cmb_cp2_bid;

	public Label lbboardid2;

	private Panel pl_cp2;

	public CheckBox cb_cp2;

	private Label lbl_Annotation;

	private Panel panel1;

	private TextBox tb_cp2_dll;

	private Button btn_cp2_dll;

	public Label label15;

	private Button btn_cp1_dll;

	public Label label11;

	private TextBox tb_cp1_dll;

	private ErrorProvider errorProvider1;

	private Panel plVisa;

	public Label lbVisaString;

	private TextBox tb_cp_visa;

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

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

	public bool UseTC
	{
		get
		{
			return use_tc;
		}
		set
		{
			use_tc = value;
		}
	}

	public string NameTC
	{
		get
		{
			return name_tc;
		}
		set
		{
			name_tc = value;
		}
	}

	public string RemoteTC
	{
		get
		{
			return remote_tc;
		}
		set
		{
			remote_tc = value;
		}
	}

	public string PadTC
	{
		get
		{
			return pad_tc;
		}
		set
		{
			pad_tc = value;
		}
	}

	public bool UsePS
	{
		get
		{
			return use_ps;
		}
		set
		{
			use_ps = value;
		}
	}

	public string NamePS
	{
		get
		{
			return name_ps;
		}
		set
		{
			name_ps = value;
		}
	}

	public string RemotePS
	{
		get
		{
			return remote_ps;
		}
		set
		{
			remote_ps = value;
		}
	}

	public string PadPS
	{
		get
		{
			return pad_ps;
		}
		set
		{
			pad_ps = value;
		}
	}

	public string NameCP
	{
		get
		{
			return name_cp;
		}
		set
		{
			name_cp = value;
		}
	}

	public string RemoteCP
	{
		get
		{
			return remote_cp;
		}
		set
		{
			remote_cp = value;
			if (remote_cp == "IP")
			{
				pl_ip.Visible = true;
			}
			else
			{
				pl_ip.Visible = false;
			}
		}
	}

	public string PadCP
	{
		get
		{
			return pad_cp;
		}
		set
		{
			pad_cp = value;
		}
	}

	public string SadCP
	{
		get
		{
			return sad_cp;
		}
		set
		{
			sad_cp = value;
		}
	}

	public string IpCP
	{
		get
		{
			return ip_cp;
		}
		set
		{
			ip_cp = value;
		}
	}

	public string VisaCP
	{
		get
		{
			return visa_cp;
		}
		set
		{
			visa_cp = value;
		}
	}

	public string LanCP
	{
		get
		{
			return lan_cp;
		}
		set
		{
			lan_cp = value;
		}
	}

	public string BoardIdCP
	{
		get
		{
			return board_id_cp;
		}
		set
		{
			board_id_cp = value;
		}
	}

	public string UsrdllCP
	{
		get
		{
			return usrdll_cp;
		}
		set
		{
			usrdll_cp = value;
		}
	}

	public bool UseCP2
	{
		get
		{
			return use_cp2;
		}
		set
		{
			use_cp2 = value;
		}
	}

	public string NameCP2
	{
		get
		{
			return name_cp2;
		}
		set
		{
			name_cp2 = value;
		}
	}

	public string RemoteCP2
	{
		get
		{
			return remote_cp2;
		}
		set
		{
			remote_cp2 = value;
			if (remote_cp2 == "IP")
			{
				pl_cp2_ip.Visible = true;
			}
			else
			{
				pl_cp2_ip.Visible = false;
			}
		}
	}

	public string PadCP2
	{
		get
		{
			return pad_cp2;
		}
		set
		{
			pad_cp2 = value;
		}
	}

	public string SadCP2
	{
		get
		{
			return sad_cp2;
		}
		set
		{
			sad_cp2 = value;
		}
	}

	public string IpCP2
	{
		get
		{
			return ip_cp2;
		}
		set
		{
			ip_cp2 = value;
		}
	}

	public string LanCP2
	{
		get
		{
			return lan_cp2;
		}
		set
		{
			lan_cp2 = value;
		}
	}

	public string BoardIdCP2
	{
		get
		{
			return board_id_cp2;
		}
		set
		{
			board_id_cp2 = value;
		}
	}

	public string UsrdllCP2
	{
		get
		{
			return usrdll_cp2;
		}
		set
		{
			usrdll_cp2 = value;
		}
	}

	public event TargetFileChangedEventHandler TargetFileChanged;

	public RFCalVerifyPanel(RootConfig cfg, int currentDUT)
	{
		InitializeComponent();
		InitVar(cfg, currentDUT);
		InitControls();
		InitProperty();
		cb_cp2.Text = "Call Processor 2";
		cbTC.Text = "Temperature\r\nChamber";
		lbl_Annotation.Text = "Notes:\r\n - “Call Processor 1” serves for both Cellular RF Calibration and Cellular RF Verification\r\n - “Temperature Chamber” should be enabled for Cellular RF Characterization over temperature";
	}

	private void InitVar(RootConfig cfg, int currentDUT)
	{
		pslist.Clear();
		cplist.Clear();
		cplistInvert.Clear();
		linkNameCPSG.Clear();
		tclist.Clear();
		tclistInvert.Clear();
		cplanlist.Clear();
		max_dut = 1;
		bool.TryParse(cfg.BlankWhenNull, out bLoadDefault);
		int.TryParse(cfg.DUTs, out max_dut);
		cur_dut = currentDUT;
		RootConfigAllInstList[] instList = cfg.All[0].InstList;
		foreach (RootConfigAllInstList rootConfigAllInstList in instList)
		{
			switch (rootConfigAllInstList.Name)
			{
			case "PS":
			{
				InfoItem[] infoItem3 = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem4 in infoItem3)
				{
					pslist.Add(infoItem4.Name, infoItem4.Value);
				}
				break;
			}
			case "CP":
			{
				InfoItem[] infoItem7 = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem8 in infoItem7)
				{
					cplist.Add(infoItem8.Name, infoItem8.Value);
					cplistInvert.Add(infoItem8.Value, infoItem8.Name);
				}
				break;
			}
			case "LinkCPSG":
			{
				InfoItem[] infoItem9 = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem10 in infoItem9)
				{
					linkNameCPSG.Add(infoItem10.Name, infoItem10.Value);
				}
				break;
			}
			case "TempChamber":
			{
				InfoItem[] infoItem5 = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem6 in infoItem5)
				{
					tclist.Add(infoItem6.Name, infoItem6.Value);
					tclistInvert.Add(infoItem6.Value, infoItem6.Name);
				}
				break;
			}
			case "CP_LAN":
			{
				InfoItem[] infoItem = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem2 in infoItem)
				{
					cplanlist.Add(infoItem2.Name, infoItem2.Value);
				}
				break;
			}
			}
		}
		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);
	}

	private void InitControls()
	{
		List<string> list = new List<string>();
		for (int i = 1; i <= 30; i++)
		{
			list.Add(i.ToString());
		}
		List<string> list2 = new List<string>();
		for (int j = 1; j <= 100; j++)
		{
			list2.Add(j.ToString());
		}
		cb_ps_remote.Items.Clear();
		cb_ps_pad.Items.Clear();
		cb_ps_name.Items.Clear();
		cb_cp_pad.Items.Clear();
		cb_cp_sad.Items.Clear();
		cb_cp_name.Items.Clear();
		cb_cp_remote.Items.Clear();
		cb_cp_lan.Items.Clear();
		cb_cp_board_id.Items.Clear();
		cmb_cp2_pad.Items.Clear();
		cmb_cp2_sad.Items.Clear();
		cmb_cp2_name.Items.Clear();
		cmb_cp2_remote.Items.Clear();
		cmb_cp2_lan.Items.Clear();
		cmb_cp2_bid.Items.Clear();
		cbd_tc_name.Items.Clear();
		cbd_tc_rt.Items.Clear();
		cbd_tc_pad.Items.Clear();
		cb_cp_pad.Items.AddRange(list.ToArray());
		cb_cp_sad.Items.AddRange(list2.ToArray());
		cb_ps_pad.Items.AddRange(list.ToArray());
		cbd_tc_pad.Items.AddRange(list.ToArray());
		cmb_cp2_pad.Items.AddRange(list.ToArray());
		cmb_cp2_sad.Items.AddRange(list.ToArray());
		cb_ps_name.Items.AddRange(pslist.Keys.ToArray());
		cb_ps_remote.Items.AddRange(new string[1] { "GPIB" });
		cb_cp_name.Items.AddRange(cplist.Keys.ToArray());
		cb_cp_remote.Items.AddRange(new string[3] { "GPIB", "IP", "VISA" });
		cb_cp_board_id.Items.AddRange(new string[2] { "0(Default)", "1" });
		cb_cp_lan.Items.AddRange(new string[2] { "0(Default)", "wan_rfcal_qcom_scpi" });
		tb_cp_ip.Tag = new Tip(tb_cp_ip, lb_cp_ip, toolTip1, Tip.TxtContent.IP_ADDRESS, "ip address", "CP ip address", "IP address error, Example: 192.168.0.1");
		cbd_tc_name.Items.AddRange(tclist.Keys.ToArray());
		cbd_tc_rt.Items.AddRange(new string[1] { "GPIB" });
		cmb_cp2_name.Items.AddRange(cplist.Keys.ToArray());
		cmb_cp2_remote.Items.AddRange(new string[2] { "GPIB", "IP" });
		cmb_cp2_bid.Items.AddRange(new string[2] { "0(Default)", "1" });
		cmb_cp2_lan.Items.AddRange(new string[3] { "0(Default)", "wan_rfcal_qcom_scpi", "wan_rfcal_native" });
		tb_cp2_ip.Tag = new Tip(tb_cp_ip, lb_cp2_ip, toolTip1, Tip.TxtContent.IP_ADDRESS, "ip address", "CP ip address", "IP address error, Example: 192.168.0.1");
	}

	private void InitProperty()
	{
		UsePS = false;
		if (es.Equipment.Count != 0)
		{
			foreach (InstConfig item in es.Equipment)
			{
				switch (item.Identifier)
				{
				case "Power_Supply1":
					UsePS = true;
					NamePS = item.Name;
					PadPS = item.Pad;
					RemotePS = "GPIB";
					break;
				case "Call_Processor1":
					try
					{
						if (item.Name.ToUpper() == "QUALCOMM SCPI")
						{
							errorProvider1.SetError(cb_cp_name, "All test equipment can now be to a specific manufacturer/model type instead of 'QTI_RFCalSCPI'. Please select the appropriate equipment type.");
							NameCP = "";
						}
						else
						{
							NameCP = cplistInvert[item.Name];
						}
					}
					catch
					{
						NameCP = "";
					}
					PadCP = item.Pad;
					SadCP = item.Sad;
					IpCP = item.Ip;
					VisaCP = item.Visa;
					LanCP = (string.IsNullOrEmpty(item.Language) ? "0(Default)" : item.Language);
					BoardIdCP = (string.IsNullOrEmpty(item.Board_id) ? "0(Default)" : item.Board_id);
					UsrdllCP = (string.IsNullOrEmpty(item.Usrdll) ? "Default dll" : item.Usrdll);
					break;
				case "Call_Processor2":
					UseCP2 = true;
					try
					{
						NameCP2 = cplistInvert[item.Name];
					}
					catch
					{
						NameCP2 = "";
					}
					PadCP2 = item.Pad;
					SadCP2 = item.Sad;
					IpCP2 = item.Ip;
					LanCP2 = (string.IsNullOrEmpty(item.Language) ? "0(Default)" : item.Language);
					BoardIdCP2 = (string.IsNullOrEmpty(item.Board_id) ? "0(Default)" : item.Board_id);
					UsrdllCP2 = (string.IsNullOrEmpty(item.Usrdll) ? "Default dll" : item.Usrdll);
					break;
				case "Temperature_Chamber1":
					UseTC = true;
					try
					{
						NameTC = tclistInvert[item.Name];
					}
					catch
					{
						NameTC = "";
					}
					PadTC = item.Pad;
					RemoteTC = "GPIB";
					break;
				}
			}
		}
		if (!string.IsNullOrEmpty(IpCP))
		{
			RemoteCP = "IP";
		}
		else if (!string.IsNullOrEmpty(PadCP))
		{
			RemoteCP = "GPIB";
		}
		else if (!string.IsNullOrEmpty(VisaCP))
		{
			RemoteCP = "VISA";
		}
		if (!string.IsNullOrEmpty(IpCP2))
		{
			RemoteCP2 = "IP";
		}
		else if (!string.IsNullOrEmpty(PadCP2))
		{
			RemoteCP2 = "GPIB";
		}
	}

	public bool OpenFile()
	{
		bool result = false;
		try
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "xml(*.xml)|*.xml";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				TargetFile = openFileDialog.FileName;
				OnFileChange(TargetFile);
				if (LoadTargetFile(TargetFile))
				{
					InitControls();
					InitProperty();
					DataBindingToUI();
					result = true;
				}
			}
			return result;
		}
		catch (Exception ex)
		{
			MessageBox.Show(ex.Message);
			return false;
		}
	}

	private bool LoadTargetFile(string resfile)
	{
		if (File.Exists(resfile))
		{
			using (FileStream fileStream = new FileStream(resfile, FileMode.Open, FileAccess.Read, FileShare.Read))
			{
				XmlSerializer xmlSerializer = new XmlSerializer(typeof(EquipmentSet));
				es = (EquipmentSet)xmlSerializer.Deserialize(fileStream);
				fileStream.Close();
				return true;
			}
		}
		return false;
	}

	private void LoadTargetFile(int index)
	{
		string text = "";
		text = ((index != 0) ? (Path.GetDirectoryName(DefaultFile) + "\\DUT_" + index + "\\" + Path.GetFileName(DefaultFile)) : DefaultFile);
		TargetFile = text;
		if (!File.Exists(TargetFile))
		{
			if (!bLoadDefault)
			{
				es.Equipment = new ArrayList();
				return;
			}
			TargetFile = DefaultFile;
		}
		try
		{
			if (!File.Exists(TargetFile))
			{
				return;
			}
			string text2 = TargetFile + ".bak";
			if (File.Exists(text2))
			{
				if (File.GetAttributes(text2).ToString().IndexOf("ReadOnly") != -1)
				{
					File.SetAttributes(text2, FileAttributes.Normal);
				}
				File.Delete(text2);
			}
			File.Copy(TargetFile, text2);
			using FileStream fileStream = new FileStream(TargetFile, FileMode.Open, FileAccess.Read, FileShare.Read);
			XmlSerializer xmlSerializer = new XmlSerializer(typeof(EquipmentSet));
			es = (EquipmentSet)xmlSerializer.Deserialize(fileStream);
			fileStream.Close();
		}
		catch
		{
			es.Equipment = new ArrayList();
		}
	}

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

	private void RFCalVerifyPanel_Load(object sender, EventArgs e)
	{
		DataBindingToUI();
	}

	private void DataBindingToUI()
	{
		cb_ps.DataBindings.Clear();
		cb_ps_name.DataBindings.Clear();
		cb_ps_pad.DataBindings.Clear();
		cb_ps_remote.DataBindings.Clear();
		cb_cp_name.DataBindings.Clear();
		cb_cp_pad.DataBindings.Clear();
		cb_cp_remote.DataBindings.Clear();
		cb_cp_sad.DataBindings.Clear();
		cb_cp_lan.DataBindings.Clear();
		cb_cp_board_id.DataBindings.Clear();
		tb_cp_ip.DataBindings.Clear();
		tb_cp1_dll.DataBindings.Clear();
		tb_cp_visa.DataBindings.Clear();
		cmb_cp2_name.DataBindings.Clear();
		cmb_cp2_pad.DataBindings.Clear();
		cmb_cp2_remote.DataBindings.Clear();
		cmb_cp2_sad.DataBindings.Clear();
		cmb_cp2_lan.DataBindings.Clear();
		cmb_cp2_bid.DataBindings.Clear();
		tb_cp2_ip.DataBindings.Clear();
		tb_cp2_dll.DataBindings.Clear();
		cb_cp2.DataBindings.Clear();
		cbTC.DataBindings.Clear();
		cbd_tc_name.DataBindings.Clear();
		cbd_tc_pad.DataBindings.Clear();
		cbd_tc_rt.DataBindings.Clear();
		cb_ps.DataBindings.Add(new Binding("Checked", this, "UsePS"));
		cb_ps_name.DataBindings.Add(new Binding("Text", this, "NamePS"));
		cb_ps_pad.DataBindings.Add(new Binding("Text", this, "PadPS"));
		cb_ps_remote.DataBindings.Add(new Binding("Text", this, "RemotePS"));
		cb_cp_name.DataBindings.Add(new Binding("Text", this, "NameCP"));
		cb_cp_pad.DataBindings.Add(new Binding("Text", this, "PadCP"));
		cb_cp_remote.DataBindings.Add(new Binding("Text", this, "RemoteCP"));
		cb_cp_sad.DataBindings.Add(new Binding("Text", this, "SadCP"));
		cb_cp_lan.DataBindings.Add(new Binding("Text", this, "LanCP"));
		cb_cp_board_id.DataBindings.Add(new Binding("Text", this, "BoardIdCP"));
		tb_cp_ip.DataBindings.Add(new Binding("Text", this, "IpCP"));
		tb_cp1_dll.DataBindings.Add(new Binding("Text", this, "UsrdllCP"));
		tb_cp_visa.DataBindings.Add(new Binding("Text", this, "VisaCP"));
		cb_cp2.DataBindings.Add(new Binding("Checked", this, "UseCP2"));
		cmb_cp2_name.DataBindings.Add(new Binding("Text", this, "NameCP2"));
		cmb_cp2_pad.DataBindings.Add(new Binding("Text", this, "PadCP2"));
		cmb_cp2_remote.DataBindings.Add(new Binding("Text", this, "RemoteCP2"));
		cmb_cp2_sad.DataBindings.Add(new Binding("Text", this, "SadCP2"));
		cmb_cp2_lan.DataBindings.Add(new Binding("Text", this, "LanCP2"));
		cmb_cp2_bid.DataBindings.Add(new Binding("Text", this, "BoardIdCP2"));
		tb_cp2_ip.DataBindings.Add(new Binding("Text", this, "IpCP2"));
		tb_cp2_dll.DataBindings.Add(new Binding("Text", this, "UsrdllCP2"));
		cbTC.DataBindings.Add(new Binding("Checked", this, "UseTC"));
		cbd_tc_name.DataBindings.Add(new Binding("Text", this, "NameTC"));
		cbd_tc_pad.DataBindings.Add(new Binding("Text", this, "PadTC"));
		cbd_tc_rt.DataBindings.Add(new Binding("Text", this, "RemoteTC"));
	}

	private void UpdateUI(object sender, EventArgs e)
	{
		if (!string.IsNullOrEmpty(cb_cp_name.Text))
		{
			errorProvider1.Clear();
			if (cb_cp_name.Text == "R&S CMU")
			{
				pl_pad.Visible = true;
				pl_sad.Visible = true;
				pl_ip.Visible = false;
			}
			else
			{
				pl_sad.Visible = false;
			}
			if (cmb_cp2_name.Text == "R&S CMU")
			{
				pl_cp2_pad.Visible = true;
				pl_cp2_sad.Visible = true;
				pl_cp2_ip.Visible = false;
			}
			else
			{
				pl_cp2_sad.Visible = false;
			}
			if (cb_cp_remote.Text == "IP")
			{
				pl_pad.Visible = false;
				pl_sad.Visible = false;
				pl_ip.Visible = true;
				lbboardid.Visible = false;
				cb_cp_board_id.Visible = false;
				plVisa.Visible = false;
			}
			else if (cb_cp_remote.Text == "GPIB")
			{
				pl_ip.Visible = false;
				pl_pad.Visible = true;
				lbboardid.Visible = true;
				cb_cp_board_id.Visible = true;
				plVisa.Visible = false;
			}
			else
			{
				plVisa.Visible = true;
				pl_pad.Visible = false;
				pl_sad.Visible = false;
				pl_ip.Visible = false;
				lbboardid.Visible = false;
				cb_cp_board_id.Visible = false;
			}
			if (cmb_cp2_remote.Text == "IP")
			{
				pl_cp2_pad.Visible = false;
				pl_cp2_sad.Visible = false;
				pl_cp2_ip.Visible = true;
				lbboardid2.Visible = false;
				cmb_cp2_bid.Visible = false;
			}
			else
			{
				pl_cp2_ip.Visible = false;
				pl_cp2_pad.Visible = true;
				lbboardid2.Visible = true;
				cmb_cp2_bid.Visible = true;
			}
			cb_cp_lan.Items.Clear();
			cb_cp_lan.Items.AddRange(cplanlist[cb_cp_name.Text].Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries));
			if (string.IsNullOrEmpty(cb_cp_lan.Text))
			{
				cb_cp_lan.SelectedIndex = 0;
			}
			Validate();
		}
	}

	public void SaveResult(bool saveResultAs = false)
	{
		string text = TargetFile;
		try
		{
			string strcomment = LoadComment(text);
			if (saveResultAs)
			{
				using SaveFileDialog saveFileDialog = new SaveFileDialog();
				saveFileDialog.Title = "Save file as Diag";
				saveFileDialog.InitialDirectory = Path.GetDirectoryName(text);
				saveFileDialog.FileName = text;
				saveFileDialog.Filter = "xmlfile|*.xml";
				if (saveFileDialog.ShowDialog() != DialogResult.OK)
				{
					return;
				}
				text = saveFileDialog.FileName;
			}
			if (!File.Exists(text))
			{
				string directoryName = Path.GetDirectoryName(text);
				if (!Directory.Exists(directoryName))
				{
					Directory.CreateDirectory(directoryName);
				}
				FileStream fileStream = File.Create(text);
				fileStream.Close();
			}
			if (File.GetAttributes(text).ToString().IndexOf("ReadOnly") != -1)
			{
				File.SetAttributes(text, FileAttributes.Normal);
			}
			es.Equipment.Clear();
			if (UsePS)
			{
				InstConfig instConfig = new InstConfig();
				instConfig.Identifier = "Power_Supply1";
				instConfig.Name = NamePS;
				instConfig.Pad = PadPS;
				instConfig.Type = "PS";
				es.Equipment.Add(instConfig);
			}
			if (UseTC)
			{
				InstConfig instConfig2 = new InstConfig();
				instConfig2.Identifier = "Temperature_Chamber1";
				instConfig2.Name = tclist[NameTC];
				instConfig2.Pad = PadTC;
				instConfig2.Type = "TC";
				es.Equipment.Add(instConfig2);
			}
			InstConfig instConfig3 = new InstConfig();
			instConfig3.Identifier = "Call_Processor1";
			instConfig3.Type = "CP";
			instConfig3.Name = cplist[NameCP];
			if (RemoteCP == "IP")
			{
				instConfig3.Ip = IpCP;
			}
			else if (RemoteCP == "GPIB")
			{
				instConfig3.Pad = PadCP;
				if (NameCP == "R&S CMU")
				{
					instConfig3.Sad = SadCP;
				}
			}
			else
			{
				instConfig3.Visa = VisaCP;
			}
			if (BoardIdCP != "0(Default)")
			{
				instConfig3.Board_id = BoardIdCP;
			}
			if (LanCP != "0(Default)")
			{
				instConfig3.Language = LanCP;
			}
			if (UsrdllCP != "Default dll")
			{
				instConfig3.Usrdll = UsrdllCP;
			}
			es.Equipment.Add(instConfig3);
			if (linkNameCPSG.Keys.Contains(NameCP))
			{
				InstConfig instConfig4 = new InstConfig();
				instConfig4.Identifier = "Signal_Generator4";
				instConfig4.Type = "DSG";
				instConfig4.Name = linkNameCPSG[NameCP];
				if (RemoteCP == "IP")
				{
					instConfig4.Ip = IpCP;
				}
				else if (RemoteCP == "GPIB")
				{
					instConfig4.Pad = PadCP;
					if (NameCP == "R&S CMU")
					{
						instConfig4.Sad = SadCP;
					}
				}
				else
				{
					instConfig4.Visa = VisaCP;
				}
				es.Equipment.Add(instConfig4);
			}
			if (UseCP2)
			{
				InstConfig instConfig5 = new InstConfig();
				instConfig5.Identifier = "Call_Processor2";
				instConfig5.Type = "CP";
				instConfig5.Name = cplist[NameCP2];
				if (RemoteCP2 == "IP")
				{
					instConfig5.Ip = IpCP2;
				}
				else
				{
					instConfig5.Pad = PadCP2;
					if (NameCP2 == "R&S CMU")
					{
						instConfig5.Sad = SadCP2;
					}
				}
				if (BoardIdCP2 != "0(Default)")
				{
					instConfig5.Board_id = BoardIdCP2;
				}
				if (LanCP2 != "0(Default)")
				{
					instConfig5.Language = LanCP2;
				}
				if (UsrdllCP2 != "Default dll")
				{
					instConfig5.Usrdll = UsrdllCP2;
				}
				es.Equipment.Add(instConfig5);
			}
			SerialToFile(text);
			SaveComment(text, strcomment);
			if (saveResultAs)
			{
				TargetFile = text;
				OnFileChange(TargetFile);
				if (LoadTargetFile(TargetFile))
				{
					InitControls();
					InitProperty();
					DataBindingToUI();
				}
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show("Save failed. Due to " + ex.Message);
		}
	}

	private string LoadComment(string tar)
	{
		string result = "";
		try
		{
			if (File.Exists(tar))
			{
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.Load(tar);
				XmlNode documentElement = xmlDocument.DocumentElement;
				if ("EquipmentSet" == documentElement.Name)
				{
					foreach (XmlNode childNode in documentElement.ChildNodes)
					{
						if (childNode.NodeType == XmlNodeType.Comment)
						{
							result = childNode.OuterXml;
						}
					}
					documentElement.InnerXml = "";
				}
			}
			return result;
		}
		catch
		{
			return result;
		}
	}

	private void SaveComment(string tar, string strcomment)
	{
		try
		{
			XmlDocument xmlDocument = new XmlDocument();
			xmlDocument.Load(tar);
			XmlNode documentElement = xmlDocument.DocumentElement;
			if ("EquipmentSet" == documentElement.Name)
			{
				documentElement.InnerXml += strcomment;
			}
			xmlDocument.Save(tar);
		}
		catch
		{
		}
	}

	private void cb_ps_CheckedChanged(object sender, EventArgs e)
	{
		pl_ps.Enabled = (((CheckBox)sender).Checked ? true : false);
	}

	private void cb_cp2_CheckedChanged(object sender, EventArgs e)
	{
		pl_cp2.Enabled = (((CheckBox)sender).Checked ? true : false);
	}

	private void cb_tc_CheckedChanged(object sender, EventArgs e)
	{
		pl_tc.Enabled = (((CheckBox)sender).Checked ? true : false);
	}

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

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

	private void btn_cp1_dll_Click(object sender, EventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.Title = "Select the dll then click 'Open', click 'Cancel' to reset to default";
		openFileDialog.Filter = "dll(*.dll)|*.dll";
		if (openFileDialog.ShowDialog() == DialogResult.OK)
		{
			TextBox textBox = tb_cp1_dll;
			string text = (UsrdllCP = openFileDialog.FileName);
			textBox.Text = text;
		}
		else
		{
			TextBox textBox2 = tb_cp1_dll;
			string text3 = (UsrdllCP = "Default dll");
			textBox2.Text = text3;
		}
	}

	private void btn_cp2_dll_Click(object sender, EventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.Title = "Select the dll then click 'Open', click 'Cancel' to reset to default";
		openFileDialog.Filter = "dll(*.dll)|*.dll";
		if (openFileDialog.ShowDialog() == DialogResult.OK)
		{
			TextBox textBox = tb_cp2_dll;
			string text = (UsrdllCP2 = openFileDialog.FileName);
			textBox.Text = text;
		}
		else
		{
			TextBox textBox2 = tb_cp2_dll;
			string text3 = (UsrdllCP2 = "Default dll");
			textBox2.Text = text3;
		}
	}

	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.lb_cp_ip = new System.Windows.Forms.Label();
		this.label5 = new System.Windows.Forms.Label();
		this.cb_cp_sad = new System.Windows.Forms.ComboBox();
		this.label3 = new System.Windows.Forms.Label();
		this.label4 = new System.Windows.Forms.Label();
		this.label2 = new System.Windows.Forms.Label();
		this.cb_cp_pad = new System.Windows.Forms.ComboBox();
		this.lb_cp = new System.Windows.Forms.Label();
		this.cb_ps = new System.Windows.Forms.CheckBox();
		this.cb_ps_pad = new System.Windows.Forms.ComboBox();
		this.label7 = new System.Windows.Forms.Label();
		this.label8 = new System.Windows.Forms.Label();
		this.label9 = new System.Windows.Forms.Label();
		this.cb_cp_name = new System.Windows.Forms.ComboBox();
		this.cb_cp_remote = new System.Windows.Forms.ComboBox();
		this.cb_ps_name = new System.Windows.Forms.ComboBox();
		this.cb_ps_remote = new System.Windows.Forms.ComboBox();
		this.pl_sad = new System.Windows.Forms.Panel();
		this.pl_ip = new System.Windows.Forms.Panel();
		this.tb_cp_ip = new System.Windows.Forms.CustomizedTextBox();
		this.pl_pad = new System.Windows.Forms.Panel();
		this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
		this.lbboardid = new System.Windows.Forms.Label();
		this.lbLan = new System.Windows.Forms.Label();
		this.cbTC = new System.Windows.Forms.CheckBox();
		this.cb_cp2 = new System.Windows.Forms.CheckBox();
		this.label11 = new System.Windows.Forms.Label();
		this.label15 = new System.Windows.Forms.Label();
		this.pl_ps = new System.Windows.Forms.Panel();
		this.cb_cp_lan = new System.Windows.Forms.ComboBox();
		this.cb_cp_board_id = new System.Windows.Forms.ComboBox();
		this.pl_tc = new System.Windows.Forms.Panel();
		this.label1 = new System.Windows.Forms.Label();
		this.label6 = new System.Windows.Forms.Label();
		this.label10 = new System.Windows.Forms.Label();
		this.cbd_tc_pad = new System.Windows.Forms.ComboBox();
		this.cbd_tc_rt = new System.Windows.Forms.ComboBox();
		this.cbd_tc_name = new System.Windows.Forms.ComboBox();
		this.cmb_cp2_name = new System.Windows.Forms.ComboBox();
		this.cmb_cp2_remote = new System.Windows.Forms.ComboBox();
		this.label12 = new System.Windows.Forms.Label();
		this.label13 = new System.Windows.Forms.Label();
		this.pl_cp2_sad = new System.Windows.Forms.Panel();
		this.label14 = new System.Windows.Forms.Label();
		this.cmb_cp2_sad = new System.Windows.Forms.ComboBox();
		this.pl_cp2_ip = new System.Windows.Forms.Panel();
		this.tb_cp2_ip = new System.Windows.Forms.CustomizedTextBox();
		this.lb_cp2_ip = new System.Windows.Forms.Label();
		this.pl_cp2_pad = new System.Windows.Forms.Panel();
		this.label16 = new System.Windows.Forms.Label();
		this.cmb_cp2_pad = new System.Windows.Forms.ComboBox();
		this.cmb_cp2_lan = new System.Windows.Forms.ComboBox();
		this.label17 = new System.Windows.Forms.Label();
		this.cmb_cp2_bid = new System.Windows.Forms.ComboBox();
		this.lbboardid2 = new System.Windows.Forms.Label();
		this.pl_cp2 = new System.Windows.Forms.Panel();
		this.tb_cp2_dll = new System.Windows.Forms.TextBox();
		this.btn_cp2_dll = new System.Windows.Forms.Button();
		this.lbl_Annotation = new System.Windows.Forms.Label();
		this.panel1 = new System.Windows.Forms.Panel();
		this.btn_cp1_dll = new System.Windows.Forms.Button();
		this.tb_cp1_dll = new System.Windows.Forms.TextBox();
		this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
		this.plVisa = new System.Windows.Forms.Panel();
		this.lbVisaString = new System.Windows.Forms.Label();
		this.tb_cp_visa = new System.Windows.Forms.TextBox();
		this.pl_sad.SuspendLayout();
		this.pl_ip.SuspendLayout();
		this.pl_pad.SuspendLayout();
		this.pl_ps.SuspendLayout();
		this.pl_tc.SuspendLayout();
		this.pl_cp2_sad.SuspendLayout();
		this.pl_cp2_ip.SuspendLayout();
		this.pl_cp2_pad.SuspendLayout();
		this.pl_cp2.SuspendLayout();
		this.panel1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.errorProvider1).BeginInit();
		this.plVisa.SuspendLayout();
		base.SuspendLayout();
		this.lb_cp_ip.AutoSize = true;
		this.lb_cp_ip.Location = new System.Drawing.Point(3, 2);
		this.lb_cp_ip.Name = "lb_cp_ip";
		this.lb_cp_ip.Size = new System.Drawing.Size(55, 13);
		this.lb_cp_ip.TabIndex = 19;
		this.lb_cp_ip.Text = "ip address";
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(7, 3);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(24, 13);
		this.label5.TabIndex = 17;
		this.label5.Text = "sad";
		this.cb_cp_sad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_cp_sad.FormattingEnabled = true;
		this.cb_cp_sad.Location = new System.Drawing.Point(0, 18);
		this.cb_cp_sad.Name = "cb_cp_sad";
		this.cb_cp_sad.Size = new System.Drawing.Size(54, 21);
		this.cb_cp_sad.TabIndex = 8;
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(293, 63);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(39, 13);
		this.label3.TabIndex = 15;
		this.label3.Text = "remote";
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(2, 3);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(25, 13);
		this.label4.TabIndex = 14;
		this.label4.Text = "pad";
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(149, 64);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(33, 13);
		this.label2.TabIndex = 13;
		this.label2.Text = "name";
		this.cb_cp_pad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_cp_pad.FormattingEnabled = true;
		this.cb_cp_pad.Location = new System.Drawing.Point(1, 18);
		this.cb_cp_pad.Name = "cb_cp_pad";
		this.cb_cp_pad.Size = new System.Drawing.Size(51, 21);
		this.cb_cp_pad.TabIndex = 7;
		this.lb_cp.AutoSize = true;
		this.lb_cp.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lb_cp.Location = new System.Drawing.Point(15, 79);
		this.lb_cp.Name = "lb_cp";
		this.lb_cp.Size = new System.Drawing.Size(123, 20);
		this.lb_cp.TabIndex = 10;
		this.lb_cp.Text = "Call Processor 1";
		this.cb_ps.AutoSize = true;
		this.cb_ps.Checked = true;
		this.cb_ps.CheckState = System.Windows.Forms.CheckState.Checked;
		this.cb_ps.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.cb_ps.Location = new System.Drawing.Point(2, 37);
		this.cb_ps.Name = "cb_ps";
		this.cb_ps.Size = new System.Drawing.Size(124, 24);
		this.cb_ps.TabIndex = 1;
		this.cb_ps.Text = "Power Supply";
		this.toolTip1.SetToolTip(this.cb_ps, "Select only when programmable power supply connected ");
		this.cb_ps.UseVisualStyleBackColor = true;
		this.cb_ps.CheckedChanged += new System.EventHandler(cb_ps_CheckedChanged);
		this.cb_ps_pad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_ps_pad.FormattingEnabled = true;
		this.cb_ps_pad.Location = new System.Drawing.Point(235, 24);
		this.cb_ps_pad.Name = "cb_ps_pad";
		this.cb_ps_pad.Size = new System.Drawing.Size(51, 21);
		this.cb_ps_pad.TabIndex = 4;
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(2, 7);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(33, 13);
		this.label7.TabIndex = 13;
		this.label7.Text = "name";
		this.label8.AutoSize = true;
		this.label8.Location = new System.Drawing.Point(236, 8);
		this.label8.Name = "label8";
		this.label8.Size = new System.Drawing.Size(25, 13);
		this.label8.TabIndex = 14;
		this.label8.Text = "pad";
		this.label9.AutoSize = true;
		this.label9.Location = new System.Drawing.Point(150, 8);
		this.label9.Name = "label9";
		this.label9.Size = new System.Drawing.Size(39, 13);
		this.label9.TabIndex = 15;
		this.label9.Text = "remote";
		this.cb_cp_name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_cp_name.FormattingEnabled = true;
		this.cb_cp_name.Location = new System.Drawing.Point(144, 79);
		this.cb_cp_name.Name = "cb_cp_name";
		this.cb_cp_name.Size = new System.Drawing.Size(129, 21);
		this.cb_cp_name.TabIndex = 5;
		this.cb_cp_name.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.cb_cp_remote.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_cp_remote.FormattingEnabled = true;
		this.cb_cp_remote.Location = new System.Drawing.Point(296, 79);
		this.cb_cp_remote.Name = "cb_cp_remote";
		this.cb_cp_remote.Size = new System.Drawing.Size(62, 21);
		this.cb_cp_remote.TabIndex = 6;
		this.cb_cp_remote.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.cb_ps_name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_ps_name.FormattingEnabled = true;
		this.cb_ps_name.Location = new System.Drawing.Point(2, 24);
		this.cb_ps_name.Name = "cb_ps_name";
		this.cb_ps_name.Size = new System.Drawing.Size(129, 21);
		this.cb_ps_name.TabIndex = 2;
		this.cb_ps_remote.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_ps_remote.FormattingEnabled = true;
		this.cb_ps_remote.Location = new System.Drawing.Point(152, 24);
		this.cb_ps_remote.Name = "cb_ps_remote";
		this.cb_ps_remote.Size = new System.Drawing.Size(62, 21);
		this.cb_ps_remote.TabIndex = 3;
		this.pl_sad.Controls.Add(this.label5);
		this.pl_sad.Controls.Add(this.cb_cp_sad);
		this.pl_sad.Location = new System.Drawing.Point(452, 61);
		this.pl_sad.Name = "pl_sad";
		this.pl_sad.Size = new System.Drawing.Size(80, 48);
		this.pl_sad.TabIndex = 22;
		this.pl_ip.Controls.Add(this.tb_cp_ip);
		this.pl_ip.Controls.Add(this.lb_cp_ip);
		this.pl_ip.Location = new System.Drawing.Point(532, 62);
		this.pl_ip.Name = "pl_ip";
		this.pl_ip.Size = new System.Drawing.Size(128, 46);
		this.pl_ip.TabIndex = 23;
		this.tb_cp_ip.Location = new System.Drawing.Point(3, 18);
		this.tb_cp_ip.Masked = System.Windows.Forms.Mask.IpAddress;
		this.tb_cp_ip.Name = "tb_cp_ip";
		this.tb_cp_ip.Size = new System.Drawing.Size(94, 20);
		this.tb_cp_ip.TabIndex = 9;
		this.pl_pad.Controls.Add(this.label4);
		this.pl_pad.Controls.Add(this.cb_cp_pad);
		this.pl_pad.Location = new System.Drawing.Point(378, 61);
		this.pl_pad.Name = "pl_pad";
		this.pl_pad.Size = new System.Drawing.Size(72, 47);
		this.pl_pad.TabIndex = 24;
		this.lbboardid.AutoSize = true;
		this.lbboardid.Location = new System.Drawing.Point(292, 112);
		this.lbboardid.Name = "lbboardid";
		this.lbboardid.Size = new System.Drawing.Size(48, 13);
		this.lbboardid.TabIndex = 29;
		this.lbboardid.Tag = "";
		this.lbboardid.Text = "board_id";
		this.toolTip1.SetToolTip(this.lbboardid, "Select 1 when using second GPIB Bus");
		this.lbLan.AutoSize = true;
		this.lbLan.Location = new System.Drawing.Point(150, 112);
		this.lbLan.Name = "lbLan";
		this.lbLan.Size = new System.Drawing.Size(51, 13);
		this.lbLan.TabIndex = 27;
		this.lbLan.Text = "language";
		this.toolTip1.SetToolTip(this.lbLan, "Replace name = \"Qualcomm SCPI\" to support RFCal & Verify combined XTT ");
		this.cbTC.AutoSize = true;
		this.cbTC.Checked = true;
		this.cbTC.CheckState = System.Windows.Forms.CheckState.Checked;
		this.cbTC.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.cbTC.Location = new System.Drawing.Point(0, 168);
		this.cbTC.Name = "cbTC";
		this.cbTC.Size = new System.Drawing.Size(188, 24);
		this.cbTC.TabIndex = 30;
		this.cbTC.Text = "Temperature Chamber";
		this.toolTip1.SetToolTip(this.cbTC, "“Temperature Chamber” should be enabled for Cellular RF Characterization over temperature\r\n ");
		this.cbTC.UseVisualStyleBackColor = true;
		this.cbTC.CheckedChanged += new System.EventHandler(cb_tc_CheckedChanged);
		this.cb_cp2.AutoSize = true;
		this.cb_cp2.Checked = true;
		this.cb_cp2.CheckState = System.Windows.Forms.CheckState.Checked;
		this.cb_cp2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.cb_cp2.Location = new System.Drawing.Point(640, 274);
		this.cb_cp2.Name = "cb_cp2";
		this.cb_cp2.Size = new System.Drawing.Size(138, 24);
		this.cb_cp2.TabIndex = 33;
		this.cb_cp2.Text = "CallProcessor 2";
		this.toolTip1.SetToolTip(this.cb_cp2, "“Call Processor 2” is used for cases when Cellular RF Verification uses different equipment than Cellular RF Calibration.\r\n");
		this.cb_cp2.UseVisualStyleBackColor = true;
		this.cb_cp2.Visible = false;
		this.cb_cp2.CheckedChanged += new System.EventHandler(cb_cp2_CheckedChanged);
		this.label11.AutoSize = true;
		this.label11.Location = new System.Drawing.Point(380, 112);
		this.label11.Name = "label11";
		this.label11.Size = new System.Drawing.Size(92, 13);
		this.label11.TabIndex = 29;
		this.label11.Tag = "";
		this.label11.Text = "User Defined DLL";
		this.toolTip1.SetToolTip(this.label11, "Specify the DLL used for GPIB/Visa/etc. communication with the box");
		this.label15.AutoSize = true;
		this.label15.Location = new System.Drawing.Point(236, 52);
		this.label15.Name = "label15";
		this.label15.Size = new System.Drawing.Size(31, 13);
		this.label15.TabIndex = 38;
		this.label15.Tag = "";
		this.label15.Text = "usrdll";
		this.toolTip1.SetToolTip(this.label15, "Specify the DLL used for GPIB/Visa/etc. communication with the box");
		this.pl_ps.Controls.Add(this.label9);
		this.pl_ps.Controls.Add(this.label8);
		this.pl_ps.Controls.Add(this.label7);
		this.pl_ps.Controls.Add(this.cb_ps_pad);
		this.pl_ps.Controls.Add(this.cb_ps_remote);
		this.pl_ps.Controls.Add(this.cb_ps_name);
		this.pl_ps.Location = new System.Drawing.Point(144, 11);
		this.pl_ps.Name = "pl_ps";
		this.pl_ps.Size = new System.Drawing.Size(439, 49);
		this.pl_ps.TabIndex = 25;
		this.cb_cp_lan.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_cp_lan.FormattingEnabled = true;
		this.cb_cp_lan.Location = new System.Drawing.Point(144, 127);
		this.cb_cp_lan.Name = "cb_cp_lan";
		this.cb_cp_lan.Size = new System.Drawing.Size(129, 21);
		this.cb_cp_lan.TabIndex = 26;
		this.cb_cp_board_id.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_cp_board_id.FormattingEnabled = true;
		this.cb_cp_board_id.Location = new System.Drawing.Point(292, 128);
		this.cb_cp_board_id.Name = "cb_cp_board_id";
		this.cb_cp_board_id.Size = new System.Drawing.Size(73, 21);
		this.cb_cp_board_id.TabIndex = 28;
		this.pl_tc.Controls.Add(this.label1);
		this.pl_tc.Controls.Add(this.label6);
		this.pl_tc.Controls.Add(this.label10);
		this.pl_tc.Controls.Add(this.cbd_tc_pad);
		this.pl_tc.Controls.Add(this.cbd_tc_rt);
		this.pl_tc.Controls.Add(this.cbd_tc_name);
		this.pl_tc.Location = new System.Drawing.Point(142, 162);
		this.pl_tc.Name = "pl_tc";
		this.pl_tc.Size = new System.Drawing.Size(439, 49);
		this.pl_tc.TabIndex = 31;
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(152, 4);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(39, 13);
		this.label1.TabIndex = 15;
		this.label1.Text = "remote";
		this.label6.AutoSize = true;
		this.label6.Location = new System.Drawing.Point(238, 6);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(25, 13);
		this.label6.TabIndex = 14;
		this.label6.Text = "pad";
		this.label10.AutoSize = true;
		this.label10.Location = new System.Drawing.Point(2, 4);
		this.label10.Name = "label10";
		this.label10.Size = new System.Drawing.Size(33, 13);
		this.label10.TabIndex = 13;
		this.label10.Text = "name";
		this.cbd_tc_pad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbd_tc_pad.FormattingEnabled = true;
		this.cbd_tc_pad.Location = new System.Drawing.Point(238, 20);
		this.cbd_tc_pad.Name = "cbd_tc_pad";
		this.cbd_tc_pad.Size = new System.Drawing.Size(51, 21);
		this.cbd_tc_pad.TabIndex = 4;
		this.cbd_tc_rt.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbd_tc_rt.FormattingEnabled = true;
		this.cbd_tc_rt.Location = new System.Drawing.Point(155, 21);
		this.cbd_tc_rt.Name = "cbd_tc_rt";
		this.cbd_tc_rt.Size = new System.Drawing.Size(62, 21);
		this.cbd_tc_rt.TabIndex = 3;
		this.cbd_tc_name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbd_tc_name.FormattingEnabled = true;
		this.cbd_tc_name.Location = new System.Drawing.Point(2, 21);
		this.cbd_tc_name.Name = "cbd_tc_name";
		this.cbd_tc_name.Size = new System.Drawing.Size(129, 21);
		this.cbd_tc_name.TabIndex = 2;
		this.cmb_cp2_name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmb_cp2_name.FormattingEnabled = true;
		this.cmb_cp2_name.Location = new System.Drawing.Point(3, 19);
		this.cmb_cp2_name.Name = "cmb_cp2_name";
		this.cmb_cp2_name.Size = new System.Drawing.Size(125, 21);
		this.cmb_cp2_name.TabIndex = 5;
		this.cmb_cp2_name.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.cmb_cp2_remote.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmb_cp2_remote.FormattingEnabled = true;
		this.cmb_cp2_remote.Location = new System.Drawing.Point(152, 19);
		this.cmb_cp2_remote.Name = "cmb_cp2_remote";
		this.cmb_cp2_remote.Size = new System.Drawing.Size(62, 21);
		this.cmb_cp2_remote.TabIndex = 6;
		this.cmb_cp2_remote.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.label12.AutoSize = true;
		this.label12.Location = new System.Drawing.Point(5, 4);
		this.label12.Name = "label12";
		this.label12.Size = new System.Drawing.Size(33, 13);
		this.label12.TabIndex = 13;
		this.label12.Text = "name";
		this.label13.AutoSize = true;
		this.label13.Location = new System.Drawing.Point(149, 3);
		this.label13.Name = "label13";
		this.label13.Size = new System.Drawing.Size(39, 13);
		this.label13.TabIndex = 15;
		this.label13.Text = "remote";
		this.pl_cp2_sad.Controls.Add(this.label14);
		this.pl_cp2_sad.Controls.Add(this.cmb_cp2_sad);
		this.pl_cp2_sad.Location = new System.Drawing.Point(308, 1);
		this.pl_cp2_sad.Name = "pl_cp2_sad";
		this.pl_cp2_sad.Size = new System.Drawing.Size(80, 48);
		this.pl_cp2_sad.TabIndex = 22;
		this.label14.AutoSize = true;
		this.label14.Location = new System.Drawing.Point(7, 3);
		this.label14.Name = "label14";
		this.label14.Size = new System.Drawing.Size(24, 13);
		this.label14.TabIndex = 17;
		this.label14.Text = "sad";
		this.cmb_cp2_sad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmb_cp2_sad.FormattingEnabled = true;
		this.cmb_cp2_sad.Location = new System.Drawing.Point(0, 18);
		this.cmb_cp2_sad.Name = "cmb_cp2_sad";
		this.cmb_cp2_sad.Size = new System.Drawing.Size(54, 21);
		this.cmb_cp2_sad.TabIndex = 8;
		this.pl_cp2_ip.Controls.Add(this.tb_cp2_ip);
		this.pl_cp2_ip.Controls.Add(this.lb_cp2_ip);
		this.pl_cp2_ip.Location = new System.Drawing.Point(388, 2);
		this.pl_cp2_ip.Name = "pl_cp2_ip";
		this.pl_cp2_ip.Size = new System.Drawing.Size(128, 46);
		this.pl_cp2_ip.TabIndex = 23;
		this.tb_cp2_ip.Location = new System.Drawing.Point(3, 18);
		this.tb_cp2_ip.Masked = System.Windows.Forms.Mask.IpAddress;
		this.tb_cp2_ip.Name = "tb_cp2_ip";
		this.tb_cp2_ip.Size = new System.Drawing.Size(94, 20);
		this.tb_cp2_ip.TabIndex = 9;
		this.lb_cp2_ip.AutoSize = true;
		this.lb_cp2_ip.Location = new System.Drawing.Point(3, 2);
		this.lb_cp2_ip.Name = "lb_cp2_ip";
		this.lb_cp2_ip.Size = new System.Drawing.Size(55, 13);
		this.lb_cp2_ip.TabIndex = 19;
		this.lb_cp2_ip.Text = "ip address";
		this.pl_cp2_pad.Controls.Add(this.label16);
		this.pl_cp2_pad.Controls.Add(this.cmb_cp2_pad);
		this.pl_cp2_pad.Location = new System.Drawing.Point(234, 1);
		this.pl_cp2_pad.Name = "pl_cp2_pad";
		this.pl_cp2_pad.Size = new System.Drawing.Size(72, 47);
		this.pl_cp2_pad.TabIndex = 24;
		this.label16.AutoSize = true;
		this.label16.Location = new System.Drawing.Point(2, 3);
		this.label16.Name = "label16";
		this.label16.Size = new System.Drawing.Size(25, 13);
		this.label16.TabIndex = 14;
		this.label16.Text = "pad";
		this.cmb_cp2_pad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmb_cp2_pad.FormattingEnabled = true;
		this.cmb_cp2_pad.Location = new System.Drawing.Point(1, 18);
		this.cmb_cp2_pad.Name = "cmb_cp2_pad";
		this.cmb_cp2_pad.Size = new System.Drawing.Size(51, 21);
		this.cmb_cp2_pad.TabIndex = 7;
		this.cmb_cp2_lan.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmb_cp2_lan.FormattingEnabled = true;
		this.cmb_cp2_lan.Location = new System.Drawing.Point(4, 67);
		this.cmb_cp2_lan.Name = "cmb_cp2_lan";
		this.cmb_cp2_lan.Size = new System.Drawing.Size(125, 21);
		this.cmb_cp2_lan.TabIndex = 26;
		this.label17.AutoSize = true;
		this.label17.Location = new System.Drawing.Point(6, 52);
		this.label17.Name = "label17";
		this.label17.Size = new System.Drawing.Size(51, 13);
		this.label17.TabIndex = 27;
		this.label17.Text = "language";
		this.cmb_cp2_bid.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cmb_cp2_bid.FormattingEnabled = true;
		this.cmb_cp2_bid.Location = new System.Drawing.Point(152, 67);
		this.cmb_cp2_bid.Name = "cmb_cp2_bid";
		this.cmb_cp2_bid.Size = new System.Drawing.Size(61, 21);
		this.cmb_cp2_bid.TabIndex = 28;
		this.lbboardid2.AutoSize = true;
		this.lbboardid2.Location = new System.Drawing.Point(148, 52);
		this.lbboardid2.Name = "lbboardid2";
		this.lbboardid2.Size = new System.Drawing.Size(48, 13);
		this.lbboardid2.TabIndex = 29;
		this.lbboardid2.Tag = "";
		this.lbboardid2.Text = "board_id";
		this.pl_cp2.Controls.Add(this.tb_cp2_dll);
		this.pl_cp2.Controls.Add(this.lbboardid2);
		this.pl_cp2.Controls.Add(this.btn_cp2_dll);
		this.pl_cp2.Controls.Add(this.label15);
		this.pl_cp2.Controls.Add(this.cmb_cp2_bid);
		this.pl_cp2.Controls.Add(this.label17);
		this.pl_cp2.Controls.Add(this.cmb_cp2_lan);
		this.pl_cp2.Controls.Add(this.pl_cp2_pad);
		this.pl_cp2.Controls.Add(this.pl_cp2_ip);
		this.pl_cp2.Controls.Add(this.pl_cp2_sad);
		this.pl_cp2.Controls.Add(this.label13);
		this.pl_cp2.Controls.Add(this.label12);
		this.pl_cp2.Controls.Add(this.cmb_cp2_remote);
		this.pl_cp2.Controls.Add(this.cmb_cp2_name);
		this.pl_cp2.Location = new System.Drawing.Point(637, 171);
		this.pl_cp2.Name = "pl_cp2";
		this.pl_cp2.Size = new System.Drawing.Size(519, 96);
		this.pl_cp2.TabIndex = 32;
		this.pl_cp2.Visible = false;
		this.tb_cp2_dll.Location = new System.Drawing.Point(234, 67);
		this.tb_cp2_dll.Name = "tb_cp2_dll";
		this.tb_cp2_dll.Size = new System.Drawing.Size(228, 20);
		this.tb_cp2_dll.TabIndex = 40;
		this.btn_cp2_dll.Location = new System.Drawing.Point(469, 65);
		this.btn_cp2_dll.Name = "btn_cp2_dll";
		this.btn_cp2_dll.Size = new System.Drawing.Size(24, 23);
		this.btn_cp2_dll.TabIndex = 39;
		this.btn_cp2_dll.Text = "...";
		this.btn_cp2_dll.UseVisualStyleBackColor = true;
		this.btn_cp2_dll.Click += new System.EventHandler(btn_cp2_dll_Click);
		this.lbl_Annotation.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
		this.lbl_Annotation.Dock = System.Windows.Forms.DockStyle.Fill;
		this.lbl_Annotation.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lbl_Annotation.Location = new System.Drawing.Point(0, 0);
		this.lbl_Annotation.Name = "lbl_Annotation";
		this.lbl_Annotation.Size = new System.Drawing.Size(640, 132);
		this.lbl_Annotation.TabIndex = 34;
		this.lbl_Annotation.Text = "lbl_Annotation";
		this.panel1.Controls.Add(this.lbl_Annotation);
		this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
		this.panel1.Location = new System.Drawing.Point(0, 319);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(640, 132);
		this.panel1.TabIndex = 35;
		this.btn_cp1_dll.Location = new System.Drawing.Point(613, 125);
		this.btn_cp1_dll.Name = "btn_cp1_dll";
		this.btn_cp1_dll.Size = new System.Drawing.Size(24, 23);
		this.btn_cp1_dll.TabIndex = 36;
		this.btn_cp1_dll.Text = "...";
		this.btn_cp1_dll.UseVisualStyleBackColor = true;
		this.btn_cp1_dll.Click += new System.EventHandler(btn_cp1_dll_Click);
		this.tb_cp1_dll.Location = new System.Drawing.Point(380, 128);
		this.tb_cp1_dll.Name = "tb_cp1_dll";
		this.tb_cp1_dll.ReadOnly = true;
		this.tb_cp1_dll.Size = new System.Drawing.Size(223, 20);
		this.tb_cp1_dll.TabIndex = 37;
		this.errorProvider1.ContainerControl = this;
		this.plVisa.Controls.Add(this.tb_cp_visa);
		this.plVisa.Controls.Add(this.lbVisaString);
		this.plVisa.Location = new System.Drawing.Point(378, 62);
		this.plVisa.Name = "plVisa";
		this.plVisa.Size = new System.Drawing.Size(262, 49);
		this.plVisa.TabIndex = 38;
		this.plVisa.Visible = false;
		this.lbVisaString.AutoSize = true;
		this.lbVisaString.Location = new System.Drawing.Point(2, 1);
		this.lbVisaString.Name = "lbVisaString";
		this.lbVisaString.Size = new System.Drawing.Size(96, 13);
		this.lbVisaString.TabIndex = 21;
		this.lbVisaString.Text = "visa connect string";
		this.tb_cp_visa.Location = new System.Drawing.Point(5, 19);
		this.tb_cp_visa.Name = "tb_cp_visa";
		this.tb_cp_visa.Size = new System.Drawing.Size(220, 20);
		this.tb_cp_visa.TabIndex = 22;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.Controls.Add(this.plVisa);
		base.Controls.Add(this.tb_cp1_dll);
		base.Controls.Add(this.btn_cp1_dll);
		base.Controls.Add(this.panel1);
		base.Controls.Add(this.cb_cp2);
		base.Controls.Add(this.pl_cp2);
		base.Controls.Add(this.pl_tc);
		base.Controls.Add(this.cbTC);
		base.Controls.Add(this.label11);
		base.Controls.Add(this.lbboardid);
		base.Controls.Add(this.cb_cp_board_id);
		base.Controls.Add(this.lbLan);
		base.Controls.Add(this.cb_cp_lan);
		base.Controls.Add(this.pl_ps);
		base.Controls.Add(this.pl_pad);
		base.Controls.Add(this.pl_ip);
		base.Controls.Add(this.pl_sad);
		base.Controls.Add(this.cb_ps);
		base.Controls.Add(this.label3);
		base.Controls.Add(this.label2);
		base.Controls.Add(this.cb_cp_remote);
		base.Controls.Add(this.cb_cp_name);
		base.Controls.Add(this.lb_cp);
		base.Name = "RFCalVerifyPanel";
		base.Size = new System.Drawing.Size(640, 451);
		base.Load += new System.EventHandler(RFCalVerifyPanel_Load);
		this.pl_sad.ResumeLayout(false);
		this.pl_sad.PerformLayout();
		this.pl_ip.ResumeLayout(false);
		this.pl_ip.PerformLayout();
		this.pl_pad.ResumeLayout(false);
		this.pl_pad.PerformLayout();
		this.pl_ps.ResumeLayout(false);
		this.pl_ps.PerformLayout();
		this.pl_tc.ResumeLayout(false);
		this.pl_tc.PerformLayout();
		this.pl_cp2_sad.ResumeLayout(false);
		this.pl_cp2_sad.PerformLayout();
		this.pl_cp2_ip.ResumeLayout(false);
		this.pl_cp2_ip.PerformLayout();
		this.pl_cp2_pad.ResumeLayout(false);
		this.pl_cp2_pad.PerformLayout();
		this.pl_cp2.ResumeLayout(false);
		this.pl_cp2.PerformLayout();
		this.panel1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.errorProvider1).EndInit();
		this.plVisa.ResumeLayout(false);
		this.plVisa.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
