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 RFStationCalSGPMPanel : UserControl
{
	public delegate void TargetFileChangedEventHandler(string targetfile);

	public const string GPIB = "GPIB";

	public const string IP = "IP";

	public const string VISA = "VISA";

	private const int MAX_GPIB_ADDRESS = 30;

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

	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> sglist = new Dictionary<string, string>();

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

	private Dictionary<string, string> linkNameCPSG = 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 bool use_sg;

	private string name_sg;

	private string remote_sg;

	private string pad_sg;

	private string sad_sg;

	private string ip_sg;

	private bool use_pm;

	private string name_pm;

	private string remote_pm;

	private string pad_pm;

	private string sad_pm;

	private string ip_pm;

	private IContainer components;

	private Panel pl_pad;

	public Label label4;

	public ComboBox cb_cp_pad;

	private Panel pl_ip;

	public CustomizedTextBox tb_cp_ip;

	public Label lb_cp_ip;

	private Panel pl_sad;

	public Label label5;

	public ComboBox cb_cp_sad;

	public CheckBox cb_ps;

	public Label label3;

	public Label label8;

	public Label label9;

	public Label label7;

	public Label label2;

	public ComboBox cb_ps_pad;

	public ComboBox cb_ps_remote;

	public ComboBox cb_ps_name;

	public ComboBox cb_cp_remote;

	public ComboBox cb_cp_name;

	public Label lb_cp;

	public ComboBox cb_sg_name;

	public ComboBox cb_sg_remote;

	public Label label10;

	public Label label11;

	private Panel pl_sad_sg;

	public Label label12;

	public ComboBox cb_sg_sad;

	private Panel pl_ip_sg;

	public CustomizedTextBox tb_sg_ip;

	public Label lb_sg_ip;

	private Panel pl_pad_sg;

	public Label label14;

	public ComboBox cb_sg_pad;

	public ComboBox cb_pm_name;

	public ComboBox cb_pm_remote;

	public Label label16;

	public Label label17;

	private Panel pl_sad_pm;

	public Label label18;

	public ComboBox cb_pm_sad;

	private Panel pl_ip_pm;

	public CustomizedTextBox tb_pm_ip;

	public Label lb_pm_ip;

	private Panel pl_pad_pm;

	public Label label20;

	public ComboBox cb_pm_pad;

	private ToolTip toolTip1;

	private Panel pl_ps;

	private CheckBox cb_sg;

	private Panel pl_sg;

	public CheckBox cb_pm;

	private Panel pl_pm;

	private ErrorProvider errorProvider1;

	private Panel plVisa;

	private TextBox tb_cp_visa;

	public Label lbVisaString;

	public Label lbLan;

	public ComboBox cb_cp_lan;

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

	public string TargetFile
	{
		get
		{
			return target_file;
		}
		set
		{
			target_file = 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;
		}
	}

	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 bool UseSG
	{
		get
		{
			return use_sg;
		}
		set
		{
			use_sg = value;
		}
	}

	public string NameSG
	{
		get
		{
			return name_sg;
		}
		set
		{
			name_sg = value;
		}
	}

	public string RemoteSG
	{
		get
		{
			return remote_sg;
		}
		set
		{
			remote_sg = value;
		}
	}

	public string PadSG
	{
		get
		{
			return pad_sg;
		}
		set
		{
			pad_sg = value;
		}
	}

	public string SadSG
	{
		get
		{
			return sad_sg;
		}
		set
		{
			sad_sg = value;
		}
	}

	public string IpSG
	{
		get
		{
			return ip_sg;
		}
		set
		{
			ip_sg = value;
		}
	}

	public bool UsePM
	{
		get
		{
			return use_pm;
		}
		set
		{
			use_pm = value;
		}
	}

	public string NamePM
	{
		get
		{
			return name_pm;
		}
		set
		{
			name_pm = value;
		}
	}

	public string RemotePM
	{
		get
		{
			return remote_pm;
		}
		set
		{
			remote_pm = value;
		}
	}

	public string PadPM
	{
		get
		{
			return pad_pm;
		}
		set
		{
			pad_pm = value;
		}
	}

	public string SadPM
	{
		get
		{
			return sad_pm;
		}
		set
		{
			sad_pm = value;
		}
	}

	public string IpPM
	{
		get
		{
			return ip_pm;
		}
		set
		{
			ip_pm = value;
		}
	}

	public event TargetFileChangedEventHandler TargetFileChanged;

	public RFStationCalSGPMPanel(RootConfig cfg, int currentDUT)
	{
		InitializeComponent();
		InitVar(cfg, currentDUT);
		InitControls();
		InitProperty();
	}

	private void InitVar(RootConfig cfg, int currentDUT)
	{
		pslist.Clear();
		cplist.Clear();
		cplistInvert.Clear();
		sglist.Clear();
		pmlist.Clear();
		linkNameCPSG.Clear();
		max_dut = 1;
		int.TryParse(cfg.DUTs, out max_dut);
		cur_dut = currentDUT;
		bool.TryParse(cfg.BlankWhenNull, out bLoadDefault);
		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 "StationCalSG":
			{
				InfoItem[] infoItem9 = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem10 in infoItem9)
				{
					sglist.Add(infoItem10.Name, infoItem10.Value);
				}
				break;
			}
			case "PM":
			{
				InfoItem[] infoItem5 = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem6 in infoItem5)
				{
					pmlist.Add(infoItem6.Name, infoItem6.Value);
				}
				break;
			}
			case "LinkCPSG":
			{
				InfoItem[] infoItem = rootConfigAllInstList.InfoItem;
				foreach (InfoItem infoItem2 in infoItem)
				{
					linkNameCPSG.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()
	{
		cb_ps_pad.Items.Clear();
		cb_cp_pad.Items.Clear();
		cb_cp_sad.Items.Clear();
		cb_sg_pad.Items.Clear();
		cb_sg_sad.Items.Clear();
		cb_pm_pad.Items.Clear();
		cb_pm_sad.Items.Clear();
		cb_ps_name.Items.Clear();
		cb_cp_name.Items.Clear();
		cb_sg_name.Items.Clear();
		cb_pm_name.Items.Clear();
		cb_cp_remote.Items.Clear();
		cb_sg_remote.Items.Clear();
		cb_pm_remote.Items.Clear();
		cb_ps_remote.Items.Clear();
		cb_cp_lan.Items.Clear();
		List<string> list = new List<string>();
		for (int i = 1; i <= 30; i++)
		{
			list.Add(i.ToString());
		}
		cb_ps_pad.Items.AddRange(list.ToArray());
		cb_cp_pad.Items.AddRange(list.ToArray());
		cb_cp_sad.Items.AddRange(list.ToArray());
		cb_sg_pad.Items.AddRange(list.ToArray());
		cb_sg_sad.Items.AddRange(list.ToArray());
		cb_pm_pad.Items.AddRange(list.ToArray());
		cb_pm_sad.Items.AddRange(list.ToArray());
		cb_ps_name.Items.AddRange(pslist.Keys.ToArray());
		cb_cp_name.Items.AddRange(cplist.Keys.ToArray());
		cb_sg_name.Items.AddRange(sglist.Keys.ToArray());
		cb_pm_name.Items.AddRange(pmlist.Keys.ToArray());
		cb_cp_remote.Items.AddRange(new string[3] { "GPIB", "IP", "VISA" });
		cb_sg_remote.Items.AddRange(new string[2] { "GPIB", "IP" });
		cb_pm_remote.Items.AddRange(new string[2] { "GPIB", "IP" });
		cb_ps_remote.Items.AddRange(new string[1] { "GPIB" });
		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");
		tb_sg_ip.Tag = new Tip(tb_sg_ip, lb_sg_ip, toolTip1, Tip.TxtContent.IP_ADDRESS, "ip address", "SG ip address", "IP address error, Example: 192.168.0.1");
		tb_pm_ip.Tag = new Tip(tb_pm_ip, lb_pm_ip, toolTip1, Tip.TxtContent.IP_ADDRESS, "ip address", "PM ip address", "IP address error, Example: 192.168.0.1");
	}

	private void InitProperty()
	{
		UsePS = false;
		UseSG = false;
		UsePM = 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);
					break;
				case "Signal_Generator10":
					UseSG = true;
					NameSG = item.Name;
					PadSG = item.Pad;
					SadSG = item.Sad;
					IpSG = item.Ip;
					break;
				case "Power_Meter1":
					UsePM = true;
					NamePM = item.Name;
					PadPM = item.Pad;
					SadPM = item.Sad;
					IpPM = item.Ip;
					break;
				}
			}
		}
		if (!string.IsNullOrEmpty(IpCP))
		{
			RemoteCP = "IP";
		}
		else if (!string.IsNullOrEmpty(PadCP))
		{
			RemoteCP = "GPIB";
		}
		else if (!string.IsNullOrEmpty(VisaCP))
		{
			RemoteCP = "VISA";
		}
		if (!string.IsNullOrEmpty(IpSG))
		{
			RemoteSG = "IP";
		}
		else if (!string.IsNullOrEmpty(PadSG))
		{
			RemoteSG = "GPIB";
		}
		if (!string.IsNullOrEmpty(IpPM))
		{
			RemotePM = "IP";
		}
		else if (!string.IsNullOrEmpty(PadPM))
		{
			RemotePM = "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 RFSationCalSGPMPanel_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();
		tb_cp_ip.DataBindings.Clear();
		tb_cp_visa.DataBindings.Clear();
		cb_cp_lan.DataBindings.Clear();
		cb_sg.DataBindings.Clear();
		cb_sg_name.DataBindings.Clear();
		cb_sg_pad.DataBindings.Clear();
		cb_sg_remote.DataBindings.Clear();
		cb_sg_sad.DataBindings.Clear();
		tb_sg_ip.DataBindings.Clear();
		cb_pm.DataBindings.Clear();
		cb_pm_name.DataBindings.Clear();
		cb_pm_pad.DataBindings.Clear();
		cb_pm_remote.DataBindings.Clear();
		cb_pm_sad.DataBindings.Clear();
		tb_pm_ip.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"));
		tb_cp_ip.DataBindings.Add(new Binding("Text", this, "IpCP"));
		tb_cp_visa.DataBindings.Add(new Binding("Text", this, "VisaCP"));
		cb_cp_lan.DataBindings.Add(new Binding("Text", this, "LanCP"));
		cb_sg.DataBindings.Add(new Binding("Checked", this, "UseSG"));
		cb_sg_name.DataBindings.Add(new Binding("Text", this, "NameSG"));
		cb_sg_pad.DataBindings.Add(new Binding("Text", this, "PadSG"));
		cb_sg_remote.DataBindings.Add(new Binding("Text", this, "RemoteSG"));
		cb_sg_sad.DataBindings.Add(new Binding("Text", this, "SadSG"));
		tb_sg_ip.DataBindings.Add(new Binding("Text", this, "IpSG"));
		cb_pm.DataBindings.Add(new Binding("Checked", this, "UsePM"));
		cb_pm_name.DataBindings.Add(new Binding("Text", this, "NamePM"));
		cb_pm_pad.DataBindings.Add(new Binding("Text", this, "PadPM"));
		cb_pm_remote.DataBindings.Add(new Binding("Text", this, "RemotePM"));
		cb_pm_sad.DataBindings.Add(new Binding("Text", this, "SadPM"));
		tb_pm_ip.DataBindings.Add(new Binding("Text", this, "IpPM"));
	}

	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);
			}
			InstConfig instConfig2 = new InstConfig();
			instConfig2.Identifier = "Call_Processor1";
			instConfig2.Type = "CP";
			instConfig2.Name = cplist[NameCP];
			if (RemoteCP == "IP")
			{
				instConfig2.Ip = IpCP;
			}
			else if (RemoteCP == "GPIB")
			{
				instConfig2.Pad = PadCP;
				if (NameCP == "R&S CMU")
				{
					instConfig2.Sad = SadCP;
				}
			}
			else
			{
				instConfig2.Visa = VisaCP;
			}
			if (LanCP != "0(Default)")
			{
				instConfig2.Language = LanCP;
			}
			es.Equipment.Add(instConfig2);
			if (linkNameCPSG.Keys.Contains(NameCP))
			{
				InstConfig instConfig3 = new InstConfig();
				instConfig3.Identifier = "Signal_Generator4";
				instConfig3.Type = "DSG";
				instConfig3.Name = linkNameCPSG[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;
				}
				es.Equipment.Add(instConfig3);
			}
			if (UseSG)
			{
				InstConfig instConfig4 = new InstConfig();
				instConfig4.Identifier = "Signal_Generator10";
				switch (NameSG)
				{
				case "IFR 20XX":
				case "Agilent PSG":
				case "SMA":
					instConfig4.Type = "ASG";
					break;
				case "RS SMIQ":
				case "SMU Chan1":
				case "RS SMBV":
					instConfig4.Type = "DSG";
					break;
				default:
					MessageBox.Show("Not define ASG or DSG for " + NameSG);
					break;
				}
				instConfig4.Name = NameSG;
				if (RemoteSG == "IP")
				{
					instConfig4.Ip = IpSG;
				}
				else
				{
					instConfig4.Pad = PadSG;
					if (NameSG == "R&S CMU")
					{
						instConfig4.Sad = SadSG;
					}
				}
				es.Equipment.Add(instConfig4);
			}
			if (UsePM)
			{
				InstConfig instConfig5 = new InstConfig();
				instConfig5.Identifier = "Power_Meter1";
				instConfig5.Type = "PM";
				instConfig5.Name = NamePM;
				if (RemotePM == "IP")
				{
					instConfig5.Ip = IpPM;
				}
				else
				{
					instConfig5.Pad = PadPM;
					if (NamePM == "R&S CMU")
					{
						instConfig5.Sad = SadPM;
					}
				}
				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 UpdateUI(object sender, EventArgs e)
	{
		if (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 (cb_cp_remote.Text == "IP")
		{
			pl_pad.Visible = false;
			pl_sad.Visible = false;
			pl_ip.Visible = true;
			plVisa.Visible = false;
		}
		else if (cb_cp_remote.Text == "GPIB")
		{
			pl_ip.Visible = false;
			pl_pad.Visible = true;
			plVisa.Visible = false;
		}
		else
		{
			plVisa.Visible = true;
			pl_pad.Visible = false;
			pl_sad.Visible = false;
			pl_ip.Visible = false;
		}
		if (cb_sg_remote.Text == "IP")
		{
			pl_pad_sg.Visible = false;
			pl_ip_sg.Visible = true;
		}
		else
		{
			pl_ip_sg.Visible = false;
			pl_pad_sg.Visible = true;
		}
		if (cb_pm_remote.Text == "IP")
		{
			pl_pad_pm.Visible = false;
			pl_ip_pm.Visible = true;
		}
		else
		{
			pl_ip_pm.Visible = false;
			pl_pad_pm.Visible = true;
		}
	}

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

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

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

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

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

	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.pl_pad = new System.Windows.Forms.Panel();
		this.label4 = new System.Windows.Forms.Label();
		this.cb_cp_pad = new System.Windows.Forms.ComboBox();
		this.pl_ip = new System.Windows.Forms.Panel();
		this.tb_cp_ip = new System.Windows.Forms.CustomizedTextBox();
		this.lb_cp_ip = new System.Windows.Forms.Label();
		this.pl_sad = new System.Windows.Forms.Panel();
		this.label5 = new System.Windows.Forms.Label();
		this.cb_cp_sad = new System.Windows.Forms.ComboBox();
		this.cb_ps = new System.Windows.Forms.CheckBox();
		this.label3 = new System.Windows.Forms.Label();
		this.label8 = new System.Windows.Forms.Label();
		this.label9 = new System.Windows.Forms.Label();
		this.label7 = new System.Windows.Forms.Label();
		this.label2 = new System.Windows.Forms.Label();
		this.cb_ps_pad = new System.Windows.Forms.ComboBox();
		this.cb_ps_remote = new System.Windows.Forms.ComboBox();
		this.cb_ps_name = new System.Windows.Forms.ComboBox();
		this.cb_cp_remote = new System.Windows.Forms.ComboBox();
		this.cb_cp_name = new System.Windows.Forms.ComboBox();
		this.lb_cp = new System.Windows.Forms.Label();
		this.cb_sg_name = new System.Windows.Forms.ComboBox();
		this.cb_sg_remote = new System.Windows.Forms.ComboBox();
		this.label10 = new System.Windows.Forms.Label();
		this.label11 = new System.Windows.Forms.Label();
		this.pl_sad_sg = new System.Windows.Forms.Panel();
		this.label12 = new System.Windows.Forms.Label();
		this.cb_sg_sad = new System.Windows.Forms.ComboBox();
		this.pl_ip_sg = new System.Windows.Forms.Panel();
		this.tb_sg_ip = new System.Windows.Forms.CustomizedTextBox();
		this.lb_sg_ip = new System.Windows.Forms.Label();
		this.pl_pad_sg = new System.Windows.Forms.Panel();
		this.label14 = new System.Windows.Forms.Label();
		this.cb_sg_pad = new System.Windows.Forms.ComboBox();
		this.cb_pm_name = new System.Windows.Forms.ComboBox();
		this.cb_pm_remote = new System.Windows.Forms.ComboBox();
		this.label16 = new System.Windows.Forms.Label();
		this.label17 = new System.Windows.Forms.Label();
		this.pl_sad_pm = new System.Windows.Forms.Panel();
		this.label18 = new System.Windows.Forms.Label();
		this.cb_pm_sad = new System.Windows.Forms.ComboBox();
		this.pl_ip_pm = new System.Windows.Forms.Panel();
		this.tb_pm_ip = new System.Windows.Forms.CustomizedTextBox();
		this.lb_pm_ip = new System.Windows.Forms.Label();
		this.pl_pad_pm = new System.Windows.Forms.Panel();
		this.label20 = new System.Windows.Forms.Label();
		this.cb_pm_pad = new System.Windows.Forms.ComboBox();
		this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
		this.cb_sg = new System.Windows.Forms.CheckBox();
		this.cb_pm = new System.Windows.Forms.CheckBox();
		this.pl_ps = new System.Windows.Forms.Panel();
		this.pl_sg = new System.Windows.Forms.Panel();
		this.pl_pm = new System.Windows.Forms.Panel();
		this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
		this.plVisa = new System.Windows.Forms.Panel();
		this.tb_cp_visa = new System.Windows.Forms.TextBox();
		this.lbVisaString = new System.Windows.Forms.Label();
		this.lbLan = new System.Windows.Forms.Label();
		this.cb_cp_lan = new System.Windows.Forms.ComboBox();
		this.pl_pad.SuspendLayout();
		this.pl_ip.SuspendLayout();
		this.pl_sad.SuspendLayout();
		this.pl_sad_sg.SuspendLayout();
		this.pl_ip_sg.SuspendLayout();
		this.pl_pad_sg.SuspendLayout();
		this.pl_sad_pm.SuspendLayout();
		this.pl_ip_pm.SuspendLayout();
		this.pl_pad_pm.SuspendLayout();
		this.pl_ps.SuspendLayout();
		this.pl_sg.SuspendLayout();
		this.pl_pm.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.errorProvider1).BeginInit();
		this.plVisa.SuspendLayout();
		base.SuspendLayout();
		this.pl_pad.Controls.Add(this.label4);
		this.pl_pad.Controls.Add(this.cb_cp_pad);
		this.pl_pad.Location = new System.Drawing.Point(398, 62);
		this.pl_pad.Name = "pl_pad";
		this.pl_pad.Size = new System.Drawing.Size(73, 47);
		this.pl_pad.TabIndex = 39;
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(3, 3);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(25, 13);
		this.label4.TabIndex = 14;
		this.label4.Text = "pad";
		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(0, 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.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(549, 63);
		this.pl_ip.Name = "pl_ip";
		this.pl_ip.Size = new System.Drawing.Size(109, 46);
		this.pl_ip.TabIndex = 38;
		this.tb_cp_ip.Location = new System.Drawing.Point(1, 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(80, 20);
		this.tb_cp_ip.TabIndex = 9;
		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.pl_sad.Controls.Add(this.label5);
		this.pl_sad.Controls.Add(this.cb_cp_sad);
		this.pl_sad.Location = new System.Drawing.Point(471, 62);
		this.pl_sad.Name = "pl_sad";
		this.pl_sad.Size = new System.Drawing.Size(78, 48);
		this.pl_sad.TabIndex = 37;
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(5, 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.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, 36);
		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.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(325, 65);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(39, 13);
		this.label3.TabIndex = 34;
		this.label3.Text = "remote";
		this.label8.AutoSize = true;
		this.label8.Location = new System.Drawing.Point(249, 3);
		this.label8.Name = "label8";
		this.label8.Size = new System.Drawing.Size(25, 13);
		this.label8.TabIndex = 33;
		this.label8.Text = "pad";
		this.label9.AutoSize = true;
		this.label9.Location = new System.Drawing.Point(171, 4);
		this.label9.Name = "label9";
		this.label9.Size = new System.Drawing.Size(39, 13);
		this.label9.TabIndex = 35;
		this.label9.Text = "remote";
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(4, 3);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(33, 13);
		this.label7.TabIndex = 32;
		this.label7.Text = "name";
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(158, 65);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(33, 13);
		this.label2.TabIndex = 31;
		this.label2.Text = "name";
		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(246, 19);
		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.cb_ps_remote.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_ps_remote.FormattingEnabled = true;
		this.cb_ps_remote.Location = new System.Drawing.Point(168, 20);
		this.cb_ps_remote.Name = "cb_ps_remote";
		this.cb_ps_remote.Size = new System.Drawing.Size(56, 21);
		this.cb_ps_remote.TabIndex = 3;
		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(5, 20);
		this.cb_ps_name.Name = "cb_ps_name";
		this.cb_ps_name.Size = new System.Drawing.Size(136, 21);
		this.cb_ps_name.TabIndex = 2;
		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(322, 80);
		this.cb_cp_remote.Name = "cb_cp_remote";
		this.cb_cp_remote.Size = new System.Drawing.Size(56, 21);
		this.cb_cp_remote.TabIndex = 6;
		this.cb_cp_remote.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		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(159, 80);
		this.cb_cp_name.Name = "cb_cp_name";
		this.cb_cp_name.Size = new System.Drawing.Size(135, 21);
		this.cb_cp_name.TabIndex = 5;
		this.cb_cp_name.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		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(17, 81);
		this.lb_cp.Name = "lb_cp";
		this.lb_cp.Size = new System.Drawing.Size(110, 20);
		this.lb_cp.TabIndex = 25;
		this.lb_cp.Text = "Call Processor";
		this.cb_sg_name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_sg_name.FormattingEnabled = true;
		this.cb_sg_name.Location = new System.Drawing.Point(4, 21);
		this.cb_sg_name.Name = "cb_sg_name";
		this.cb_sg_name.Size = new System.Drawing.Size(135, 21);
		this.cb_sg_name.TabIndex = 10;
		this.cb_sg_name.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.cb_sg_remote.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_sg_remote.FormattingEnabled = true;
		this.cb_sg_remote.Location = new System.Drawing.Point(167, 21);
		this.cb_sg_remote.Name = "cb_sg_remote";
		this.cb_sg_remote.Size = new System.Drawing.Size(56, 21);
		this.cb_sg_remote.TabIndex = 11;
		this.cb_sg_remote.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.label10.AutoSize = true;
		this.label10.Location = new System.Drawing.Point(3, 6);
		this.label10.Name = "label10";
		this.label10.Size = new System.Drawing.Size(33, 13);
		this.label10.TabIndex = 31;
		this.label10.Text = "name";
		this.label11.AutoSize = true;
		this.label11.Location = new System.Drawing.Point(170, 4);
		this.label11.Name = "label11";
		this.label11.Size = new System.Drawing.Size(39, 13);
		this.label11.TabIndex = 34;
		this.label11.Text = "remote";
		this.pl_sad_sg.Controls.Add(this.label12);
		this.pl_sad_sg.Controls.Add(this.cb_sg_sad);
		this.pl_sad_sg.Location = new System.Drawing.Point(318, 1);
		this.pl_sad_sg.Name = "pl_sad_sg";
		this.pl_sad_sg.Size = new System.Drawing.Size(78, 48);
		this.pl_sad_sg.TabIndex = 37;
		this.pl_sad_sg.Visible = false;
		this.label12.AutoSize = true;
		this.label12.Location = new System.Drawing.Point(6, 3);
		this.label12.Name = "label12";
		this.label12.Size = new System.Drawing.Size(24, 13);
		this.label12.TabIndex = 17;
		this.label12.Text = "sad";
		this.cb_sg_sad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_sg_sad.FormattingEnabled = true;
		this.cb_sg_sad.Location = new System.Drawing.Point(0, 18);
		this.cb_sg_sad.Name = "cb_sg_sad";
		this.cb_sg_sad.Size = new System.Drawing.Size(54, 21);
		this.cb_sg_sad.TabIndex = 13;
		this.pl_ip_sg.Controls.Add(this.tb_sg_ip);
		this.pl_ip_sg.Controls.Add(this.lb_sg_ip);
		this.pl_ip_sg.Location = new System.Drawing.Point(394, 4);
		this.pl_ip_sg.Name = "pl_ip_sg";
		this.pl_ip_sg.Size = new System.Drawing.Size(109, 46);
		this.pl_ip_sg.TabIndex = 38;
		this.tb_sg_ip.Location = new System.Drawing.Point(1, 18);
		this.tb_sg_ip.Masked = System.Windows.Forms.Mask.IpAddress;
		this.tb_sg_ip.Name = "tb_sg_ip";
		this.tb_sg_ip.Size = new System.Drawing.Size(80, 20);
		this.tb_sg_ip.TabIndex = 14;
		this.lb_sg_ip.AutoSize = true;
		this.lb_sg_ip.Location = new System.Drawing.Point(3, 2);
		this.lb_sg_ip.Name = "lb_sg_ip";
		this.lb_sg_ip.Size = new System.Drawing.Size(55, 13);
		this.lb_sg_ip.TabIndex = 19;
		this.lb_sg_ip.Text = "ip address";
		this.pl_pad_sg.Controls.Add(this.label14);
		this.pl_pad_sg.Controls.Add(this.cb_sg_pad);
		this.pl_pad_sg.Location = new System.Drawing.Point(243, 3);
		this.pl_pad_sg.Name = "pl_pad_sg";
		this.pl_pad_sg.Size = new System.Drawing.Size(73, 47);
		this.pl_pad_sg.TabIndex = 39;
		this.label14.AutoSize = true;
		this.label14.Location = new System.Drawing.Point(3, 3);
		this.label14.Name = "label14";
		this.label14.Size = new System.Drawing.Size(25, 13);
		this.label14.TabIndex = 14;
		this.label14.Text = "pad";
		this.cb_sg_pad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_sg_pad.FormattingEnabled = true;
		this.cb_sg_pad.Location = new System.Drawing.Point(0, 18);
		this.cb_sg_pad.Name = "cb_sg_pad";
		this.cb_sg_pad.Size = new System.Drawing.Size(51, 21);
		this.cb_sg_pad.TabIndex = 12;
		this.cb_pm_name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_pm_name.FormattingEnabled = true;
		this.cb_pm_name.Location = new System.Drawing.Point(4, 20);
		this.cb_pm_name.Name = "cb_pm_name";
		this.cb_pm_name.Size = new System.Drawing.Size(135, 21);
		this.cb_pm_name.TabIndex = 15;
		this.cb_pm_name.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.cb_pm_remote.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_pm_remote.FormattingEnabled = true;
		this.cb_pm_remote.Location = new System.Drawing.Point(167, 20);
		this.cb_pm_remote.Name = "cb_pm_remote";
		this.cb_pm_remote.Size = new System.Drawing.Size(56, 21);
		this.cb_pm_remote.TabIndex = 16;
		this.cb_pm_remote.SelectedIndexChanged += new System.EventHandler(UpdateUI);
		this.label16.AutoSize = true;
		this.label16.Location = new System.Drawing.Point(3, 5);
		this.label16.Name = "label16";
		this.label16.Size = new System.Drawing.Size(33, 13);
		this.label16.TabIndex = 31;
		this.label16.Text = "name";
		this.label17.AutoSize = true;
		this.label17.Location = new System.Drawing.Point(170, 4);
		this.label17.Name = "label17";
		this.label17.Size = new System.Drawing.Size(39, 13);
		this.label17.TabIndex = 34;
		this.label17.Text = "remote";
		this.pl_sad_pm.Controls.Add(this.label18);
		this.pl_sad_pm.Controls.Add(this.cb_pm_sad);
		this.pl_sad_pm.Location = new System.Drawing.Point(316, 2);
		this.pl_sad_pm.Name = "pl_sad_pm";
		this.pl_sad_pm.Size = new System.Drawing.Size(78, 48);
		this.pl_sad_pm.TabIndex = 37;
		this.pl_sad_pm.Visible = false;
		this.label18.AutoSize = true;
		this.label18.Location = new System.Drawing.Point(6, 3);
		this.label18.Name = "label18";
		this.label18.Size = new System.Drawing.Size(24, 13);
		this.label18.TabIndex = 17;
		this.label18.Text = "sad";
		this.cb_pm_sad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_pm_sad.FormattingEnabled = true;
		this.cb_pm_sad.Location = new System.Drawing.Point(0, 18);
		this.cb_pm_sad.Name = "cb_pm_sad";
		this.cb_pm_sad.Size = new System.Drawing.Size(54, 21);
		this.cb_pm_sad.TabIndex = 18;
		this.pl_ip_pm.Controls.Add(this.tb_pm_ip);
		this.pl_ip_pm.Controls.Add(this.lb_pm_ip);
		this.pl_ip_pm.Location = new System.Drawing.Point(394, 3);
		this.pl_ip_pm.Name = "pl_ip_pm";
		this.pl_ip_pm.Size = new System.Drawing.Size(109, 46);
		this.pl_ip_pm.TabIndex = 38;
		this.tb_pm_ip.Location = new System.Drawing.Point(1, 18);
		this.tb_pm_ip.Masked = System.Windows.Forms.Mask.IpAddress;
		this.tb_pm_ip.Name = "tb_pm_ip";
		this.tb_pm_ip.Size = new System.Drawing.Size(80, 20);
		this.tb_pm_ip.TabIndex = 19;
		this.lb_pm_ip.AutoSize = true;
		this.lb_pm_ip.Location = new System.Drawing.Point(3, 2);
		this.lb_pm_ip.Name = "lb_pm_ip";
		this.lb_pm_ip.Size = new System.Drawing.Size(55, 13);
		this.lb_pm_ip.TabIndex = 19;
		this.lb_pm_ip.Text = "ip address";
		this.pl_pad_pm.Controls.Add(this.label20);
		this.pl_pad_pm.Controls.Add(this.cb_pm_pad);
		this.pl_pad_pm.Location = new System.Drawing.Point(243, 2);
		this.pl_pad_pm.Name = "pl_pad_pm";
		this.pl_pad_pm.Size = new System.Drawing.Size(73, 47);
		this.pl_pad_pm.TabIndex = 39;
		this.label20.AutoSize = true;
		this.label20.Location = new System.Drawing.Point(3, 3);
		this.label20.Name = "label20";
		this.label20.Size = new System.Drawing.Size(25, 13);
		this.label20.TabIndex = 14;
		this.label20.Text = "pad";
		this.cb_pm_pad.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cb_pm_pad.FormattingEnabled = true;
		this.cb_pm_pad.Location = new System.Drawing.Point(0, 18);
		this.cb_pm_pad.Name = "cb_pm_pad";
		this.cb_pm_pad.Size = new System.Drawing.Size(51, 21);
		this.cb_pm_pad.TabIndex = 17;
		this.cb_sg.AutoSize = true;
		this.cb_sg.Checked = true;
		this.cb_sg.CheckState = System.Windows.Forms.CheckState.Checked;
		this.cb_sg.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.cb_sg.Location = new System.Drawing.Point(0, 185);
		this.cb_sg.Name = "cb_sg";
		this.cb_sg.Size = new System.Drawing.Size(149, 24);
		this.cb_sg.TabIndex = 41;
		this.cb_sg.Text = "Signal Generator";
		this.toolTip1.SetToolTip(this.cb_sg, "Select only when a signal generator also used to do station calibration");
		this.cb_sg.UseVisualStyleBackColor = true;
		this.cb_sg.CheckedChanged += new System.EventHandler(cb_sg_CheckedChanged);
		this.cb_pm.AutoSize = true;
		this.cb_pm.Checked = true;
		this.cb_pm.CheckState = System.Windows.Forms.CheckState.Checked;
		this.cb_pm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.cb_pm.Location = new System.Drawing.Point(0, 242);
		this.cb_pm.Name = "cb_pm";
		this.cb_pm.Size = new System.Drawing.Size(117, 24);
		this.cb_pm.TabIndex = 43;
		this.cb_pm.Text = "Power Meter";
		this.toolTip1.SetToolTip(this.cb_pm, "Select only when programmable power supply connected ");
		this.cb_pm.UseVisualStyleBackColor = true;
		this.cb_pm.CheckedChanged += new System.EventHandler(cb_pm_CheckedChanged);
		this.pl_ps.Controls.Add(this.label8);
		this.pl_ps.Controls.Add(this.label9);
		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(153, 17);
		this.pl_ps.Name = "pl_ps";
		this.pl_ps.Size = new System.Drawing.Size(458, 45);
		this.pl_ps.TabIndex = 40;
		this.pl_sg.Controls.Add(this.pl_pad_sg);
		this.pl_sg.Controls.Add(this.pl_ip_sg);
		this.pl_sg.Controls.Add(this.label11);
		this.pl_sg.Controls.Add(this.label10);
		this.pl_sg.Controls.Add(this.cb_sg_remote);
		this.pl_sg.Controls.Add(this.cb_sg_name);
		this.pl_sg.Controls.Add(this.pl_sad_sg);
		this.pl_sg.Location = new System.Drawing.Point(153, 169);
		this.pl_sg.Name = "pl_sg";
		this.pl_sg.Size = new System.Drawing.Size(505, 50);
		this.pl_sg.TabIndex = 42;
		this.pl_pm.Controls.Add(this.pl_pad_pm);
		this.pl_pm.Controls.Add(this.pl_ip_pm);
		this.pl_pm.Controls.Add(this.pl_sad_pm);
		this.pl_pm.Controls.Add(this.label17);
		this.pl_pm.Controls.Add(this.label16);
		this.pl_pm.Controls.Add(this.cb_pm_remote);
		this.pl_pm.Controls.Add(this.cb_pm_name);
		this.pl_pm.Location = new System.Drawing.Point(153, 222);
		this.pl_pm.Name = "pl_pm";
		this.pl_pm.Size = new System.Drawing.Size(505, 59);
		this.pl_pm.TabIndex = 44;
		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(396, 62);
		this.plVisa.Name = "plVisa";
		this.plVisa.Size = new System.Drawing.Size(262, 49);
		this.plVisa.TabIndex = 45;
		this.plVisa.Visible = false;
		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;
		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.lbLan.AutoSize = true;
		this.lbLan.Location = new System.Drawing.Point(155, 113);
		this.lbLan.Name = "lbLan";
		this.lbLan.Size = new System.Drawing.Size(51, 13);
		this.lbLan.TabIndex = 46;
		this.lbLan.Text = "language";
		this.toolTip1.SetToolTip(this.lbLan, "Replace name = \"Qualcomm SCPI\" to support RFCal & Verify combined XTT ");
		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(159, 129);
		this.cb_cp_lan.Name = "cb_cp_lan";
		this.cb_cp_lan.Size = new System.Drawing.Size(135, 21);
		this.cb_cp_lan.TabIndex = 47;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.Controls.Add(this.cb_cp_lan);
		base.Controls.Add(this.lbLan);
		base.Controls.Add(this.plVisa);
		base.Controls.Add(this.pl_pm);
		base.Controls.Add(this.cb_pm);
		base.Controls.Add(this.pl_sg);
		base.Controls.Add(this.cb_sg);
		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 = "RFStationCalSGPMPanel";
		base.Size = new System.Drawing.Size(661, 326);
		base.Load += new System.EventHandler(RFSationCalSGPMPanel_Load);
		this.pl_pad.ResumeLayout(false);
		this.pl_pad.PerformLayout();
		this.pl_ip.ResumeLayout(false);
		this.pl_ip.PerformLayout();
		this.pl_sad.ResumeLayout(false);
		this.pl_sad.PerformLayout();
		this.pl_sad_sg.ResumeLayout(false);
		this.pl_sad_sg.PerformLayout();
		this.pl_ip_sg.ResumeLayout(false);
		this.pl_ip_sg.PerformLayout();
		this.pl_pad_sg.ResumeLayout(false);
		this.pl_pad_sg.PerformLayout();
		this.pl_sad_pm.ResumeLayout(false);
		this.pl_sad_pm.PerformLayout();
		this.pl_ip_pm.ResumeLayout(false);
		this.pl_ip_pm.PerformLayout();
		this.pl_pad_pm.ResumeLayout(false);
		this.pl_pad_pm.PerformLayout();
		this.pl_ps.ResumeLayout(false);
		this.pl_ps.PerformLayout();
		this.pl_sg.ResumeLayout(false);
		this.pl_sg.PerformLayout();
		this.pl_pm.ResumeLayout(false);
		this.pl_pm.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.errorProvider1).EndInit();
		this.plVisa.ResumeLayout(false);
		this.plVisa.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
