using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using System.Xml;
using System.Xml.Serialization;
using QSPR3xttParse;

namespace RFCalibration_CSharp;

public class MainForm : Form
{
	private delegate void ClearTextCallback();

	private delegate void SetTextCallback(int iDUT_Index, string text);

	private delegate void SetMemoryChart(long PrivateMemorySize64, long PeakVirtualMemorySize64, long PagedSystemMemorySize64, long PagedMemorySize64, long NonpagedSystemMemorySize64);

	private delegate void EnableButton(bool enable);

	private QSPR3XTT m_xttParser;

	private QSPR3XTT m_xttParser2;

	private RFCalServer m_rfCalServer;

	private RFCalServer m_rfCalServer2;

	private string m_SettingPath = "c:\\Qualcomm\\QDART\\RFCalibration_CSharp_Setting.xml";

	private RFCalibration_Client_Setting m_Setting;

	private Worker worker;

	private Thread workerThread;

	private Worker worker2;

	private Thread workerThread2;

	private Thread memoryThread;

	private IContainer components;

	private TabControl Displays;

	private TabPage Debug;

	private TabPage Error;

	private TextBox textDebug;

	private TextBox textError;

	private TabPage Log;

	private TextBox textLog;

	private TabPage HTML;

	private ListBox listTestList;

	private TextBox textXTT;

	private Button buttonLoadXTT;

	private Button buttonExecute;

	private TabPage Status;

	private TextBox textStatus;

	private Button buttonAbort;

	private WebBrowser webBrowser;

	private SplitContainer splitContainer1;

	private TabPage TPL;

	private TextBox textTpl;

	private Label lblCopyRight;

	private NumericUpDown numberOfIterations;

	private Label label2;

	private TabPage tabPage1;

	private Chart memoryChart;

	private TextBox memoryText;

	private TextBox testStatus2;

	private NumericUpDown numberOfIterations2;

	private Label label3;

	private Button buttonExecute2;

	private Button buttonAbort2;

	private TextBox textXTT2;

	private Button buttonLoadXTT2;

	private ListBox listTestList2;

	private TabPage HTML2;

	private WebBrowser webBrowser2;

	public MainForm()
	{
		InitializeComponent();
		LoadSetting();
		try
		{
			m_xttParser = new QSPR3XTT();
			m_xttParser2 = new QSPR3XTT();
		}
		catch (Exception)
		{
			MessageBox.Show("Failed to create XTT Parser Object", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
		}
		bool flag = false;
		try
		{
			if (m_Setting.intrerface == "COM")
			{
				m_rfCalServer = new RFCalServer(RFCalServer.RFCalServerMode.COM, "", "");
			}
			else if (m_Setting.intrerface == "DLL")
			{
				m_rfCalServer = new RFCalServer(RFCalServer.RFCalServerMode.DLL, "RFCAL1", m_Setting.RFCal_Sever_DLL_Path);
				string fileName = Path.GetFileName(m_Setting.RFCal_Sever_DLL_Path);
				string text = "c:\\temp\\" + fileName;
				File.Copy(m_Setting.RFCal_Sever_DLL_Path, text, overwrite: true);
				m_rfCalServer2 = new RFCalServer(RFCalServer.RFCalServerMode.DLL, "RFCAL2", text);
			}
			else
			{
				m_rfCalServer = new RFCalServer(RFCalServer.RFCalServerMode.COM, "", "");
			}
			flag = true;
		}
		catch (Exception)
		{
			MessageBox.Show("Failed to create RF Calibration Object", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
		}
		worker = new Worker();
		worker2 = new Worker();
		if (flag && m_rfCalServer != null)
		{
			m_rfCalServer.RegisterCallbacks(this, 1);
		}
		if (flag && m_rfCalServer2 != null)
		{
			m_rfCalServer2.RegisterCallbacks(this, 2);
		}
		LoadLastXTT();
	}

	private bool LoadLastXTT()
	{
		if (File.Exists(m_Setting.lastXTT) && LoadXTT(m_Setting.lastXTT, ref m_rfCalServer, ref m_xttParser, ref listTestList))
		{
			textXTT.Text = m_Setting.lastXTT;
			if (m_Setting.lastSelectedTests.Length > 0)
			{
				string[] array = m_Setting.lastSelectedTests.Split(',');
				for (int i = 0; i < array.Length; i++)
				{
					if (int.TryParse(array[i], out var result) && result < listTestList.Items.Count)
					{
						listTestList.SetSelected(result, value: true);
					}
				}
			}
		}
		numberOfIterations.Value = Convert.ToDecimal(m_Setting.DUT1_Iteration);
		if (File.Exists(m_Setting.lastXTT2) && LoadXTT(m_Setting.lastXTT2, ref m_rfCalServer2, ref m_xttParser2, ref listTestList2))
		{
			textXTT2.Text = m_Setting.lastXTT2;
			if (m_Setting.lastSelectedTests2.Length > 0)
			{
				string[] array2 = m_Setting.lastSelectedTests2.Split(',');
				for (int j = 0; j < array2.Length; j++)
				{
					if (int.TryParse(array2[j], out var result2) && result2 < listTestList2.Items.Count)
					{
						listTestList2.SetSelected(result2, value: true);
					}
				}
			}
		}
		numberOfIterations2.Value = Convert.ToDecimal(m_Setting.DUT2_Iteration);
		return true;
	}

	private bool LoadSetting()
	{
		if (File.Exists(m_SettingPath))
		{
			XmlSerializer xmlSerializer = new XmlSerializer(typeof(RFCalibration_Client_Setting));
			FileStream fileStream = new FileStream(m_SettingPath, FileMode.Open, FileAccess.Read);
			try
			{
				m_Setting = (RFCalibration_Client_Setting)xmlSerializer.Deserialize(fileStream);
			}
			catch (InvalidOperationException ex)
			{
				MessageBox.Show(ex.ToString());
				fileStream.Close();
				m_Setting = new RFCalibration_Client_Setting();
			}
			fileStream.Close();
		}
		else
		{
			m_Setting = new RFCalibration_Client_Setting();
		}
		return true;
	}

	public void SaveSettings()
	{
		m_Setting.lastXTT = textXTT.Text;
		if (listTestList.SelectedItems.Count > 0)
		{
			m_Setting.lastSelectedTests = "";
			for (int i = 0; i < listTestList.SelectedItems.Count; i++)
			{
				m_Setting.lastSelectedTests += listTestList.SelectedIndices[i];
				if (i != listTestList.SelectedItems.Count - 1)
				{
					m_Setting.lastSelectedTests += ",";
				}
			}
		}
		m_Setting.DUT1_Iteration = numberOfIterations.Value.ToString();
		m_Setting.lastXTT2 = textXTT2.Text;
		if (listTestList2.SelectedItems.Count > 0)
		{
			m_Setting.lastSelectedTests2 = "";
			for (int j = 0; j < listTestList2.SelectedItems.Count; j++)
			{
				m_Setting.lastSelectedTests2 += listTestList2.SelectedIndices[j];
				if (j != listTestList2.SelectedItems.Count - 1)
				{
					m_Setting.lastSelectedTests2 += ",";
				}
			}
		}
		m_Setting.DUT2_Iteration = numberOfIterations.Value.ToString();
		XmlSerializer xmlSerializer = new XmlSerializer(typeof(RFCalibration_Client_Setting));
		XmlWriter xmlWriter = XmlWriter.Create(m_SettingPath, new XmlWriterSettings
		{
			Indent = true
		});
		xmlSerializer.Serialize(xmlWriter, m_Setting);
		xmlWriter.Close();
	}

	private void tabPage1_Click(object sender, EventArgs e)
	{
	}

	private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
	{
	}

	private bool LoadXTT(string xttPath, ref RFCalServer rfCalServer, ref QSPR3XTT xttParser, ref ListBox listTestList)
	{
		bool flag = true;
		if (xttParser.LoadRFCalXTT(xttPath))
		{
			listTestList.Items.Clear();
			for (int i = 0; i < xttParser.GetNumOfTests(); i++)
			{
				string realName = xttParser.GetRealName(i);
				string testName = xttParser.GetTestName(i);
				listTestList.Items.Add(testName);
				int testID = rfCalServer.AddTest(testName, realName);
				int numOfTestParameter = xttParser.GetNumOfTestParameter(i);
				for (int j = 0; j < numOfTestParameter; j++)
				{
					xttParser.GetTestParameterInfo(i, j, out var parameterName, out var parameterValue, out var _, out var upperlimit, out var lowerlimit, out var _, out var paramMode);
					if (upperlimit != null || lowerlimit != null)
					{
						rfCalServer.AddParameter(testID, parameterName, parameterValue, upperlimit, lowerlimit, paramMode);
					}
					else
					{
						rfCalServer.AddParameter(testID, parameterName, parameterValue, "", "", paramMode);
					}
				}
			}
			rfCalServer.SetLogFilename(xttPath);
			flag = true;
		}
		else
		{
			flag = false;
			MessageBox.Show("Failed to load XTT", Text, MessageBoxButtons.OK, MessageBoxIcon.Hand);
		}
		return flag;
	}

	private void buttonLoadXTT_Click(object sender, EventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.InitialDirectory = "c:\\";
		openFileDialog.Filter = "xtt files (*.xtt)|*.xtt|All files (*.*)|*.*";
		openFileDialog.FilterIndex = 2;
		openFileDialog.RestoreDirectory = true;
		listTestList.Items.Clear();
		if (openFileDialog.ShowDialog() == DialogResult.OK)
		{
			textXTT.Text = openFileDialog.FileName;
			LoadXTT(textXTT.Text, ref m_rfCalServer, ref m_xttParser, ref listTestList);
		}
	}

	private void buttonExecute_Click(object sender, EventArgs e)
	{
		int num = 0;
		int count = listTestList.SelectedItems.Count;
		int[] array = new int[count];
		for (int i = 0; i < count; i++)
		{
			array[i] = listTestList.SelectedIndices[i];
		}
		Worker.TestObject[] array2 = new Worker.TestObject[count];
		for (num = 0; num < count; num++)
		{
			Worker.TestObject testObject = new Worker.TestObject();
			int index = (testObject.m_index = array[num]);
			testObject.m_testName = listTestList.Items[index].ToString();
			array2[num] = testObject;
		}
		worker.SetServer(ref m_rfCalServer);
		worker.m_form = this;
		worker.m_DUT_Index = 1;
		worker.UUTID = "UUT1";
		worker.m_TestObjects = array2;
		worker.m_iterations = Convert.ToInt32(numberOfIterations.Value);
		workerThread = new Thread(worker.DoWork);
		memoryThread = new Thread(worker.PlotUsage);
		EnableExecute(bEnable: false);
		workerThread.Start();
		memoryThread.Start();
	}

	public void ClearLogTextBoxes()
	{
		if (textDebug.InvokeRequired)
		{
			ClearTextCallback method = ClearLogTextBoxes;
			Invoke(method, null);
			return;
		}
		textDebug.Clear();
		textError.Clear();
		textLog.Clear();
		textStatus.Clear();
		textTpl.Clear();
	}

	public void SetDebugText(int DUT_Index, string text)
	{
		if (textDebug.InvokeRequired)
		{
			SetTextCallback method = SetDebugText;
			Invoke(method, DUT_Index, text);
		}
		else
		{
			text += "\r\n";
			textDebug.AppendText(text);
		}
	}

	public void PlotMemory(long PrivateMemorySize64, long PeakVirtualMemorySize64, long PagedSystemMemorySize64, long PagedMemorySize64, long NonpagedSystemMemorySize64)
	{
		if (memoryChart.InvokeRequired)
		{
			SetMemoryChart method = PlotMemory;
			Invoke(method, PrivateMemorySize64, PeakVirtualMemorySize64, PagedSystemMemorySize64, PagedMemorySize64, NonpagedSystemMemorySize64);
		}
		else
		{
			memoryChart.Series[0].Points.AddY(Convert.ToDouble(PrivateMemorySize64));
			memoryChart.Series[1].Points.AddY(Convert.ToDouble(PeakVirtualMemorySize64));
			memoryChart.Series[2].Points.AddY(Convert.ToDouble(PagedSystemMemorySize64));
			memoryChart.Series[3].Points.AddY(Convert.ToDouble(PagedMemorySize64));
			memoryChart.Series[4].Points.AddY(Convert.ToDouble(NonpagedSystemMemorySize64));
			memoryText.Clear();
			memoryText.AppendText("Private Memory:\t" + PrivateMemorySize64 + "\n");
			memoryText.AppendText("Peak Virtual:\t" + PeakVirtualMemorySize64 + "\n");
			memoryText.AppendText("Paged System:\t" + PagedSystemMemorySize64 + "\n");
			memoryText.AppendText("Paged Memory:\t" + PagedMemorySize64 + "\n");
			memoryText.AppendText("NonPagedsystem:\t" + NonpagedSystemMemorySize64 + "\n");
		}
	}

	public void EnableExecute(bool bEnable)
	{
		if (buttonExecute.InvokeRequired)
		{
			EnableButton method = EnableExecute;
			Invoke(method, bEnable);
		}
		else
		{
			buttonExecute.Enabled = bEnable;
		}
	}

	public void EnableExecute2(bool bEnable)
	{
		if (buttonExecute.InvokeRequired)
		{
			EnableButton method = EnableExecute2;
			Invoke(method, bEnable);
		}
		else
		{
			buttonExecute2.Enabled = bEnable;
		}
	}

	public void SetErrorText(int iDUT_Index, string text)
	{
		if (textError.InvokeRequired)
		{
			SetTextCallback method = SetErrorText;
			Invoke(method, iDUT_Index, text);
		}
		else
		{
			text += "\r\n";
			textError.AppendText(text);
		}
	}

	public void SetLogText(int iDUT_Index, string text)
	{
		if (textLog.InvokeRequired)
		{
			SetTextCallback method = SetLogText;
			Invoke(method, iDUT_Index, text);
		}
		else
		{
			text += "\r\n";
			textLog.AppendText(text);
		}
	}

	public void SetHTML(int iDUT_Index, string url)
	{
		if (webBrowser.InvokeRequired || webBrowser2.InvokeRequired)
		{
			SetTextCallback method = SetHTML;
			Invoke(method, iDUT_Index, url);
			return;
		}
		Uri url2 = new Uri(url);
		if (iDUT_Index == 1)
		{
			webBrowser.Url = url2;
		}
		if (iDUT_Index == 2)
		{
			webBrowser2.Url = url2;
		}
	}

	public void SetStatusText(int iDUT_Index, string text)
	{
		if (textStatus.InvokeRequired)
		{
			SetTextCallback method = SetStatusText;
			Invoke(method, iDUT_Index, text);
		}
		else
		{
			text += "\r\n";
			textStatus.AppendText("DUT" + iDUT_Index + ":" + text);
		}
	}

	public void PrintMemoryUsage(int iDUT_index, string text)
	{
		if (testStatus2.InvokeRequired)
		{
			SetTextCallback method = PrintMemoryUsage;
			Invoke(method, iDUT_index, text);
			return;
		}
		Process currentProcess = Process.GetCurrentProcess();
		DateTime now = DateTime.Now;
		int num = (int)(currentProcess.PrivateMemorySize64 / 1048576);
		CultureInfo cultureInfo = new CultureInfo("en-US");
		testStatus2.AppendText(now.ToString(cultureInfo) + ":DUT " + iDUT_index + ":" + text + ":" + num + "M\r\n");
	}

	public void SetTPLText(int DUT_Index, string text)
	{
		if (textStatus.InvokeRequired)
		{
			SetTextCallback method = SetTPLText;
			Invoke(method, DUT_Index, text);
		}
		else
		{
			text += "\r\n";
			textTpl.AppendText(text);
		}
	}

	private void buttonAbort_Click(object sender, EventArgs e)
	{
		if (worker != null)
		{
			worker.RequestStop();
		}
	}

	private void splitContainer1_Panel1_Resize(object sender, EventArgs e)
	{
		listTestList.Height = splitContainer1.Panel1.Height - 75;
		listTestList2.Height = splitContainer1.Panel1.Height - 75;
		lblCopyRight.Height = splitContainer1.Panel1.Height - 25;
	}

	private void splitContainer1_Panel2_Resize(object sender, EventArgs e)
	{
		Displays.Height = splitContainer1.Panel2.Height - 25;
		textDebug.Height = Displays.Height - 50;
		textError.Height = Displays.Height - 50;
		textLog.Height = Displays.Height - 50;
		webBrowser.Height = Displays.Height - 50;
	}

	private void Form1_FormClosed(object sender, FormClosedEventArgs e)
	{
		SaveSettings();
		Application.Exit();
	}

	private void Form1_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.F6)
		{
			buttonExecute_Click(null, null);
			e.Handled = true;
		}
	}

	private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
	{
	}

	private void buttonLoadXTT2_Click(object sender, EventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.InitialDirectory = "c:\\";
		openFileDialog.Filter = "xtt files (*.xtt)|*.xtt|All files (*.*)|*.*";
		openFileDialog.FilterIndex = 2;
		openFileDialog.RestoreDirectory = true;
		listTestList2.Items.Clear();
		if (openFileDialog.ShowDialog() == DialogResult.OK)
		{
			textXTT2.Text = openFileDialog.FileName;
			LoadXTT(textXTT2.Text, ref m_rfCalServer2, ref m_xttParser2, ref listTestList2);
		}
	}

	private void buttonExecute2_Click(object sender, EventArgs e)
	{
		int num = 0;
		int count = listTestList2.SelectedItems.Count;
		int[] array = new int[count];
		for (int i = 0; i < count; i++)
		{
			array[i] = listTestList2.SelectedIndices[i];
		}
		Worker.TestObject[] array2 = new Worker.TestObject[count];
		for (num = 0; num < count; num++)
		{
			Worker.TestObject testObject = new Worker.TestObject();
			int index = (testObject.m_index = array[num]);
			testObject.m_testName = listTestList2.Items[index].ToString();
			array2[num] = testObject;
		}
		worker2.SetServer(ref m_rfCalServer2);
		worker2.m_form = this;
		worker2.m_DUT_Index = 2;
		worker2.UUTID = "UUT2";
		worker2.m_TestObjects = array2;
		worker2.m_iterations = Convert.ToInt32(numberOfIterations2.Value);
		workerThread = new Thread(worker2.DoWork);
		memoryThread = new Thread(worker2.PlotUsage);
		EnableExecute2(bEnable: false);
		workerThread.Start();
		memoryThread.Start();
	}

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

	private void InitializeComponent()
	{
		System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
		System.Windows.Forms.DataVisualization.Charting.Legend legend = new System.Windows.Forms.DataVisualization.Charting.Legend();
		System.Windows.Forms.DataVisualization.Charting.Series series = new System.Windows.Forms.DataVisualization.Charting.Series();
		System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
		System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
		System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
		System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RFCalibration_CSharp.MainForm));
		this.Displays = new System.Windows.Forms.TabControl();
		this.Status = new System.Windows.Forms.TabPage();
		this.textStatus = new System.Windows.Forms.TextBox();
		this.Debug = new System.Windows.Forms.TabPage();
		this.textDebug = new System.Windows.Forms.TextBox();
		this.Error = new System.Windows.Forms.TabPage();
		this.textError = new System.Windows.Forms.TextBox();
		this.Log = new System.Windows.Forms.TabPage();
		this.textLog = new System.Windows.Forms.TextBox();
		this.TPL = new System.Windows.Forms.TabPage();
		this.textTpl = new System.Windows.Forms.TextBox();
		this.HTML = new System.Windows.Forms.TabPage();
		this.webBrowser = new System.Windows.Forms.WebBrowser();
		this.HTML2 = new System.Windows.Forms.TabPage();
		this.webBrowser2 = new System.Windows.Forms.WebBrowser();
		this.tabPage1 = new System.Windows.Forms.TabPage();
		this.testStatus2 = new System.Windows.Forms.TextBox();
		this.memoryText = new System.Windows.Forms.TextBox();
		this.memoryChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
		this.listTestList = new System.Windows.Forms.ListBox();
		this.textXTT = new System.Windows.Forms.TextBox();
		this.buttonLoadXTT = new System.Windows.Forms.Button();
		this.buttonExecute = new System.Windows.Forms.Button();
		this.buttonAbort = new System.Windows.Forms.Button();
		this.splitContainer1 = new System.Windows.Forms.SplitContainer();
		this.numberOfIterations2 = new System.Windows.Forms.NumericUpDown();
		this.label3 = new System.Windows.Forms.Label();
		this.buttonExecute2 = new System.Windows.Forms.Button();
		this.buttonAbort2 = new System.Windows.Forms.Button();
		this.textXTT2 = new System.Windows.Forms.TextBox();
		this.buttonLoadXTT2 = new System.Windows.Forms.Button();
		this.listTestList2 = new System.Windows.Forms.ListBox();
		this.numberOfIterations = new System.Windows.Forms.NumericUpDown();
		this.label2 = new System.Windows.Forms.Label();
		this.lblCopyRight = new System.Windows.Forms.Label();
		this.Displays.SuspendLayout();
		this.Status.SuspendLayout();
		this.Debug.SuspendLayout();
		this.Error.SuspendLayout();
		this.Log.SuspendLayout();
		this.TPL.SuspendLayout();
		this.HTML.SuspendLayout();
		this.HTML2.SuspendLayout();
		this.tabPage1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.memoryChart).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.splitContainer1).BeginInit();
		this.splitContainer1.Panel1.SuspendLayout();
		this.splitContainer1.Panel2.SuspendLayout();
		this.splitContainer1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.numberOfIterations2).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.numberOfIterations).BeginInit();
		base.SuspendLayout();
		this.Displays.Controls.Add(this.Status);
		this.Displays.Controls.Add(this.Debug);
		this.Displays.Controls.Add(this.Error);
		this.Displays.Controls.Add(this.Log);
		this.Displays.Controls.Add(this.TPL);
		this.Displays.Controls.Add(this.HTML);
		this.Displays.Controls.Add(this.HTML2);
		this.Displays.Controls.Add(this.tabPage1);
		this.Displays.Location = new System.Drawing.Point(31, 24);
		this.Displays.Multiline = true;
		this.Displays.Name = "Displays";
		this.Displays.SelectedIndex = 0;
		this.Displays.Size = new System.Drawing.Size(688, 652);
		this.Displays.TabIndex = 0;
		this.Status.Controls.Add(this.textStatus);
		this.Status.Location = new System.Drawing.Point(4, 22);
		this.Status.Name = "Status";
		this.Status.Size = new System.Drawing.Size(680, 626);
		this.Status.TabIndex = 4;
		this.Status.Text = "Test Status";
		this.Status.UseVisualStyleBackColor = true;
		this.textStatus.Location = new System.Drawing.Point(28, 19);
		this.textStatus.Multiline = true;
		this.textStatus.Name = "textStatus";
		this.textStatus.ReadOnly = true;
		this.textStatus.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
		this.textStatus.Size = new System.Drawing.Size(535, 590);
		this.textStatus.TabIndex = 1;
		this.Debug.Controls.Add(this.textDebug);
		this.Debug.Location = new System.Drawing.Point(4, 22);
		this.Debug.Name = "Debug";
		this.Debug.Padding = new System.Windows.Forms.Padding(3);
		this.Debug.Size = new System.Drawing.Size(680, 626);
		this.Debug.TabIndex = 0;
		this.Debug.Text = "Debug";
		this.Debug.UseVisualStyleBackColor = true;
		this.Debug.Click += new System.EventHandler(tabPage1_Click);
		this.textDebug.Location = new System.Drawing.Point(42, 18);
		this.textDebug.Multiline = true;
		this.textDebug.Name = "textDebug";
		this.textDebug.ReadOnly = true;
		this.textDebug.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
		this.textDebug.Size = new System.Drawing.Size(526, 587);
		this.textDebug.TabIndex = 0;
		this.Error.Controls.Add(this.textError);
		this.Error.Location = new System.Drawing.Point(4, 22);
		this.Error.Name = "Error";
		this.Error.Padding = new System.Windows.Forms.Padding(3);
		this.Error.Size = new System.Drawing.Size(680, 626);
		this.Error.TabIndex = 1;
		this.Error.Text = "Error";
		this.Error.UseVisualStyleBackColor = true;
		this.textError.Location = new System.Drawing.Point(42, 19);
		this.textError.Multiline = true;
		this.textError.Name = "textError";
		this.textError.ReadOnly = true;
		this.textError.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
		this.textError.Size = new System.Drawing.Size(533, 591);
		this.textError.TabIndex = 1;
		this.Log.Controls.Add(this.textLog);
		this.Log.Location = new System.Drawing.Point(4, 22);
		this.Log.Name = "Log";
		this.Log.Size = new System.Drawing.Size(680, 626);
		this.Log.TabIndex = 2;
		this.Log.Text = "Log";
		this.Log.UseVisualStyleBackColor = true;
		this.textLog.Location = new System.Drawing.Point(28, 19);
		this.textLog.Multiline = true;
		this.textLog.Name = "textLog";
		this.textLog.ReadOnly = true;
		this.textLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
		this.textLog.Size = new System.Drawing.Size(534, 588);
		this.textLog.TabIndex = 1;
		this.TPL.Controls.Add(this.textTpl);
		this.TPL.Location = new System.Drawing.Point(4, 22);
		this.TPL.Name = "TPL";
		this.TPL.Size = new System.Drawing.Size(680, 626);
		this.TPL.TabIndex = 5;
		this.TPL.Text = "TPL";
		this.TPL.UseVisualStyleBackColor = true;
		this.textTpl.Location = new System.Drawing.Point(28, 20);
		this.textTpl.Multiline = true;
		this.textTpl.Name = "textTpl";
		this.textTpl.ReadOnly = true;
		this.textTpl.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
		this.textTpl.Size = new System.Drawing.Size(526, 587);
		this.textTpl.TabIndex = 1;
		this.HTML.Controls.Add(this.webBrowser);
		this.HTML.Location = new System.Drawing.Point(4, 22);
		this.HTML.Name = "HTML";
		this.HTML.Size = new System.Drawing.Size(680, 626);
		this.HTML.TabIndex = 3;
		this.HTML.Text = "HTML(DUT1)";
		this.HTML.UseVisualStyleBackColor = true;
		this.webBrowser.Location = new System.Drawing.Point(43, 18);
		this.webBrowser.MinimumSize = new System.Drawing.Size(20, 20);
		this.webBrowser.Name = "webBrowser";
		this.webBrowser.ScriptErrorsSuppressed = true;
		this.webBrowser.Size = new System.Drawing.Size(532, 582);
		this.webBrowser.TabIndex = 3;
		this.webBrowser.Url = new System.Uri("", System.UriKind.Relative);
		this.HTML2.Controls.Add(this.webBrowser2);
		this.HTML2.Location = new System.Drawing.Point(4, 22);
		this.HTML2.Name = "HTML2";
		this.HTML2.Size = new System.Drawing.Size(680, 626);
		this.HTML2.TabIndex = 7;
		this.HTML2.Text = "HTML(DUT2)";
		this.HTML2.UseVisualStyleBackColor = true;
		this.webBrowser2.Dock = System.Windows.Forms.DockStyle.Fill;
		this.webBrowser2.Location = new System.Drawing.Point(0, 0);
		this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20);
		this.webBrowser2.Name = "webBrowser2";
		this.webBrowser2.Size = new System.Drawing.Size(680, 626);
		this.webBrowser2.TabIndex = 0;
		this.tabPage1.Controls.Add(this.testStatus2);
		this.tabPage1.Controls.Add(this.memoryText);
		this.tabPage1.Controls.Add(this.memoryChart);
		this.tabPage1.Location = new System.Drawing.Point(4, 22);
		this.tabPage1.Name = "tabPage1";
		this.tabPage1.Size = new System.Drawing.Size(680, 626);
		this.tabPage1.TabIndex = 6;
		this.tabPage1.Text = "MemoryUsage";
		this.tabPage1.UseVisualStyleBackColor = true;
		this.testStatus2.Location = new System.Drawing.Point(66, 324);
		this.testStatus2.Multiline = true;
		this.testStatus2.Name = "testStatus2";
		this.testStatus2.ReadOnly = true;
		this.testStatus2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
		this.testStatus2.Size = new System.Drawing.Size(333, 290);
		this.testStatus2.TabIndex = 2;
		this.memoryText.BorderStyle = System.Windows.Forms.BorderStyle.None;
		this.memoryText.Location = new System.Drawing.Point(426, 324);
		this.memoryText.Multiline = true;
		this.memoryText.Name = "memoryText";
		this.memoryText.Size = new System.Drawing.Size(222, 112);
		this.memoryText.TabIndex = 1;
		chartArea.Name = "ChartArea1";
		this.memoryChart.ChartAreas.Add(chartArea);
		legend.Name = "Legend1";
		this.memoryChart.Legends.Add(legend);
		this.memoryChart.Location = new System.Drawing.Point(13, 12);
		this.memoryChart.Name = "memoryChart";
		series.ChartArea = "ChartArea1";
		series.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
		series.Legend = "Legend1";
		series.Name = "PrivateMemory";
		series2.ChartArea = "ChartArea1";
		series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
		series2.Legend = "Legend1";
		series2.Name = "PeakVirtualMemory";
		series3.ChartArea = "ChartArea1";
		series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
		series3.Legend = "Legend1";
		series3.Name = "PagedSystemMemory";
		series4.ChartArea = "ChartArea1";
		series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
		series4.Legend = "Legend1";
		series4.Name = "PagedMemory";
		series5.ChartArea = "ChartArea1";
		series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
		series5.Legend = "Legend1";
		series5.Name = "NonPagedSystemMemory";
		this.memoryChart.Series.Add(series);
		this.memoryChart.Series.Add(series2);
		this.memoryChart.Series.Add(series3);
		this.memoryChart.Series.Add(series4);
		this.memoryChart.Series.Add(series5);
		this.memoryChart.Size = new System.Drawing.Size(653, 300);
		this.memoryChart.TabIndex = 0;
		this.memoryChart.Text = "memoryChart";
		this.listTestList.FormattingEnabled = true;
		this.listTestList.Location = new System.Drawing.Point(29, 87);
		this.listTestList.Name = "listTestList";
		this.listTestList.ScrollAlwaysVisible = true;
		this.listTestList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
		this.listTestList.Size = new System.Drawing.Size(268, 563);
		this.listTestList.TabIndex = 4;
		this.listTestList.SelectedIndexChanged += new System.EventHandler(listBox1_SelectedIndexChanged);
		this.textXTT.Location = new System.Drawing.Point(29, 32);
		this.textXTT.Name = "textXTT";
		this.textXTT.Size = new System.Drawing.Size(268, 20);
		this.textXTT.TabIndex = 1;
		this.buttonLoadXTT.Location = new System.Drawing.Point(29, 3);
		this.buttonLoadXTT.Name = "buttonLoadXTT";
		this.buttonLoadXTT.Size = new System.Drawing.Size(110, 23);
		this.buttonLoadXTT.TabIndex = 0;
		this.buttonLoadXTT.Text = "XTT Browse...";
		this.buttonLoadXTT.UseVisualStyleBackColor = true;
		this.buttonLoadXTT.Click += new System.EventHandler(buttonLoadXTT_Click);
		this.buttonExecute.Location = new System.Drawing.Point(88, 58);
		this.buttonExecute.Name = "buttonExecute";
		this.buttonExecute.Size = new System.Drawing.Size(78, 23);
		this.buttonExecute.TabIndex = 3;
		this.buttonExecute.Text = "Execute(F6)";
		this.buttonExecute.UseVisualStyleBackColor = true;
		this.buttonExecute.Click += new System.EventHandler(buttonExecute_Click);
		this.buttonAbort.Location = new System.Drawing.Point(29, 58);
		this.buttonAbort.Name = "buttonAbort";
		this.buttonAbort.Size = new System.Drawing.Size(53, 23);
		this.buttonAbort.TabIndex = 2;
		this.buttonAbort.Text = "Abort";
		this.buttonAbort.UseVisualStyleBackColor = true;
		this.buttonAbort.Click += new System.EventHandler(buttonAbort_Click);
		this.splitContainer1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
		this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
		this.splitContainer1.Location = new System.Drawing.Point(0, 0);
		this.splitContainer1.Name = "splitContainer1";
		this.splitContainer1.Panel1.Controls.Add(this.numberOfIterations2);
		this.splitContainer1.Panel1.Controls.Add(this.label3);
		this.splitContainer1.Panel1.Controls.Add(this.buttonExecute2);
		this.splitContainer1.Panel1.Controls.Add(this.buttonAbort2);
		this.splitContainer1.Panel1.Controls.Add(this.textXTT2);
		this.splitContainer1.Panel1.Controls.Add(this.buttonLoadXTT2);
		this.splitContainer1.Panel1.Controls.Add(this.listTestList2);
		this.splitContainer1.Panel1.Controls.Add(this.numberOfIterations);
		this.splitContainer1.Panel1.Controls.Add(this.label2);
		this.splitContainer1.Panel1.Controls.Add(this.listTestList);
		this.splitContainer1.Panel1.Controls.Add(this.buttonLoadXTT);
		this.splitContainer1.Panel1.Controls.Add(this.buttonExecute);
		this.splitContainer1.Panel1.Controls.Add(this.buttonAbort);
		this.splitContainer1.Panel1.Controls.Add(this.textXTT);
		this.splitContainer1.Panel1.Resize += new System.EventHandler(splitContainer1_Panel1_Resize);
		this.splitContainer1.Panel2.Controls.Add(this.Displays);
		this.splitContainer1.Panel2.Paint += new System.Windows.Forms.PaintEventHandler(splitContainer1_Panel2_Paint);
		this.splitContainer1.Panel2.Resize += new System.EventHandler(splitContainer1_Panel2_Resize);
		this.splitContainer1.Size = new System.Drawing.Size(1368, 670);
		this.splitContainer1.SplitterDistance = 586;
		this.splitContainer1.TabIndex = 0;
		this.numberOfIterations2.Location = new System.Drawing.Point(508, 55);
		this.numberOfIterations2.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 });
		this.numberOfIterations2.Minimum = new decimal(new int[4] { 1, 0, 0, 0 });
		this.numberOfIterations2.Name = "numberOfIterations2";
		this.numberOfIterations2.Size = new System.Drawing.Size(70, 20);
		this.numberOfIterations2.TabIndex = 14;
		this.numberOfIterations2.Value = new decimal(new int[4] { 1, 0, 0, 0 });
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(449, 60);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(53, 13);
		this.label3.TabIndex = 13;
		this.label3.Text = "Iterations:";
		this.buttonExecute2.Location = new System.Drawing.Point(365, 55);
		this.buttonExecute2.Name = "buttonExecute2";
		this.buttonExecute2.Size = new System.Drawing.Size(78, 23);
		this.buttonExecute2.TabIndex = 12;
		this.buttonExecute2.Text = "Execute(F6)";
		this.buttonExecute2.UseVisualStyleBackColor = true;
		this.buttonExecute2.Click += new System.EventHandler(buttonExecute2_Click);
		this.buttonAbort2.Location = new System.Drawing.Point(306, 55);
		this.buttonAbort2.Name = "buttonAbort2";
		this.buttonAbort2.Size = new System.Drawing.Size(53, 23);
		this.buttonAbort2.TabIndex = 11;
		this.buttonAbort2.Text = "Abort";
		this.buttonAbort2.UseVisualStyleBackColor = true;
		this.textXTT2.Location = new System.Drawing.Point(303, 32);
		this.textXTT2.Name = "textXTT2";
		this.textXTT2.Size = new System.Drawing.Size(268, 20);
		this.textXTT2.TabIndex = 10;
		this.buttonLoadXTT2.Location = new System.Drawing.Point(303, 3);
		this.buttonLoadXTT2.Name = "buttonLoadXTT2";
		this.buttonLoadXTT2.Size = new System.Drawing.Size(110, 23);
		this.buttonLoadXTT2.TabIndex = 9;
		this.buttonLoadXTT2.Text = "XTT Browse...";
		this.buttonLoadXTT2.UseVisualStyleBackColor = true;
		this.buttonLoadXTT2.Click += new System.EventHandler(buttonLoadXTT2_Click);
		this.listTestList2.FormattingEnabled = true;
		this.listTestList2.Location = new System.Drawing.Point(303, 83);
		this.listTestList2.Name = "listTestList2";
		this.listTestList2.ScrollAlwaysVisible = true;
		this.listTestList2.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
		this.listTestList2.Size = new System.Drawing.Size(268, 563);
		this.listTestList2.TabIndex = 8;
		this.numberOfIterations.Location = new System.Drawing.Point(231, 58);
		this.numberOfIterations.Maximum = new decimal(new int[4] { 10000, 0, 0, 0 });
		this.numberOfIterations.Minimum = new decimal(new int[4] { 1, 0, 0, 0 });
		this.numberOfIterations.Name = "numberOfIterations";
		this.numberOfIterations.Size = new System.Drawing.Size(70, 20);
		this.numberOfIterations.TabIndex = 7;
		this.numberOfIterations.Value = new decimal(new int[4] { 1, 0, 0, 0 });
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(172, 63);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(53, 13);
		this.label2.TabIndex = 6;
		this.label2.Text = "Iterations:";
		this.lblCopyRight.AutoSize = true;
		this.lblCopyRight.Location = new System.Drawing.Point(1120, 681);
		this.lblCopyRight.Name = "lblCopyRight";
		this.lblCopyRight.Size = new System.Drawing.Size(237, 13);
		this.lblCopyRight.TabIndex = 5;
		this.lblCopyRight.Text = "Copyright (c) 2015 Qualcomm Technologies, Inc.";
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1380, 700);
		base.Controls.Add(this.lblCopyRight);
		base.Controls.Add(this.splitContainer1);
		base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
		base.KeyPreview = true;
		base.Name = "MainForm";
		this.Text = "C# demo for RF Calibration Server";
		base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(Form1_FormClosed);
		base.KeyDown += new System.Windows.Forms.KeyEventHandler(Form1_KeyDown);
		this.Displays.ResumeLayout(false);
		this.Status.ResumeLayout(false);
		this.Status.PerformLayout();
		this.Debug.ResumeLayout(false);
		this.Debug.PerformLayout();
		this.Error.ResumeLayout(false);
		this.Error.PerformLayout();
		this.Log.ResumeLayout(false);
		this.Log.PerformLayout();
		this.TPL.ResumeLayout(false);
		this.TPL.PerformLayout();
		this.HTML.ResumeLayout(false);
		this.HTML2.ResumeLayout(false);
		this.tabPage1.ResumeLayout(false);
		this.tabPage1.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.memoryChart).EndInit();
		this.splitContainer1.Panel1.ResumeLayout(false);
		this.splitContainer1.Panel1.PerformLayout();
		this.splitContainer1.Panel2.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.splitContainer1).EndInit();
		this.splitContainer1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.numberOfIterations2).EndInit();
		((System.ComponentModel.ISupportInitialize)this.numberOfIterations).EndInit();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
