using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using HIVECOMKERNELLib;
using NPTGUI.Properties;

namespace NPTGUI;

public class MainForm : Form
{
	private struct Result
	{
		public int channelC0;

		public double freqC0;

		public double rssiC0;

		public List<double> rawrssiC0list;

		public int channelC1;

		public double freqC1;

		public double rssiC1;

		public List<double> rawrssiC1list;

		public int channelC2;

		public double freqC2;

		public double rssiC2;

		public List<double> rawrssiC2list;

		public int channelC3;

		public double freqC3;

		public double rssiC3;

		public List<double> rawrssiC3list;

		public string DateTimeStamp;

		public string Mode;

		public string Band;
	}

	public enum AppExitErrorCodes
	{
		ERROR_COMMAND_FAIL = 1,
		ERROR_INPUT_VALIDATION,
		ERROR_DEVICE_CONNECTION_FAILED
	}

	[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
	private delegate void rssiCallBackDelegateType(int channelC0, double freqC0, double rssiC0, IntPtr rawrssic0buffer, int channelC1, double freqC1, double rssiC1, IntPtr rawrssiC1buffer, int channelC2, double freqC2, double rssiC2, IntPtr rawrssiC2buffer, int channelC3, double freqC3, double rssiC3, IntPtr rawrssiC3buffer, int rawbuffersize);

	[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
	private delegate char checkAbortCallBackDelegateType();

	[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
	private delegate void errorMessageCallBackDelegateType(IntPtr msg);

	private const string nptDllName = "SubSysNPT_NET.dll";

	private const int MARKER_SIZE_3DB_TRANSIENT = 10;

	private const int MARKER_SIZE_6DB_TRANSIENT = 15;

	private Splash_Screen splash_screen;

	private bool abortFlag;

	private Thread workerThread;

	private string ID;

	private string filePath;

	private double MaxDeltaLimitRX0;

	private double MaxDeltaLimitRX1;

	private double MaxDeltaRX0;

	private double MaxDeltaRX1;

	private double MaxDeltaLimitRX2;

	private double MaxDeltaLimitRX3;

	private double MaxDeltaRX2;

	private double MaxDeltaRX3;

	private bool IsInitialized;

	private bool IsSelectedModeWWAN = true;

	private bool IsSelectedModeWWAN5G = true;

	private bool autoCloseApp;

	private bool commandLineMode;

	private double tempymin = 999.0;

	private double tempymax = 999.0;

	private bool AutoCloseApp_CLI;

	private string errorString = "";

	private int WLANrxChainMask;

	private StringBuilder sb = new StringBuilder();

	private rssiCallBackDelegateType rssiCB;

	private checkAbortCallBackDelegateType checkAbortCB;

	private errorMessageCallBackDelegateType errorMsgCB;

	private List<Result> ResList = new List<Result>();

	private List<Result> ParentDataResList = new List<Result>();

	private string seriesName = "RX0";

	private string seriesNameC1 = "RX1";

	private string seriesNameLimitC0 = "Limit_RX0";

	private string seriesNameLimitC1 = "Limit_RX1";

	private string seriesNameParentC0 = "Parent_RX0";

	private string seriesNameParentC1 = "Parent_RX1";

	private string seriesNameC2 = "RX2";

	private string seriesNameLimitC2 = "Limit_RX2";

	private string seriesNameParentC2 = "Parent_RX2";

	private string seriesNameC3 = "RX3";

	private string seriesNameLimitC3 = "Limit_RX3";

	private string seriesNameParentC3 = "Parent_RX3";

	private int SelectedRFModeEnumValue = 999;

	private string ChipID = "";

	private string victim_preRef;

	private string victim_daemonCheck;

	private string eepFName = "";

	private string NoOfMeasurements = "20";

	private string GNSSConstellationType = "0";

	private string GNSSCollectMode = "1";

	private string GNSSTestEquipmentAutomationType = "1";

	private string GLOHWChannel = "1";

	private string GNSSSigGenOffset = "100";

	private string GNSSSigGenLevel = "-120";

	private string GNSSkiloSamples = "256";

	private string GNSSIntegrations = "10";

	private string GNSSAutoSwitchExtLNA = "1";

	private string GNSSOTFSADisabled = "0";

	private string GNSSGenerateFFTBinFiles = "0";

	private string GNSSCal_ConfigName = "GPS_OFFLINE";

	private string logFilePrefix = "";

	private string WLAN2GRxGainIndex = "0";

	private string WLAN5GRxGainIndex = "0";

	private string WLAN2GxLNAState = "0";

	private string WLAN5GxLNAState = "0";

	private string FTMTxMeasure = "0";

	private string LTERx2Rx3bitmap = "0";

	private List<TechInfo> TechInformation;

	private string ParentMode = "";

	private string ParentBand = "";

	private string NPTDllVersion = "";

	private bool DebugLoggingEnabled;

	private int StartCh1;

	private int StartCh2;

	private int StartCh3;

	private int StartCh4;

	private int StartCh5;

	private int StopCh1;

	private int StopCh2;

	private int StopCh3;

	private int StopCh4;

	private int StopCh5;

	private Dictionary<int, string> ParentDataColumnIndex = new Dictionary<int, string>();

	private string measAveragingType = "0";

	private int appExitErrorCode;

	private string automationLogFile_prefix = "";

	private IContainer components;

	private Button bnRunStop;

	private System.Windows.Forms.Timer timer1;

	private Chart chart1;

	private GroupBox groupBoxUUTConfig;

	private GroupBox groupBox2;

	private Label label5;

	private Label label4;

	private Label label3;

	private TextBox tbStep4;

	private TextBox tbStep3;

	private TextBox tbStep2;

	private TextBox tbStep1;

	private NumericUpDown ncStop4;

	private NumericUpDown ncStart4;

	private NumericUpDown ncStop3;

	private NumericUpDown ncStart3;

	private NumericUpDown ncStop2;

	private NumericUpDown ncStart2;

	private NumericUpDown ncStop1;

	private NumericUpDown ncStart1;

	private Label label2;

	private Label label1;

	private ComboBox cbBand;

	private ComboBox cbMode;

	private CheckBox chkboxChList4;

	private CheckBox chkboxChList3;

	private CheckBox chkboxChList2;

	private CheckBox chkboxChList1;

	private GroupBox GroupBoxTransmitter;

	private Label label9;

	private TextBox tbPower;

	private CheckBox chkBoxEnableTx;

	private Label label8;

	private ComboBox cbBW;

	private CheckBox cbDiversity;

	private CheckBox chkboxMaxPower;

	private Button bnCheckPhoneConnected;

	private GroupBox groupBoxPhoneStatus;

	private Label labelPhoneStatus;

	private GroupBox gbDataLogOption;

	private TextBox tbLogFileFolder;

	private Label lbLogFileFolder;

	private GroupBox gbChartOptions;

	private GroupBox gbLimitTesting;

	private RadioButton radioButtonDeltaLimit;

	private RadioButton radioButtonLimitLine;

	private RadioButton radioButtonOff;

	private TextBox tbLimitLineRX1;

	private TextBox tbLimitLineRX0;

	private Label label11;

	private Label label10;

	private TextBox tbParentDataFile;

	private Label labelDataFile1;

	private Label labelDataFile2;

	private Button bnBrowseDataFile;

	private Label lbRunInfo;

	private TextBox tbYmax;

	private TextBox tbYmin;

	private Button bnSaveChart;

	private Label label15;

	private Label label14;

	private CheckBox chkboxChList5;

	private TextBox tbStep5;

	private NumericUpDown ncStop5;

	private NumericUpDown ncStart5;

	private Label label19;

	private Label label18;

	private Label label17;

	private Label label16;

	private TextBox tbLimitExcdRX1;

	private TextBox tbDeltaLimitRX1;

	private TextBox tbDeltaLimitRX0;

	private TextBox tbLimitExcdRX0;

	private TextBox tbMaxFreqRX1;

	private TextBox tbMaxFreqRX0;

	private TextBox tbMaxChanRX1;

	private TextBox tbMaxDeltaRX0;

	private TextBox tbMaxChanRX0;

	private TextBox tbMaxDeltaRX1;

	private CheckBox cbOnlineModeOnExit;

	private GroupBox gbReceiver;

	private Label lbSamples;

	private TextBox tbNoOfAverages;

	private Label label7;

	private Label label6;

	private TextBox tbStartRB;

	private TextBox tbNumRB;

	private GroupBox groupBoxRB;

	private Button bnAbout;

	private Label label12;

	private ComboBox cbChipID;

	private Button bnOpenLogFolder;

	private CheckBox chkboxTargetDeviceType;

	private GroupBox gbCalibrationScan;

	private CheckBox chkboxCalScan;

	private CheckBox chkBoxSingleChMode;

	private GroupBox groupBox1;

	private Button bnEditPathLoss;

	private Button bnSetSigGen;

	private Label label13;

	private Label lbCalPower;

	private TextBox tbImei;

	private NumericUpDown ncSingleChannel;

	private Label label20;

	private Label label21;

	private Label lbTestStatus;

	private NumericUpDown ncStartDelay;

	private ComboBox cbChain;

	private Label lbChainSub;

	private Label label23;

	private ComboBox cbTxBW;

	private GroupBox gbMisc;

	private Button bnBrowseLogFolder;

	private TextBox tbCalOffset;

	private TextBox tbCalPower;

	private ComboBox cbTEControlType;

	private Label label24;

	private ComboBox cbModemType;

	private Label label25;

	private Label lbPhyId;

	private ComboBox cbWLANPhyId;

	private ComboBox cbMeasMode;

	private GroupBox gbWLANCtrls;

	private Label label29;

	private Label label26;

	private Label label27;

	private CheckBox chkBxWLANCh0;

	private CheckBox chkBxWLANCh1;

	private GroupBox gbWWAN_ChainCtrl;

	private Label lbAntennaSw;

	private ComboBox cbAntennaSwitch;

	private CheckBox chkbxFTMDaemon;

	private Button bnWLANmore;

	private ComboBox cbRSSIType;

	private CheckBox cb_LTEC2C3;

	private TextBox tbLimitExcdRX3;

	private TextBox tbDeltaLimitRX3;

	private TextBox tbDeltaLimitRX2;

	private TextBox tbLimitExcdRX2;

	private TextBox tbLimitLineRX3;

	private TextBox tbMaxFreqRX3;

	private TextBox tbMaxFreqRX2;

	private TextBox tbLimitLineRX2;

	private TextBox tbMaxChanRX3;

	private Label label22;

	private TextBox tbMaxDeltaRX2;

	private Label label28;

	private TextBox tbMaxChanRX2;

	private TextBox tbMaxDeltaRX3;

	private Label label30;

	private TextBox tbLogFilePrefix;

	private CheckBox cbTransientCheck;

	private Label label_BmId;

	private NumericUpDown numeric_BmId;

	private Label label31;

	private TextBox tb_HWID;

	private CheckBox cb_Fusion;

	private Label label32;

	private CheckBox cb_UDTMode;

	private TextBox tb_UDTIp;

	[DllImport("kernel32.dll")]
	private static extern bool AttachConsole(int dwProcessId);

	public MainForm(CommandLineParameters commandLineObj)
	{
		splash_screen = new Splash_Screen();
		splash_screen.ShowSplash(commandLineObj.commandLineMode);
		Thread.Sleep(1500);
		base.WindowState = FormWindowState.Minimized;
		Show();
		base.WindowState = FormWindowState.Normal;
		InitializeComponent();
		if (ReadConfigFile())
		{
			InitializeControls();
		}
		else
		{
			EnableGroupBoxes(Enable: false);
			bnRunStop.Enabled = false;
			lbRunInfo.Text = "NPT_TechInfo.xml not found or load failed";
		}
		if (!commandLineObj.commandLineMode)
		{
			return;
		}
		AttachConsole(-1);
		if (commandLineObj.helpMode)
		{
			AutoCloseApp_CLI = true;
			Console.WriteLine(commandLineObj.errorString);
			return;
		}
		commandLineMode = true;
		errorString = commandLineObj.errorString;
		if (commandLineObj.rfModemType != "")
		{
			if (int.TryParse(commandLineObj.rfModemType, out var result))
			{
				switch (result)
				{
				case 0:
					cbModemType.SelectedIndex = 0;
					break;
				case 1:
					cbModemType.SelectedIndex = 1;
					break;
				}
			}
			else
			{
				ConstructErrorString_numericvalue(ref errorString, "/rfModemType");
			}
		}
		if (commandLineObj.ftmDaemon != "")
		{
			if (commandLineObj.ftmDaemon.ToLower().Contains("true"))
			{
				chkbxFTMDaemon.Checked = true;
			}
			else if (commandLineObj.ftmDaemon.ToLower().Contains("false"))
			{
				chkbxFTMDaemon.Checked = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/ftmdaemon");
			}
		}
		if (commandLineObj.markTransients != "")
		{
			if (commandLineObj.markTransients.ToLower().Contains("true"))
			{
				cbTransientCheck.Checked = true;
			}
			else if (commandLineObj.markTransients.ToLower().Contains("false"))
			{
				cbTransientCheck.Checked = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/marktransients");
			}
		}
		try
		{
			if (commandLineObj.tech != "")
			{
				cbMode.SelectedIndex = cbMode.FindStringExact(commandLineObj.tech);
			}
			else
			{
				cbMode.SelectedIndex = 0;
				errorString = errorString + Environment.NewLine + "ERROR: Please specify the technology using /tech. Available options are: ";
				foreach (string item in cbMode.Items)
				{
					errorString = errorString + Environment.NewLine + item;
				}
			}
		}
		catch (Exception)
		{
			cbMode.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /tech. Available options are: ";
			foreach (string item2 in cbMode.Items)
			{
				errorString = errorString + Environment.NewLine + item2;
			}
		}
		try
		{
			if (commandLineObj.band != "")
			{
				cbBand.SelectedIndex = cbBand.FindStringExact(commandLineObj.band);
			}
			else
			{
				cbBand.SelectedIndex = 0;
				if (cbBand.Items.Count != 1)
				{
					errorString = errorString + Environment.NewLine + "ERROR: Please specify the band using /band. Available options are: ";
					foreach (string item3 in cbBand.Items)
					{
						errorString = errorString + Environment.NewLine + item3;
					}
				}
			}
		}
		catch (Exception)
		{
			cbBand.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /band. Available options are: ";
			foreach (string item4 in cbBand.Items)
			{
				errorString = errorString + Environment.NewLine + item4;
			}
		}
		try
		{
			if (cbBW.Enabled && commandLineObj.rxBW != "")
			{
				cbBW.SelectedIndex = cbBW.FindStringExact(commandLineObj.rxBW);
			}
		}
		catch (Exception)
		{
			cbBW.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /rxbw. Available options are: ";
			foreach (string item5 in cbBW.Items)
			{
				errorString = errorString + Environment.NewLine + item5;
			}
		}
		try
		{
			if (cbTxBW.Enabled && commandLineObj.txBW != "")
			{
				cbTxBW.SelectedIndex = cbTxBW.FindStringExact(commandLineObj.txBW);
			}
		}
		catch (Exception)
		{
			cbTxBW.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /txbw. Available options are: ";
			foreach (string item6 in cbTxBW.Items)
			{
				errorString = errorString + Environment.NewLine + item6;
			}
		}
		try
		{
			if (commandLineObj.chipID != "")
			{
				cbChipID.SelectedIndex = cbChipID.FindStringExact(commandLineObj.chipID);
			}
		}
		catch (Exception)
		{
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /chipid. Available options are: ";
			foreach (string item7 in cbChipID.Items)
			{
				errorString = errorString + Environment.NewLine + item7;
			}
		}
		if (commandLineObj.calMode != "")
		{
			if (commandLineObj.calMode.ToLower().Contains("true"))
			{
				chkboxCalScan.Checked = true;
			}
			else if (commandLineObj.calMode.ToLower().Contains("false"))
			{
				chkboxCalScan.Checked = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/calmode");
			}
		}
		if (commandLineObj.sigGenLevel != "")
		{
			if (double.TryParse(commandLineObj.sigGenLevel, out var result2))
			{
				tbCalPower.Text = Convert.ToString(result2);
			}
			else
			{
				ConstructErrorString_numericvalue(ref errorString, "/siggenlevel");
			}
		}
		if (commandLineObj.sigGenOffset != "")
		{
			if (double.TryParse(commandLineObj.sigGenOffset, out var result3))
			{
				tbCalOffset.Text = Convert.ToString(result3);
			}
			else
			{
				ConstructErrorString_numericvalue(ref errorString, "/siggenoffset");
			}
		}
		try
		{
			if (commandLineObj.sigGenControl != "")
			{
				cbTEControlType.SelectedIndex = cbTEControlType.FindStringExact(commandLineObj.sigGenControl);
			}
			else
			{
				cbTEControlType.SelectedIndex = 0;
			}
		}
		catch (Exception)
		{
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /siggencontrol. Available options are: ";
			foreach (string item8 in cbTEControlType.Items)
			{
				errorString = errorString + Environment.NewLine + item8;
			}
		}
		if (chkBoxEnableTx.Enabled)
		{
			if (commandLineObj.txON != "")
			{
				if (commandLineObj.txON.ToLower().Contains("true"))
				{
					chkBoxEnableTx.Checked = true;
				}
				else if (commandLineObj.txON.ToLower().Contains("false"))
				{
					chkBoxEnableTx.Checked = false;
				}
				else
				{
					ConstructErrorString_truefalse(ref errorString, "/txon");
				}
			}
			if (commandLineObj.txPower != "")
			{
				if (double.TryParse(commandLineObj.txPower, out var _))
				{
					tbPower.Text = commandLineObj.txPower;
				}
				else
				{
					ConstructErrorString_numericvalue(ref errorString, "/txpower");
				}
			}
			if (commandLineObj.forceMaxPower != "")
			{
				if (commandLineObj.forceMaxPower.ToLower().Contains("true"))
				{
					chkboxMaxPower.Checked = true;
				}
				else if (commandLineObj.forceMaxPower.ToLower().Contains("false"))
				{
					chkboxMaxPower.Checked = false;
				}
				else
				{
					ConstructErrorString_truefalse(ref errorString, "/forcemaxpower");
				}
			}
			if (commandLineObj.numRB != "")
			{
				if (int.TryParse(commandLineObj.numRB, out var _))
				{
					tbNumRB.Text = commandLineObj.numRB;
				}
				else
				{
					ConstructErrorString_numericvalue(ref errorString, "/numrb");
				}
			}
			if (commandLineObj.startRB != "")
			{
				if (int.TryParse(commandLineObj.startRB, out var _))
				{
					tbStartRB.Text = commandLineObj.startRB;
				}
				else
				{
					ConstructErrorString_numericvalue(ref errorString, "/startrb");
				}
			}
		}
		try
		{
			if (commandLineObj.antennaSwitch != "")
			{
				cbAntennaSwitch.SelectedIndex = cbAntennaSwitch.FindStringExact(commandLineObj.antennaSwitch);
				if (cbAntennaSwitch.SelectedIndex == -1)
				{
					throw new Exception();
				}
			}
		}
		catch (Exception)
		{
			cbAntennaSwitch.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /antennaswitch. Available options are: ";
			foreach (string item9 in cbAntennaSwitch.Items)
			{
				errorString = errorString + Environment.NewLine + item9;
			}
		}
		try
		{
			if (commandLineObj.averagingType != "")
			{
				cbRSSIType.SelectedIndex = cbRSSIType.FindStringExact(commandLineObj.averagingType);
				if (cbRSSIType.SelectedIndex == -1)
				{
					throw new Exception();
				}
			}
		}
		catch (Exception)
		{
			cbRSSIType.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /averagingtype. Available options are: ";
			foreach (string item10 in cbRSSIType.Items)
			{
				errorString = errorString + Environment.NewLine + item10;
			}
		}
		try
		{
			if (cbMeasMode.Enabled && commandLineObj.WLANMeasMode != "")
			{
				cbMeasMode.SelectedIndex = 1;
				cbMeasMode.SelectedIndex = cbMeasMode.FindStringExact(commandLineObj.WLANMeasMode);
			}
		}
		catch (Exception)
		{
			cbMeasMode.SelectedIndex = 0;
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /wlanmeasmode. Available options are: ";
			foreach (string item11 in cbMeasMode.Items)
			{
				errorString = errorString + Environment.NewLine + item11;
			}
		}
		if (cbDiversity.Enabled && commandLineObj.diversity != "")
		{
			if (commandLineObj.diversity.ToLower().Contains("true"))
			{
				cbDiversity.Checked = true;
			}
			else if (commandLineObj.diversity.ToLower().Contains("false"))
			{
				cbDiversity.Checked = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/diversity");
			}
		}
		if (cb_LTEC2C3.Enabled && commandLineObj.Rx2Rx3 != "")
		{
			if (commandLineObj.Rx2Rx3.ToLower().Contains("true"))
			{
				cb_LTEC2C3.Checked = true;
			}
			else if (commandLineObj.Rx2Rx3.ToLower().Contains("false"))
			{
				cb_LTEC2C3.Checked = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/rx2rx3");
			}
		}
		if (commandLineObj.targetType != "")
		{
			if (commandLineObj.targetType.Contains("apq"))
			{
				chkboxTargetDeviceType.Checked = true;
			}
			else if (commandLineObj.targetType.Contains("msm"))
			{
				chkboxTargetDeviceType.Checked = false;
			}
			else
			{
				errorString = errorString + Environment.NewLine + "ERROR: Invalid option for /targettype. Allowed are msm and apq";
			}
		}
		if (commandLineObj.chartymin != "" && !double.TryParse(commandLineObj.chartymin, out tempymin))
		{
			ConstructErrorString_numericvalue(ref errorString, "/chartymin");
		}
		if (commandLineObj.chartymax != "" && !double.TryParse(commandLineObj.chartymax, out tempymax))
		{
			ConstructErrorString_numericvalue(ref errorString, "/chartymax");
		}
		if (commandLineObj.limitTesting != "")
		{
			if (commandLineObj.limitTesting.ToLower().Contains("off"))
			{
				radioButtonOff.Checked = true;
			}
			else if (commandLineObj.limitTesting.ToLower().Contains("fixedlimit"))
			{
				radioButtonLimitLine.Checked = true;
				if (commandLineObj.limitRX0 != "")
				{
					if (double.TryParse(commandLineObj.limitRX0, out var result7))
					{
						tbLimitLineRX0.Text = Convert.ToString(result7);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/limitrx0");
					}
				}
				if (commandLineObj.limitRX1 != "")
				{
					if (double.TryParse(commandLineObj.limitRX1, out var result8))
					{
						tbLimitLineRX1.Text = Convert.ToString(result8);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/limitrx1");
					}
				}
				if (commandLineObj.limitRX2 != "")
				{
					if (double.TryParse(commandLineObj.limitRX2, out var result9))
					{
						tbLimitLineRX2.Text = Convert.ToString(result9);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/limitrx2");
					}
				}
				if (commandLineObj.limitRX3 != "")
				{
					if (double.TryParse(commandLineObj.limitRX3, out var result10))
					{
						tbLimitLineRX3.Text = Convert.ToString(result10);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/limitrx3");
					}
				}
			}
			else if (commandLineObj.limitTesting.ToLower().Contains("deltawithparent"))
			{
				radioButtonDeltaLimit.Checked = true;
				if (commandLineObj.parentdatafilepath != "")
				{
					tbParentDataFile.Text = commandLineObj.parentdatafilepath;
					LoadParentDataFile(tbParentDataFile.Text);
				}
				if (commandLineObj.deltaLimitRX0 != "")
				{
					if (double.TryParse(commandLineObj.deltaLimitRX0, out var result11))
					{
						tbDeltaLimitRX0.Text = Convert.ToString(result11);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/deltalimitrx0");
					}
				}
				if (commandLineObj.deltaLimitRX1 != "")
				{
					if (double.TryParse(commandLineObj.deltaLimitRX1, out var result12))
					{
						tbDeltaLimitRX1.Text = Convert.ToString(result12);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/deltalimitrx1");
					}
				}
				if (commandLineObj.deltaLimitRX2 != "")
				{
					if (double.TryParse(commandLineObj.deltaLimitRX2, out var result13))
					{
						tbDeltaLimitRX2.Text = Convert.ToString(result13);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/deltalimitrx2");
					}
				}
				if (commandLineObj.deltaLimitRX3 != "")
				{
					if (double.TryParse(commandLineObj.deltaLimitRX3, out var result14))
					{
						tbDeltaLimitRX3.Text = Convert.ToString(result14);
					}
					else
					{
						ConstructErrorString_numericvalue(ref errorString, "/deltalimitrx3");
					}
				}
			}
			else
			{
				errorString = errorString + Environment.NewLine + "ERROR: Invalid option for /targettype. Allowed options are off, fixedlimit and deltawithparent";
			}
		}
		if (commandLineObj.onlineOnExit != "")
		{
			if (commandLineObj.onlineOnExit.ToLower().Contains("true"))
			{
				cbOnlineModeOnExit.Checked = true;
			}
			else if (commandLineObj.onlineOnExit.ToLower().Contains("false"))
			{
				cbOnlineModeOnExit.Checked = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/onlineonexit");
			}
		}
		if (commandLineObj.autoCloseApp != "")
		{
			if (commandLineObj.autoCloseApp.ToLower().Contains("true"))
			{
				autoCloseApp = true;
			}
			else if (commandLineObj.autoCloseApp.ToLower().Contains("false"))
			{
				autoCloseApp = false;
			}
			else
			{
				ConstructErrorString_truefalse(ref errorString, "/autocloseapp");
			}
		}
		if (commandLineObj.sampleNum != "")
		{
			if (int.TryParse(commandLineObj.sampleNum, out var _))
			{
				tbNoOfAverages.Text = commandLineObj.sampleNum;
			}
			else
			{
				ConstructErrorString_numericvalue(ref errorString, "/samplenum");
			}
		}
		if (commandLineObj.startDelay != "")
		{
			if (int.TryParse(commandLineObj.startDelay, out var _))
			{
				ncStartDelay.Value = Convert.ToDecimal(commandLineObj.startDelay);
			}
			else
			{
				ConstructErrorString_numericvalue(ref errorString, "/startdelay");
			}
		}
		if (numeric_BmId.Enabled && commandLineObj.beamID != "" && int.TryParse(commandLineObj.beamID, out var result17))
		{
			numeric_BmId.Value = result17;
		}
		try
		{
			if (cbMode.SelectedItem.ToString().Contains("WLAN"))
			{
				if (commandLineObj.chainsub != "")
				{
					if (commandLineObj.chainsub == "0")
					{
						throw new Exception("cbchain 0 value not supported. Please specify valid WLAN chain mask (1, 2 or 3 (i.e.both 1 and 2) )");
					}
					if (commandLineObj.chainsub == "1")
					{
						chkBxWLANCh0.Checked = true;
						chkBxWLANCh1.Checked = false;
					}
					else if (commandLineObj.chainsub == "2")
					{
						chkBxWLANCh0.Checked = false;
						chkBxWLANCh1.Checked = true;
					}
					else
					{
						if (!(commandLineObj.chainsub == "3"))
						{
							throw new Exception("cbchain value not supported. Please specify valid WLAN chain mask (1, 2 or 3 (i.e.both 1 and 2) )");
						}
						chkBxWLANCh0.Checked = true;
						chkBxWLANCh1.Checked = true;
					}
				}
				else
				{
					chkBxWLANCh0.Checked = true;
					chkBxWLANCh1.Checked = false;
				}
			}
			else if (cbChain.Enabled)
			{
				if (commandLineObj.chainsub != "")
				{
					cbChain.SelectedIndex = cbChain.FindStringExact(commandLineObj.chainsub);
				}
				else
				{
					cbChain.SelectedIndex = 0;
				}
			}
		}
		catch (Exception)
		{
			errorString = errorString + Environment.NewLine + "ERROR: Invalid option used with /chainsub. Available options are: ";
			foreach (string item12 in cbChain.Items)
			{
				errorString = errorString + Environment.NewLine + item12;
			}
		}
		if (commandLineObj.logFolderpath != "")
		{
			tbLogFileFolder.Text = commandLineObj.logFolderpath;
		}
		if (chkboxChList1.Checked)
		{
			if (commandLineObj.channelStart1 != "" && int.TryParse(commandLineObj.channelStart1, out var result18))
			{
				if (((decimal)result18 < ncStart1.Value) | ((decimal)result18 > ncStop1.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 1 start ");
				}
				else
				{
					ncStart1.Value = result18;
				}
			}
			if (commandLineObj.channelStop1 != "" && int.TryParse(commandLineObj.channelStop1, out var result19))
			{
				if (((decimal)result19 < ncStart1.Value) | ((decimal)result19 > ncStop1.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 1 stop ");
				}
				else
				{
					ncStop1.Value = result19;
				}
			}
			if (commandLineObj.channelStep1 != "" && int.TryParse(commandLineObj.channelStep1, out var result20))
			{
				if (result20 < 0)
				{
					errorString = errorString + Environment.NewLine + "Channel step cannot be negative. Using default";
				}
				else
				{
					tbStep1.Text = Convert.ToString(result20);
				}
			}
		}
		if (chkboxChList2.Checked)
		{
			if (commandLineObj.channelStart2 != "" && int.TryParse(commandLineObj.channelStart2, out var result21))
			{
				if (((decimal)result21 < ncStart2.Value) | ((decimal)result21 > ncStop2.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 2 start ");
				}
				else
				{
					ncStart2.Value = result21;
				}
			}
			if (commandLineObj.channelStop2 != "" && int.TryParse(commandLineObj.channelStop2, out var result22))
			{
				if (((decimal)result22 < ncStart2.Value) | ((decimal)result22 > ncStop2.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 2 stop ");
				}
				else
				{
					ncStop2.Value = result22;
				}
			}
			if (commandLineObj.channelStep2 != "" && int.TryParse(commandLineObj.channelStep2, out var result23))
			{
				if (result23 < 0)
				{
					errorString = errorString + Environment.NewLine + "Channel step cannot be negative. Using default";
				}
				else
				{
					tbStep2.Text = Convert.ToString(result23);
				}
			}
		}
		if (chkboxChList3.Checked)
		{
			if (commandLineObj.channelStart3 != "" && int.TryParse(commandLineObj.channelStart3, out var result24))
			{
				if (((decimal)result24 < ncStart3.Value) | ((decimal)result24 > ncStop3.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 3 start ");
				}
				else
				{
					ncStart3.Value = result24;
				}
			}
			if (commandLineObj.channelStop3 != "" && int.TryParse(commandLineObj.channelStop3, out var result25))
			{
				if (((decimal)result25 < ncStart3.Value) | ((decimal)result25 > ncStop3.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 3 stop ");
				}
				else
				{
					ncStop3.Value = result25;
				}
			}
			if (commandLineObj.channelStep3 != "" && int.TryParse(commandLineObj.channelStep3, out var result26))
			{
				if (result26 < 0)
				{
					errorString = errorString + Environment.NewLine + "Channel step cannot be negative. Using default";
				}
				else
				{
					tbStep3.Text = Convert.ToString(result26);
				}
			}
		}
		if (chkboxChList4.Checked)
		{
			if (commandLineObj.channelStart4 != "" && int.TryParse(commandLineObj.channelStart4, out var result27))
			{
				if (((decimal)result27 < ncStart4.Value) | ((decimal)result27 > ncStop4.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 4 start ");
				}
				else
				{
					ncStart4.Value = result27;
				}
			}
			if (commandLineObj.channelStop4 != "" && int.TryParse(commandLineObj.channelStop4, out var result28))
			{
				if (((decimal)result28 < ncStart4.Value) | ((decimal)result28 > ncStop4.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 4 stop ");
				}
				else
				{
					ncStop4.Value = result28;
				}
			}
			if (commandLineObj.channelStep4 != "" && int.TryParse(commandLineObj.channelStep4, out var result29))
			{
				if (result29 < 0)
				{
					errorString = errorString + Environment.NewLine + "Channel step cannot be negative. Using default";
				}
				else
				{
					tbStep4.Text = Convert.ToString(result29);
				}
			}
		}
		if (chkboxChList5.Checked)
		{
			if (commandLineObj.channelStart5 != "" && int.TryParse(commandLineObj.channelStart5, out var result30))
			{
				if (((decimal)result30 < ncStart5.Value) | ((decimal)result30 > ncStop5.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 5 start ");
				}
				else
				{
					ncStart5.Value = result30;
				}
			}
			if (commandLineObj.channelStop5 != "" && int.TryParse(commandLineObj.channelStop5, out var result31))
			{
				if (((decimal)result31 < ncStart5.Value) | ((decimal)result31 > ncStop5.Value))
				{
					ConstructErrorString_chStartStop(ref errorString, "Ch list 5 stop ");
				}
				else
				{
					ncStop5.Value = result31;
				}
			}
			if (commandLineObj.channelStep5 != "" && int.TryParse(commandLineObj.channelStep5, out var result32))
			{
				if (result32 < 0)
				{
					errorString = errorString + Environment.NewLine + "Channel step cannot be negative. Using default";
				}
				else
				{
					tbStep5.Text = Convert.ToString(result32);
				}
			}
		}
		if (chkBoxSingleChMode.Checked && commandLineObj.gnssChan != "" && int.TryParse(commandLineObj.gnssChan, out var result33))
		{
			ncSingleChannel.Value = Convert.ToDecimal(result33);
		}
		if (commandLineObj.logFilePrefix != "")
		{
			logFilePrefix = commandLineObj.logFilePrefix;
			tbLogFilePrefix.Text = logFilePrefix;
		}
		if (commandLineObj.run != "" && !commandLineObj.run.ToLower().Contains("true") && !commandLineObj.run.ToLower().Contains("false"))
		{
			ConstructErrorString_truefalse(ref errorString, "/run");
		}
		ValidateTestInfo();
		if (errorString == "")
		{
			if (commandLineObj.run != "" && commandLineObj.run.ToLower().Contains("true"))
			{
				RunStopButtonevent();
			}
			return;
		}
		errorString = errorString + Environment.NewLine + "Exiting because of invalid arguments";
		Console.WriteLine(errorString);
		appExitErrorCode = 2;
		LogAutomationError();
		if (commandLineObj.autoCloseApp.ToLower().Contains("true"))
		{
			AutoCloseApp_CLI = true;
		}
	}

	private void LogAutomationError()
	{
		string text = "C:\\Qualcomm\\QDART\\Temp\\";
		if (!Directory.Exists(text))
		{
			DirectoryInfo directoryInfo = Directory.CreateDirectory(text);
			if (directoryInfo == null)
			{
				ShowMessageBoxWrapper("Directory creation failed. Check Log File folder name and permissions", "Directory Create Failed");
				return;
			}
		}
		string text2 = DateTime.Now.ToString("yyMMddhmmss");
		automationLogFile_prefix = "\\QDART_NPTAutomationErrorLog_" + logFilePrefix + "_" + text2;
		try
		{
			File.WriteAllText(text + "\\QDART_NPTAutomationErrorLog_" + logFilePrefix + "_" + text2 + ".txt", errorString);
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper(ex.Message + "Automation Error log save failed", "");
		}
		try
		{
			if (appExitErrorCode == 1)
			{
				File.Copy(text + "\\PhoneLog.txt", text + "\\PhoneLog_" + logFilePrefix + "_" + text2 + ".txt");
			}
		}
		catch (Exception ex2)
		{
			ShowMessageBoxWrapper(ex2.Message + "Saving a copy of Phone Log failed", "");
		}
	}

	private string ConstructErrorString_truefalse(ref string errorString, string sArgument)
	{
		errorString = errorString + Environment.NewLine + "ERROR: Invalid option used for " + sArgument + ". Valid options are true or false";
		return errorString;
	}

	private void ConstructErrorString_numericvalue(ref string errorString, string sArgument)
	{
		errorString = errorString + Environment.NewLine + "ERROR: Value provided with " + sArgument + " is not a valid number";
	}

	private void ConstructErrorString_chStartStop(ref string errorString, string sArgument)
	{
		errorString = errorString + Environment.NewLine + "ERROR: Value provided for " + sArgument + " channel is out of valid range";
	}

	private void Init()
	{
		rssiCB = rssiCBack;
		checkAbortCB = checkAbort;
		errorMsgCB = errorMessage;
		HKernel hKernel = new HKernelClass();
		string ListOfTests = "";
		hKernel.LoadTestDLL("SubSysNPT_NET.dll", ref ListOfTests);
		DebugLoggingEnabled = true;
		try
		{
			if (!File.Exists("QDART_NoiseProfilingToolConfig.txt"))
			{
				return;
			}
			string[] array = null;
			using StreamReader streamReader = new StreamReader("QDART_NoiseProfilingToolConfig.txt");
			while (streamReader.Peek() >= 0)
			{
				string text = streamReader.ReadLine();
				array = text.Split(',');
				if (array.Length > 0 && array[0].ToUpper() == "ENABLEDEBUGLOGGING")
				{
					if (array[1].ToUpper() == "TRUE")
					{
						DebugLoggingEnabled = true;
					}
					else
					{
						DebugLoggingEnabled = false;
					}
				}
			}
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper(ex.Message, "Exception");
		}
	}

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern void NPTGUI_RUN();

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern void NPTGUI_AddActivePhone(string technology, string hwID);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern void Shutdown();

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern bool IsPhoneConnected();

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern byte SetFTMMode();

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern int GetPhoneComportAndID(IntPtr ID, int IdSize);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern int GetAPQPhoneComport(IntPtr ID, int IdSize);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern void SetOnlineMode();

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern int GetDLChannel(int RfModeEnumValue, int ULChannel);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern int GetULChannel(int RfModeEnumValue, int DLChannel);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	protected internal static extern int IsChannelValid(int RfModeEnumValue, int ULChannel, int LTERXBw, int LTETXBw, int IsTxOnORSelfDesense, int startRB, int numRB);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	private static extern void SetRssiCallback(rssiCallBackDelegateType cb, checkAbortCallBackDelegateType cb2, errorMessageCallBackDelegateType cb3);

	[DllImport("SubSysNPT_NET.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
	private static extern void SetNptGuiParam(string ParamName, string Value);

	private void errorMessage(IntPtr msg)
	{
		ShowMessageBoxWrapper("Error Message: " + (errorString = Marshal.PtrToStringAnsi(msg)), "Error message from dll");
		appExitErrorCode = 1;
	}

	private void rssiCBack(int channelC0, double freqC0, double rssiC0, IntPtr rawrssic0buffer, int channelC1, double freqC1, double rssiC1, IntPtr rawrssic1buffer, int channelC2, double freqC2, double rssiC2, IntPtr rawrssic2buffer, int channelC3, double freqC3, double rssiC3, IntPtr rawrssic3buffer, int rawbuffersize)
	{
		try
		{
			Result item = default(Result);
			item.channelC0 = channelC0;
			item.freqC0 = freqC0;
			item.rssiC0 = rssiC0;
			item.DateTimeStamp = DateTime.Now.ToString("MM-dd-yyyy h:mm:ss tt");
			int marker_c0 = 0;
			int marker_c1 = 0;
			int marker_c2 = 0;
			int marker_c3 = 0;
			double[] array = new double[rawbuffersize];
			Marshal.Copy(rawrssic0buffer, array, 0, rawbuffersize);
			item.rawrssiC0list = new List<double>();
			item.rawrssiC1list = new List<double>();
			item.rawrssiC2list = new List<double>();
			item.rawrssiC3list = new List<double>();
			double[] array2 = array;
			foreach (double item2 in array2)
			{
				item.rawrssiC0list.Add(item2);
			}
			if (cbTransientCheck.Enabled)
			{
				if (array.Max() - array.Average() > 3.0 && !cbMode.SelectedItem.ToString().ToLower().Contains("wlan"))
				{
					marker_c0 = 10;
				}
				else if (array.Max() - array.Average() > 6.0)
				{
					marker_c0 = 15;
				}
			}
			if (cbDiversity.Checked || (cbMode.SelectedItem.ToString().Contains("WLAN") && WLANrxChainMask.ToString() == "3"))
			{
				item.channelC1 = channelC1;
				item.freqC1 = freqC1;
				item.rssiC1 = rssiC1;
				double[] array3 = new double[rawbuffersize];
				Marshal.Copy(rawrssic1buffer, array3, 0, rawbuffersize);
				double[] array4 = array3;
				foreach (double item3 in array4)
				{
					item.rawrssiC1list.Add(item3);
				}
				if (cbTransientCheck.Enabled)
				{
					if (array3.Max() - array3.Average() > 3.0 && !cbMode.SelectedItem.ToString().ToLower().Contains("wlan"))
					{
						marker_c1 = 10;
					}
					else if (array3.Max() - array3.Average() > 6.0)
					{
						marker_c1 = 15;
					}
				}
			}
			else
			{
				item.channelC1 = 0;
				item.freqC1 = 0.0;
				item.rssiC1 = 9999.0;
			}
			if (cb_LTEC2C3.Checked && (cbMode.SelectedItem.ToString().Contains("LTE") || cbMode.SelectedItem.ToString().Contains("SUB6")))
			{
				item.channelC2 = channelC2;
				item.freqC2 = freqC2;
				item.rssiC2 = rssiC2;
				double[] array5 = new double[rawbuffersize];
				Marshal.Copy(rawrssic2buffer, array5, 0, rawbuffersize);
				double[] array6 = array5;
				foreach (double item4 in array6)
				{
					item.rawrssiC2list.Add(item4);
				}
				if (cbTransientCheck.Enabled)
				{
					if (array5.Max() - array5.Average() > 3.0)
					{
						marker_c2 = 10;
					}
					else if (array5.Max() - array5.Average() > 6.0)
					{
						marker_c2 = 15;
					}
				}
				item.channelC3 = channelC3;
				item.freqC3 = freqC3;
				item.rssiC3 = rssiC3;
				double[] array7 = new double[rawbuffersize];
				Marshal.Copy(rawrssic3buffer, array7, 0, rawbuffersize);
				double[] array8 = array7;
				foreach (double item5 in array8)
				{
					item.rawrssiC3list.Add(item5);
				}
				if (cbTransientCheck.Enabled)
				{
					if (array7.Max() - array7.Average() > 3.0)
					{
						marker_c3 = 10;
					}
					else if (array7.Max() - array7.Average() > 6.0)
					{
						marker_c3 = 15;
					}
				}
			}
			else
			{
				item.channelC2 = 0;
				item.freqC2 = 0.0;
				item.rssiC2 = 9999.0;
				item.channelC3 = 0;
				item.freqC3 = 0.0;
				item.rssiC3 = 9999.0;
			}
			ResList.Add(item);
			if (base.InvokeRequired)
			{
				BeginInvoke((MethodInvoker)delegate
				{
					PlotValues(channelC0, freqC0, rssiC0, marker_c0, channelC1, freqC1, rssiC1, marker_c1, channelC2, freqC2, rssiC2, marker_c2, channelC3, freqC3, rssiC3, marker_c3);
				});
			}
			else
			{
				PlotValues(channelC0, freqC0, rssiC0, marker_c0, channelC1, freqC1, rssiC1, marker_c1, channelC2, freqC2, rssiC2, marker_c2, channelC3, freqC3, rssiC3, marker_c3);
			}
			BeginInvoke((MethodInvoker)delegate
			{
				SetTestStatus("Test is now running...");
			});
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper(ex.Message, "Error");
		}
	}

	private void PlotValues(int channelC0, double freqC0, double rssiC0, int markerSizeIndexC0, int channelC1, double freqC1, double rssiC1, int markerSizeIndexC1, int channelC2, double freqC2, double rssiC2, int markerSizeIndexC2, int channelC3, double freqC3, double rssiC3, int markerSizeIndexC3)
	{
		chart1.Series[seriesName].Points.AddXY(channelC0 + Environment.NewLine + freqC0, rssiC0);
		switch (markerSizeIndexC0)
		{
		case 10:
			chart1.Series[seriesName].Points[chart1.Series[seriesName].Points.Count - 1].MarkerColor = Color.DarkBlue;
			chart1.Series[seriesName].Points[chart1.Series[seriesName].Points.Count - 1].MarkerSize = 10;
			chart1.Series[seriesName].Points[chart1.Series[seriesName].Points.Count - 1].MarkerStyle = MarkerStyle.Star5;
			break;
		case 15:
			chart1.Series[seriesName].Points[chart1.Series[seriesName].Points.Count - 1].MarkerColor = Color.DarkBlue;
			chart1.Series[seriesName].Points[chart1.Series[seriesName].Points.Count - 1].MarkerSize = 15;
			chart1.Series[seriesName].Points[chart1.Series[seriesName].Points.Count - 1].MarkerStyle = MarkerStyle.Star10;
			break;
		}
		if (radioButtonLimitLine.Checked)
		{
			chart1.Series[seriesNameLimitC0].Points.AddXY(channelC0 + Environment.NewLine + freqC0, tbLimitLineRX0.Text);
		}
		Result result = default(Result);
		if (radioButtonDeltaLimit.Checked)
		{
			foreach (Result parentDataRes in ParentDataResList)
			{
				if (parentDataRes.freqC0 == freqC0)
				{
					result = parentDataRes;
					chart1.Series[seriesNameParentC0].Points.AddXY(channelC0 + Environment.NewLine + freqC0, result.rssiC0);
					if (rssiC0 - result.rssiC0 > MaxDeltaLimitRX0 && rssiC0 - result.rssiC0 > MaxDeltaRX0)
					{
						MaxDeltaRX0 = Math.Round(rssiC0 - result.rssiC0, 2);
						tbMaxDeltaRX0.Text = MaxDeltaRX0.ToString();
						tbMaxChanRX0.Text = channelC0.ToString();
						tbMaxFreqRX0.Text = freqC0.ToString();
						tbLimitExcdRX0.Text = "Yes";
					}
				}
			}
		}
		if (((cbMode.SelectedItem.ToString().Contains("LTE") || cbMode.SelectedItem.ToString().Contains("SUB6")) & cb_LTEC2C3.Checked) || cbDiversity.Checked || (cbMode.SelectedItem.ToString().Contains("WLAN") && WLANrxChainMask.ToString() == "3"))
		{
			chart1.Series[seriesNameC1].Points.AddXY(channelC1 + Environment.NewLine + freqC1, rssiC1);
			switch (markerSizeIndexC1)
			{
			case 10:
				chart1.Series[seriesNameC1].Points[chart1.Series[seriesNameC1].Points.Count - 1].MarkerColor = Color.DarkBlue;
				chart1.Series[seriesNameC1].Points[chart1.Series[seriesNameC1].Points.Count - 1].MarkerSize = 10;
				chart1.Series[seriesNameC1].Points[chart1.Series[seriesNameC1].Points.Count - 1].MarkerStyle = MarkerStyle.Star5;
				break;
			case 15:
				chart1.Series[seriesNameC1].Points[chart1.Series[seriesNameC1].Points.Count - 1].MarkerColor = Color.DarkBlue;
				chart1.Series[seriesNameC1].Points[chart1.Series[seriesNameC1].Points.Count - 1].MarkerSize = 15;
				chart1.Series[seriesNameC1].Points[chart1.Series[seriesNameC1].Points.Count - 1].MarkerStyle = MarkerStyle.Star10;
				break;
			}
			if (radioButtonLimitLine.Checked)
			{
				chart1.Series[seriesNameLimitC1].Points.AddXY(channelC0 + Environment.NewLine + freqC0, tbLimitLineRX1.Text);
			}
			Result result2 = default(Result);
			if (radioButtonDeltaLimit.Checked)
			{
				foreach (Result parentDataRes2 in ParentDataResList)
				{
					if (parentDataRes2.freqC0 == freqC0)
					{
						result2 = parentDataRes2;
						chart1.Series[seriesNameParentC1].Points.AddXY(channelC0 + Environment.NewLine + freqC0, result2.rssiC1);
						if (rssiC1 - result2.rssiC1 > MaxDeltaLimitRX1 && rssiC1 - result2.rssiC1 > MaxDeltaRX1)
						{
							MaxDeltaRX1 = Math.Round(rssiC1 - result2.rssiC1, 2);
							tbMaxDeltaRX1.Text = MaxDeltaRX1.ToString();
							tbMaxChanRX1.Text = channelC0.ToString();
							tbMaxFreqRX1.Text = freqC0.ToString();
							tbLimitExcdRX1.Text = "Yes";
						}
					}
				}
			}
		}
		if (!cb_LTEC2C3.Checked || (!cbMode.SelectedItem.ToString().Contains("LTE") && !cbMode.SelectedItem.ToString().Contains("SUB6")))
		{
			return;
		}
		chart1.Series[seriesNameC2].Points.AddXY(channelC2 + Environment.NewLine + freqC2, rssiC2);
		switch (markerSizeIndexC2)
		{
		case 10:
			chart1.Series[seriesNameC2].Points[chart1.Series[seriesNameC2].Points.Count - 1].MarkerColor = Color.DarkBlue;
			chart1.Series[seriesNameC2].Points[chart1.Series[seriesNameC2].Points.Count - 1].MarkerSize = 10;
			chart1.Series[seriesNameC2].Points[chart1.Series[seriesNameC2].Points.Count - 1].MarkerStyle = MarkerStyle.Star5;
			break;
		case 15:
			chart1.Series[seriesNameC2].Points[chart1.Series[seriesNameC2].Points.Count - 1].MarkerColor = Color.DarkBlue;
			chart1.Series[seriesNameC2].Points[chart1.Series[seriesNameC2].Points.Count - 1].MarkerSize = 15;
			chart1.Series[seriesNameC2].Points[chart1.Series[seriesNameC2].Points.Count - 1].MarkerStyle = MarkerStyle.Star10;
			break;
		}
		if (radioButtonLimitLine.Checked)
		{
			chart1.Series[seriesNameLimitC2].Points.AddXY(channelC2 + Environment.NewLine + freqC2, tbLimitLineRX2.Text);
		}
		Result result3 = default(Result);
		if (radioButtonDeltaLimit.Checked)
		{
			foreach (Result parentDataRes3 in ParentDataResList)
			{
				if (parentDataRes3.freqC2 == freqC2)
				{
					result3 = parentDataRes3;
					chart1.Series[seriesNameParentC2].Points.AddXY(channelC2 + Environment.NewLine + freqC2, result3.rssiC2);
					if (rssiC2 - result3.rssiC2 > MaxDeltaLimitRX2 && rssiC2 - result3.rssiC2 > MaxDeltaRX2)
					{
						MaxDeltaRX2 = Math.Round(rssiC2 - result3.rssiC2, 2);
						tbMaxDeltaRX2.Text = MaxDeltaRX2.ToString();
						tbMaxChanRX2.Text = channelC2.ToString();
						tbMaxFreqRX2.Text = freqC2.ToString();
						tbLimitExcdRX2.Text = "Yes";
					}
				}
			}
		}
		chart1.Series[seriesNameC3].Points.AddXY(channelC3 + Environment.NewLine + freqC3, rssiC3);
		switch (markerSizeIndexC3)
		{
		case 10:
			chart1.Series[seriesNameC3].Points[chart1.Series[seriesNameC3].Points.Count - 1].MarkerColor = Color.DarkBlue;
			chart1.Series[seriesNameC3].Points[chart1.Series[seriesNameC3].Points.Count - 1].MarkerSize = 10;
			chart1.Series[seriesNameC3].Points[chart1.Series[seriesNameC3].Points.Count - 1].MarkerStyle = MarkerStyle.Star5;
			break;
		case 15:
			chart1.Series[seriesNameC3].Points[chart1.Series[seriesNameC3].Points.Count - 1].MarkerColor = Color.DarkBlue;
			chart1.Series[seriesNameC3].Points[chart1.Series[seriesNameC3].Points.Count - 1].MarkerSize = 15;
			chart1.Series[seriesNameC3].Points[chart1.Series[seriesNameC3].Points.Count - 1].MarkerStyle = MarkerStyle.Star10;
			break;
		}
		if (radioButtonLimitLine.Checked)
		{
			chart1.Series[seriesNameLimitC3].Points.AddXY(channelC3 + Environment.NewLine + freqC3, tbLimitLineRX3.Text);
		}
		Result result4 = default(Result);
		if (!radioButtonDeltaLimit.Checked)
		{
			return;
		}
		foreach (Result parentDataRes4 in ParentDataResList)
		{
			if (parentDataRes4.freqC3 == freqC3)
			{
				result4 = parentDataRes4;
				chart1.Series[seriesNameParentC3].Points.AddXY(channelC3 + Environment.NewLine + freqC3, result4.rssiC3);
				if (rssiC3 - result4.rssiC3 > MaxDeltaLimitRX3 && rssiC3 - result4.rssiC3 > MaxDeltaRX3)
				{
					MaxDeltaRX3 = Math.Round(rssiC3 - result4.rssiC3, 2);
					tbMaxDeltaRX3.Text = MaxDeltaRX3.ToString();
					tbMaxChanRX3.Text = channelC3.ToString();
					tbMaxFreqRX3.Text = freqC3.ToString();
					tbLimitExcdRX3.Text = "Yes";
				}
			}
		}
	}

	private void TestWrapper()
	{
		try
		{
			bool flag = CheckPhoneConnection();
			BeginInvoke((MethodInvoker)delegate
			{
				InitializeFilePath();
			});
			BeginInvoke((MethodInvoker)delegate
			{
				lbRunInfo.Text = filePath;
			});
			if (!flag)
			{
				ShowMessageBoxWrapper("Phone is not connected. Please connect phone and retry", "Phone not Found!");
				BeginInvoke((MethodInvoker)delegate
				{
					EnableGroupBoxes(Enable: true);
				});
				Shutdown();
				BeginInvoke((MethodInvoker)delegate
				{
					bnRunStop.Text = "Run";
				});
				if (commandLineMode)
				{
					appExitErrorCode = 3;
					throw new Exception("No Phone/Device detected");
				}
			}
			else if (IsSelectedModeWWAN && !IsSelectedModeWWAN5G && SetFTMMode() == 0)
			{
				ShowMessageBoxWrapper("Failed to set phone to FTM mode", "Set FTM Mode failed!");
				BeginInvoke((MethodInvoker)delegate
				{
					EnableGroupBoxes(Enable: true);
				});
				Shutdown();
				BeginInvoke((MethodInvoker)delegate
				{
					bnRunStop.Text = "Run";
				});
			}
			else
			{
				BeginInvoke((MethodInvoker)delegate
				{
					timer1.Enabled = true;
				});
				BeginInvoke((MethodInvoker)delegate
				{
					SetTestStatus("Wait. Initializing device...");
				});
				NPTGUI_RUN();
			}
		}
		catch (Exception ex)
		{
			Shutdown();
			errorString = errorString + "Error: " + ex.Message;
			ShowMessageBoxWrapper(errorString, "ERROR Encountered");
			if (commandLineMode)
			{
				LogAutomationError();
			}
			BeginInvoke((MethodInvoker)delegate
			{
				EnableGroupBoxes(Enable: true);
			});
			Shutdown();
			timer1.Enabled = false;
			BeginInvoke((MethodInvoker)delegate
			{
				bnRunStop.Text = "Run";
			});
			BeginInvoke((MethodInvoker)delegate
			{
				SetTestStatus("No test running");
			});
			if (commandLineMode && autoCloseApp)
			{
				BeginInvoke((MethodInvoker)delegate
				{
					Environment.ExitCode = appExitErrorCode;
				});
				BeginInvoke((MethodInvoker)delegate
				{
					Application.Exit();
				});
			}
		}
	}

	private void Form1_FormClosing(object sender, FormClosingEventArgs e)
	{
	}

	private void EnableGroupBoxes(bool Enable)
	{
		if (Enable)
		{
			groupBoxUUTConfig.Enabled = true;
			groupBoxPhoneStatus.Enabled = true;
			gbChartOptions.Enabled = true;
			gbLimitTesting.Enabled = true;
			gbDataLogOption.Enabled = true;
			gbCalibrationScan.Enabled = true;
			gbMisc.Enabled = true;
		}
		else
		{
			groupBoxUUTConfig.Enabled = false;
			groupBoxPhoneStatus.Enabled = false;
			gbChartOptions.Enabled = false;
			gbLimitTesting.Enabled = false;
			gbDataLogOption.Enabled = false;
			gbCalibrationScan.Enabled = false;
			gbMisc.Enabled = false;
		}
	}

	private void bnRunStop_Click(object sender, EventArgs e)
	{
		RunStopButtonevent();
	}

	private void RunStopButtonevent()
	{
		if (bnRunStop.Text == "Run")
		{
			if (!IsInitialized)
			{
				Init();
				IsInitialized = true;
			}
			ResList.Clear();
			if (!ValidateTestInfo())
			{
				return;
			}
			EnableGroupBoxes(Enable: false);
			MaxDeltaRX0 = (MaxDeltaRX1 = -180.0);
			TextBox textBox = tbMaxDeltaRX0;
			string text2 = (tbMaxDeltaRX1.Text = "");
			textBox.Text = text2;
			TextBox textBox2 = tbMaxChanRX0;
			string text4 = (tbMaxChanRX1.Text = "");
			textBox2.Text = text4;
			TextBox textBox3 = tbMaxFreqRX0;
			string text6 = (tbMaxFreqRX1.Text = "");
			textBox3.Text = text6;
			if (radioButtonDeltaLimit.Checked)
			{
				tbLimitExcdRX0.Text = "No";
				tbLimitExcdRX1.Text = "No";
			}
			else
			{
				tbLimitExcdRX0.Text = "";
				tbLimitExcdRX1.Text = "";
			}
			string rfModeString = getRfModeString();
			SetNptGuiParam("rf_mode", rfModeString);
			string channelListString = getChannelListString();
			SetNptGuiParam("victimChannels", channelListString);
			SetNptGuiParam("victimStartRB", tbStartRB.Text);
			SetNptGuiParam("victimNumRBs", tbNumRB.Text);
			SetNptGuiParam("activeSlot_victim", "0");
			string text7 = cbMode.SelectedItem.ToString();
			string text8 = "0";
			string BWenumStr;
			string BWenumStr2;
			if (text7.Contains("NR5GMMW"))
			{
				SetNptGuiParam("rxBandwidth_victim", "10");
				SetNptGuiParam("txBandwidth_victim", "10");
			}
			else if (text7.Contains("NR5GSUB6"))
			{
				if (getLTERXBWenumString(out BWenumStr))
				{
					SetNptGuiParam("rxBandwidth_victim", BWenumStr);
				}
				if (getLTETXBWenumString(out BWenumStr2))
				{
					SetNptGuiParam("txBandwidth_victim", BWenumStr);
				}
			}
			else
			{
				if (getLTERXBWenumString(out BWenumStr))
				{
					SetNptGuiParam("rxBandwidth_victim", BWenumStr);
				}
				if (getLTETXBWenumString(out BWenumStr2))
				{
					SetNptGuiParam("txBandwidth_victim", BWenumStr2);
				}
			}
			if (cbAntennaSwitch.SelectedItem.ToString() == "NoSwitch")
			{
				SetNptGuiParam("antennaPortSwitch", "-1");
			}
			else if (cbAntennaSwitch.SelectedItem.ToString() == "A")
			{
				SetNptGuiParam("antennaPortSwitch", "0");
			}
			else if (cbAntennaSwitch.SelectedItem.ToString() == "B")
			{
				SetNptGuiParam("antennaPortSwitch", "1");
			}
			else if (cbAntennaSwitch.SelectedItem.ToString() == "C")
			{
				SetNptGuiParam("antennaPortSwitch", "2");
			}
			else if (cbAntennaSwitch.SelectedItem.ToString() == "D")
			{
				SetNptGuiParam("antennaPortSwitch", "3");
			}
			if (text7.Contains("WLAN"))
			{
				SetNptGuiParam("WLANId", ChipID);
				SetNptGuiParam("rfGain", "70.0");
				SetNptGuiParam("adcBits", "11");
				SetNptGuiParam("adcClipVoltage", "0.4");
				SetNptGuiParam("numSegments", "10");
				SetNptGuiParam("eepFName", eepFName);
				text8 = WLANrxChainMask.ToString();
				SetNptGuiParam("WLANrxChainMask", text8);
				if (cbWLANPhyId.SelectedItem.ToString() == "PhyA")
				{
					SetNptGuiParam("PhyRFMode", "0");
					SetNptGuiParam("PhyId", "0");
				}
				else if (cbWLANPhyId.SelectedItem.ToString() == "PhyB")
				{
					SetNptGuiParam("PhyRFMode", "3");
					SetNptGuiParam("PhyId", "1");
				}
				if (cbMeasMode.SelectedItem.ToString().Contains("1MHz"))
				{
					SetNptGuiParam("WLANMeasMode", "1");
				}
				else if (cbMeasMode.SelectedItem.ToString().Contains("20MHz"))
				{
					SetNptGuiParam("WLANMeasMode", "0");
				}
				else
				{
					SetNptGuiParam("WLANMeasMode", "1");
				}
				SetNptGuiParam("WLAN2GrxGainIdx", WLAN2GRxGainIndex);
				SetNptGuiParam("WLAN5GrxGainIdx", WLAN5GRxGainIndex);
				SetNptGuiParam("WLAN2GxLNAState", WLAN2GxLNAState);
				SetNptGuiParam("WLAN5GxLNAState", WLAN5GxLNAState);
				SetNptGuiParam("vic_daemonCheck", victim_daemonCheck);
			}
			else if (text7.Contains("BT"))
			{
				SetNptGuiParam("BTId", ChipID);
				SetNptGuiParam("vic_daemonCheck", victim_daemonCheck);
			}
			else if (text7.Contains("FM"))
			{
				SetNptGuiParam("FMId", ChipID);
				SetNptGuiParam("iEmphasis", "0");
				SetNptGuiParam("iChSpacing", "2");
				SetNptGuiParam("FM_RxAnt", "0");
				SetNptGuiParam("vic_daemonCheck", victim_daemonCheck);
			}
			else if (text7.Contains("GPS") || text7.Contains("GLO") || text7.Contains("BDS") || text7.Contains("GAL"))
			{
				SetNptGuiParam("GNSS_Common", "0");
				if (text7.Contains("GLO"))
				{
					SetNptGuiParam("Glo_Hw_Chan", GLOHWChannel);
					string channelListString2 = getChannelListString();
					if (channelListString2.Length <= 0)
					{
						ShowMessageBoxWrapper("Unable to parse the single mode channel string for GLO", "");
						return;
					}
					SetNptGuiParam("victimChannels", channelListString2);
				}
				SetNptGuiParam("GNSS_ConstellationType", GNSSConstellationType);
				SetNptGuiParam("GPS_CollectMode", GNSSCollectMode);
				SetNptGuiParam("GPS_IQ_KSamples", GNSSkiloSamples);
				SetNptGuiParam("GPS_IQ_IntNum", GNSSIntegrations);
				string value = tbCalPower.Text;
				SetNptGuiParam("GPS_SG_Level", value);
				string value2 = tbCalOffset.Text;
				SetNptGuiParam("GPS_SG_Offset", value2);
				if (cbTEControlType.SelectedItem.ToString().ToLower().Contains("manual"))
				{
					SetNptGuiParam("GPS_TestEquipmentSetupType", "2");
					SetNptGuiParam("GPS_OTFSA_Disabled", "1");
				}
				else if (cbTEControlType.SelectedItem.ToString().ToLower().Contains("prompted"))
				{
					SetNptGuiParam("GPS_TestEquipmentSetupType", "1");
					SetNptGuiParam("GPS_OTFSA_Disabled", "1");
				}
				else if (cbTEControlType.SelectedItem.ToString().ToLower().Contains("automated"))
				{
					SetNptGuiParam("GPS_TestEquipmentSetupType", "0");
					SetNptGuiParam("GPS_OTFSA_Disabled", "0");
				}
				else if (cbTEControlType.SelectedItem.ToString().ToLower().Contains("default"))
				{
					SetNptGuiParam("GPS_TestEquipmentSetupType", GNSSTestEquipmentAutomationType);
					SetNptGuiParam("GPS_OTFSA_Disabled", GNSSOTFSADisabled);
				}
				SetNptGuiParam("GPS_AutoSet_GNSS_Ext_LNA_State", GNSSAutoSwitchExtLNA);
				SetNptGuiParam("GPS_Generate_FFT_Bin_Files", GNSSGenerateFFTBinFiles);
				SetNptGuiParam("GPS_CalConfigName", GNSSCal_ConfigName);
				if (commandLineMode)
				{
					SetNptGuiParam("GPS_AutoClosePlots", "1");
				}
				else
				{
					SetNptGuiParam("GPS_AutoClosePlots", "0");
				}
			}
			if (cbChain.Items.Count > 0)
			{
				text8 = cbChain.SelectedItem.ToString();
				SetNptGuiParam("vic_chain", text8);
			}
			if (text7.Contains("WLAN") || text7.Contains("BT") || text7.Contains("FM"))
			{
				if (!chkbxFTMDaemon.Checked)
				{
					SetNptGuiParam("vic_preRef", "");
					SetNptGuiParam("vic_prefix", "");
				}
				else
				{
					SetNptGuiParam("vic_preRef", victim_preRef);
					SetNptGuiParam("vic_prefix", "start cmd.exe");
				}
			}
			if (text7.Contains("WLAN") || text7.Contains("BT") || text7.Contains("FM") || text7.Contains("GPS") || text7.Contains("BDS") || text7.Contains("GLONASS") || text7.Contains("GAL"))
			{
				IsSelectedModeWWAN = false;
				IsSelectedModeWWAN5G = false;
			}
			else if (text7.Contains("NR5G"))
			{
				IsSelectedModeWWAN5G = true;
				IsSelectedModeWWAN = true;
			}
			else
			{
				IsSelectedModeWWAN = true;
				IsSelectedModeWWAN5G = false;
			}
			if (chkboxTargetDeviceType.Checked)
			{
				SetNptGuiParam("TargetDeviceType", "1");
			}
			else
			{
				SetNptGuiParam("TargetDeviceType", "0");
			}
			abortFlag = false;
			if (cb_UDTMode.Checked)
			{
				if (IPAddress.TryParse(tb_UDTIp.Text.Trim(), out var _))
				{
					SetNptGuiParam("connectUsingUserTransportDll", "1");
					if (text7.Contains("WLAN"))
					{
						SetNptGuiParam("userTransportDll", "QMSL_WLAN_Transport.dll");
					}
					else if (text7.Contains("BT"))
					{
						SetNptGuiParam("userTransportDll", "QMSL_BT_Transport.dll");
					}
					SetNptGuiParam("userTransportDll_ipaddress", tb_UDTIp.Text.Trim());
				}
			}
			else
			{
				SetNptGuiParam("connectUsingUserTransportDll", "0");
			}
			InitializeChart();
			if (cbDiversity.Checked)
			{
				SetNptGuiParam("measSecChain", "1");
			}
			else
			{
				SetNptGuiParam("measSecChain", "0");
			}
			if (LTERx2Rx3bitmap == "1")
			{
				SetNptGuiParam("lte_mimo_bitmap", "1");
			}
			else
			{
				SetNptGuiParam("lte_mimo_bitmap", "0");
			}
			if (chkBoxEnableTx.Checked)
			{
				SetNptGuiParam("NPTScanOnly", "1");
				SetNptGuiParam("refScanOnly", "0");
				SetNptGuiParam("TxAGCdBm", tbPower.Text);
			}
			else
			{
				SetNptGuiParam("NPTScanOnly", "0");
				SetNptGuiParam("refScanOnly", "1");
			}
			SetNptGuiParam("NumMeas", tbNoOfAverages.Text);
			if (cbRSSIType.SelectedItem.ToString().ToLower().Contains("mean"))
			{
				SetNptGuiParam("measAveragingType", "0");
			}
			else if (cbRSSIType.SelectedItem.ToString().ToLower().Contains("95thpercentile"))
			{
				SetNptGuiParam("measAveragingType", "1");
			}
			else
			{
				if (!cbRSSIType.SelectedItem.ToString().ToLower().Contains("max"))
				{
					throw new Exception("Invalid Measurement Averaging type selected");
				}
				SetNptGuiParam("measAveragingType", "2");
			}
			if (DebugLoggingEnabled)
			{
				SetNptGuiParam("DebugLogging", "1");
			}
			else
			{
				SetNptGuiParam("DebugLogging", "0");
			}
			if (chkboxCalScan.Checked)
			{
				SetNptGuiParam("useJammer", "1");
				SetNptGuiParam("calScanOnly", "1");
			}
			else
			{
				SetNptGuiParam("useJammer", "0");
				SetNptGuiParam("calScanOnly", "0");
			}
			SetNptGuiParam("jammerPower", tbCalPower.Text);
			SetNptGuiParam("jammerFreqOffset", tbCalOffset.Text);
			if (cbModemType.SelectedIndex == 1)
			{
				SetNptGuiParam("ftmAPIType", "1");
			}
			else
			{
				SetNptGuiParam("ftmAPIType", "0");
			}
			if (chkBoxSingleChMode.Checked)
			{
				SetNptGuiParam("singleChannelMode", "1");
			}
			else
			{
				SetNptGuiParam("singleChannelMode", "0");
			}
			SetNptGuiParam("ftmTxMeas", FTMTxMeasure);
			SetNptGuiParam("startDelay", ncStartDelay.Value.ToString());
			if (numeric_BmId.Visible)
			{
				SetNptGuiParam("vic_beam_id", numeric_BmId.Value.ToString());
			}
			if (cb_Fusion.Checked)
			{
				NPTGUI_AddActivePhone("LTE,NR5G", tb_HWID.Text);
			}
			SetRssiCallback(rssiCB, checkAbortCB, errorMsgCB);
			try
			{
				if (text7.Contains("GPS"))
				{
					string[] files = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "GPS_*RefScan.png");
					string[] array = files;
					foreach (string path in array)
					{
						File.Delete(path);
					}
					files = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "GPS_*RefScan.txt");
					string[] array2 = files;
					foreach (string path2 in array2)
					{
						File.Delete(path2);
					}
					files = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "Summary_WB_IQ_GPS_*RefScan.txt");
					string[] array3 = files;
					foreach (string path3 in array3)
					{
						File.Delete(path3);
					}
				}
				else if (text7.Contains("GLO"))
				{
					string[] files2 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "GLO_" + ncSingleChannel.Value + "*RefScan.png");
					string[] array4 = files2;
					foreach (string path4 in array4)
					{
						File.Delete(path4);
					}
					files2 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "GLO_" + ncSingleChannel.Value + "*RefScan.txt");
					string[] array5 = files2;
					foreach (string path5 in array5)
					{
						File.Delete(path5);
					}
					files2 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "Summary_WB_IQ_GLO_" + ncSingleChannel.Value + "*RefScan.txt");
					string[] array6 = files2;
					foreach (string path6 in array6)
					{
						File.Delete(path6);
					}
				}
				else if (text7.Contains("BDS"))
				{
					string[] files3 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "BDS_*RefScan.png");
					string[] array7 = files3;
					foreach (string path7 in array7)
					{
						File.Delete(path7);
					}
					files3 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "BDS_*RefScan.txt");
					string[] array8 = files3;
					foreach (string path8 in array8)
					{
						File.Delete(path8);
					}
					files3 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "Summary_WB_IQ_BDS_*RefScan.txt");
					string[] array9 = files3;
					foreach (string path9 in array9)
					{
						File.Delete(path9);
					}
				}
				else if (text7.Contains("GAL"))
				{
					string[] files4 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "GAL_*RefScan.png");
					string[] array10 = files4;
					foreach (string path10 in array10)
					{
						File.Delete(path10);
					}
					files4 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "GAL_*RefScan.txt");
					string[] array11 = files4;
					foreach (string path11 in array11)
					{
						File.Delete(path11);
					}
					files4 = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "Summary_WB_IQ_GAL_*RefScan.txt");
					string[] array12 = files4;
					foreach (string path12 in array12)
					{
						File.Delete(path12);
					}
				}
			}
			catch (Exception)
			{
			}
			workerThread = new Thread(TestWrapper);
			workerThread.Start();
			bnRunStop.Text = "Stop";
		}
		else
		{
			abortFlag = true;
			bnRunStop.Text = "Run";
		}
	}

	private bool ValidateTestInfo()
	{
		if (radioButtonLimitLine.Checked)
		{
			double result = 0.0;
			if (!double.TryParse(tbLimitLineRX0.Text, out result))
			{
				ShowMessageWrapper("ERROR: Invalid Limit value enter for RX0");
				return false;
			}
			if (cbDiversity.Checked)
			{
				double result2 = 0.0;
				if (!double.TryParse(tbLimitLineRX1.Text, out result2))
				{
					ShowMessageWrapper("ERROR: Invalid Limit value enter for RX1");
					return false;
				}
			}
			if (cb_LTEC2C3.Checked)
			{
				double result3 = 0.0;
				if (!double.TryParse(tbLimitLineRX2.Text, out result3))
				{
					ShowMessageWrapper("ERROR: Invalid Limit value enter for RX2");
					return false;
				}
				double result4 = 0.0;
				if (!double.TryParse(tbLimitLineRX3.Text, out result4))
				{
					ShowMessageWrapper("ERROR: Invalid Limit value enter for RX3");
					return false;
				}
			}
		}
		if (radioButtonDeltaLimit.Checked)
		{
			string text = cbMode.SelectedItem.ToString();
			string text2 = cbBand.SelectedItem.ToString();
			if (!File.Exists(tbParentDataFile.Text))
			{
				ShowMessageWrapper("ERROR: Invalid Parent Data File Path");
				return false;
			}
			if (!text.Equals(ParentMode))
			{
				ShowMessageWrapper("ERROR: Parent Data File mode does not match the current settings");
				return false;
			}
			if (!text2.Equals(ParentBand))
			{
				ShowMessageWrapper("ERROR: Parent Data File band does not match the current settings");
				return false;
			}
			if (!double.TryParse(tbDeltaLimitRX0.Text, out MaxDeltaLimitRX0))
			{
				ShowMessageWrapper("ERROR: Invalid Delta Limit value enter for RX0");
				return false;
			}
			if (!double.TryParse(tbDeltaLimitRX1.Text, out MaxDeltaLimitRX1))
			{
				ShowMessageWrapper("ERROR: Invalid Delta Limit value enter for RX1");
				return false;
			}
			if (!double.TryParse(tbDeltaLimitRX2.Text, out MaxDeltaLimitRX2))
			{
				ShowMessageWrapper("ERROR: Invalid Delta Limit value enter for RX2");
				return false;
			}
			if (!double.TryParse(tbDeltaLimitRX3.Text, out MaxDeltaLimitRX3))
			{
				ShowMessageWrapper("ERROR: Invalid Delta Limit value enter for RX3");
				return false;
			}
			int controlsChannelListCount = getControlsChannelListCount();
			if (controlsChannelListCount != ParentDataResList.Count)
			{
				ShowMessageWrapper("ERROR: Number of Parent data file points dont match the current selected channel list");
				return false;
			}
		}
		if (!chkboxChList1.Checked && !chkboxChList2.Checked && !chkboxChList3.Checked && !chkboxChList4.Checked && !chkboxChList5.Checked)
		{
			ShowMessageWrapper("ERROR: Atleast one channel range needs to be selected. Please select appropriate channel ranges");
			return false;
		}
		int result5 = 20;
		if (!int.TryParse(tbNoOfAverages.Text, out result5))
		{
			ShowMessageWrapper("ERROR: Invalid Number of Averages set");
			return false;
		}
		if (result5 == 0)
		{
			ShowMessageWrapper("ERROR: Invalid Number of Averages set");
			return false;
		}
		if (tbLogFileFolder.Text == "")
		{
			tbLogFileFolder.Text = "C:\\Temp\\NPT5";
		}
		if (!Directory.Exists(tbLogFileFolder.Text))
		{
			DirectoryInfo directoryInfo = Directory.CreateDirectory(tbLogFileFolder.Text);
			if (directoryInfo == null)
			{
				ShowMessageWrapper("ERROR: Directory creation failed. Check Log File folder name and permissions");
				return false;
			}
		}
		if (chkboxCalScan.Checked && chkBoxEnableTx.Checked && !commandLineMode)
		{
			switch (MessageBox.Show("You are trying to enable Tx when 'Cal Mode' is turned ON. If the cal test setup is conducted, you might feed the sig gen with reverse power from DUT." + Environment.NewLine + " Are you sure you want to Continue ?", "Sig Gen reverse power warning", MessageBoxButtons.YesNo))
			{
			case DialogResult.Yes:
				return true;
			case DialogResult.No:
				return false;
			}
		}
		if (chkboxCalScan.Checked)
		{
			if (!double.TryParse(tbCalPower.Text, out var result6))
			{
				ShowMessageWrapper("ERROR: Cal Power is not a valid value");
				return false;
			}
			if (!double.TryParse(tbCalOffset.Text, out result6))
			{
				ShowMessageWrapper("ERROR: Cal Offset is not a valid value");
				return false;
			}
		}
		if (cbMode.SelectedItem.ToString().Contains("WLAN") && !chkBxWLANCh0.Checked && !chkBxWLANCh1.Checked)
		{
			ShowMessageWrapper("ERROR: No WLAN chain selected. Please select atleast one");
			return false;
		}
		if (cb_UDTMode.Checked && !IPAddress.TryParse(tb_UDTIp.Text.Trim(), out var _))
		{
			ShowMessageWrapper("Invalid IP Address entered for UDT Connection");
			return false;
		}
		return true;
	}

	private void InitializeChart()
	{
		chart1.Series.Clear();
		chart1.Legends[0].CustomItems.Clear();
		if (cbTransientCheck.Checked)
		{
			AddMarkerLegend();
		}
		chart1.Series.Add(seriesName);
		chart1.Series[seriesName].ChartType = SeriesChartType.Line;
		chart1.Series[seriesName].Points.Clear();
		chart1.Series[seriesName].Color = Color.DarkBlue;
		chart1.Series[seriesName].BorderWidth = 1;
		if (radioButtonLimitLine.Checked)
		{
			chart1.Series.Add(seriesNameLimitC0);
			chart1.Series[seriesNameLimitC0].ChartType = SeriesChartType.Line;
			chart1.Series[seriesNameLimitC0].Points.Clear();
			chart1.Series[seriesNameLimitC0].Color = Color.Red;
			chart1.Series[seriesNameLimitC0].BorderWidth = 2;
		}
		else if (radioButtonDeltaLimit.Checked)
		{
			chart1.Series.Add(seriesNameParentC0);
			chart1.Series[seriesNameParentC0].ChartType = SeriesChartType.Line;
			chart1.Series[seriesNameParentC0].Points.Clear();
			chart1.Series[seriesNameParentC0].Color = Color.Blue;
			chart1.Series[seriesNameParentC0].ToolTip = "#AXISLABEL #VALY";
			chart1.Series[seriesNameParentC0].BorderWidth = 1;
			chart1.Series[seriesNameParentC0].BorderDashStyle = ChartDashStyle.Dash;
		}
		if (cbDiversity.Checked || (cbMode.SelectedItem.ToString().Contains("WLAN") && WLANrxChainMask.ToString() == "3"))
		{
			chart1.Series.Add(seriesNameC1);
			chart1.Series[seriesNameC1].ChartType = SeriesChartType.Line;
			chart1.Series[seriesNameC1].Points.Clear();
			chart1.Series[seriesNameC1].Color = Color.DarkGreen;
			chart1.Series[seriesNameC1].BorderWidth = 1;
			chart1.Series[seriesNameC1].ToolTip = "#AXISLABEL #VALY";
			if (radioButtonLimitLine.Checked)
			{
				chart1.Series.Add(seriesNameLimitC1);
				chart1.Series[seriesNameLimitC1].ChartType = SeriesChartType.Line;
				chart1.Series[seriesNameLimitC1].Points.Clear();
				chart1.Series[seriesNameLimitC1].BorderWidth = 2;
				chart1.Series[seriesNameLimitC1].Color = Color.Brown;
			}
			else if (radioButtonDeltaLimit.Checked)
			{
				chart1.Series.Add(seriesNameParentC1);
				chart1.Series[seriesNameParentC1].ChartType = SeriesChartType.Line;
				chart1.Series[seriesNameParentC1].Points.Clear();
				chart1.Series[seriesNameParentC1].Color = Color.Green;
				chart1.Series[seriesNameParentC1].BorderWidth = 1;
				chart1.Series[seriesNameParentC1].BorderDashStyle = ChartDashStyle.Dash;
				chart1.Series[seriesNameParentC1].ToolTip = "#AXISLABEL #VALY";
			}
		}
		if (cb_LTEC2C3.Checked && (cbMode.SelectedItem.ToString().Contains("LTE") || cbMode.SelectedItem.ToString().Contains("SUB6")))
		{
			chart1.Series.Add(seriesNameC2);
			chart1.Series[seriesNameC2].ChartType = SeriesChartType.Line;
			chart1.Series[seriesNameC2].Points.Clear();
			chart1.Series[seriesNameC2].Color = Color.Chocolate;
			chart1.Series[seriesNameC2].BorderWidth = 1;
			chart1.Series[seriesNameC2].ToolTip = "#AXISLABEL #VALY";
			if (radioButtonLimitLine.Checked)
			{
				chart1.Series.Add(seriesNameLimitC2);
				chart1.Series[seriesNameLimitC2].ChartType = SeriesChartType.Line;
				chart1.Series[seriesNameLimitC2].Points.Clear();
				chart1.Series[seriesNameLimitC2].BorderWidth = 2;
				chart1.Series[seriesNameLimitC2].Color = Color.DarkOrange;
			}
			else if (radioButtonDeltaLimit.Checked)
			{
				chart1.Series.Add(seriesNameParentC2);
				chart1.Series[seriesNameParentC2].ChartType = SeriesChartType.Line;
				chart1.Series[seriesNameParentC2].Points.Clear();
				chart1.Series[seriesNameParentC2].Color = Color.Yellow;
				chart1.Series[seriesNameParentC2].BorderWidth = 1;
				chart1.Series[seriesNameParentC2].BorderDashStyle = ChartDashStyle.Dash;
				chart1.Series[seriesNameParentC2].ToolTip = "#AXISLABEL #VALY";
			}
			chart1.Series.Add(seriesNameC3);
			chart1.Series[seriesNameC3].ChartType = SeriesChartType.Line;
			chart1.Series[seriesNameC3].Points.Clear();
			chart1.Series[seriesNameC3].Color = Color.Violet;
			chart1.Series[seriesNameC3].BorderWidth = 1;
			chart1.Series[seriesNameC3].ToolTip = "#AXISLABEL #VALY";
			if (radioButtonLimitLine.Checked)
			{
				chart1.Series.Add(seriesNameLimitC3);
				chart1.Series[seriesNameLimitC3].ChartType = SeriesChartType.Line;
				chart1.Series[seriesNameLimitC3].Points.Clear();
				chart1.Series[seriesNameLimitC3].BorderWidth = 2;
				chart1.Series[seriesNameLimitC3].Color = Color.OrangeRed;
			}
			else if (radioButtonDeltaLimit.Checked)
			{
				chart1.Series.Add(seriesNameParentC3);
				chart1.Series[seriesNameParentC3].ChartType = SeriesChartType.Line;
				chart1.Series[seriesNameParentC3].Points.Clear();
				chart1.Series[seriesNameParentC3].Color = Color.MediumVioletRed;
				chart1.Series[seriesNameParentC3].BorderWidth = 1;
				chart1.Series[seriesNameParentC3].BorderDashStyle = ChartDashStyle.Dash;
				chart1.Series[seriesNameParentC3].ToolTip = "#AXISLABEL #VALY";
			}
		}
		chart1.BorderlineDashStyle = ChartDashStyle.Solid;
		chart1.ChartAreas[0].AxisY.Title = "RSSI (dBm)";
		chart1.ChartAreas[0].AxisX.Title = "Channel & Frequency (MHz)";
		chart1.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
		chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
		chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
		chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
		chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
		chart1.ChartAreas[0].BorderDashStyle = ChartDashStyle.Solid;
		chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
		chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
		chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
		chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;
		chart1.ChartAreas[0].CursorX.LineColor = Color.Transparent;
		chart1.ChartAreas[0].CursorY.LineColor = Color.Transparent;
		chart1.ChartAreas[0].CursorY.IsUserEnabled = true;
		chart1.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
		chart1.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
		chart1.ChartAreas[0].AxisY.ScrollBar.IsPositionedInside = true;
		chart1.Series[seriesName].ToolTip = "#AXISLABEL #VALY";
		SetYmax(tbYmax.Text);
		SetYmin(tbYmin.Text);
	}

	private int getControlsChannelListCount()
	{
		int num = 0;
		if (chkboxChList1.Checked)
		{
			num += getSSScount(ncStart1, ncStop1, tbStep1);
		}
		if (chkboxChList2.Checked)
		{
			num += getSSScount(ncStart2, ncStop2, tbStep2);
		}
		if (chkboxChList3.Checked)
		{
			num += getSSScount(ncStart3, ncStop3, tbStep3);
		}
		if (chkboxChList4.Checked)
		{
			num += getSSScount(ncStart4, ncStop4, tbStep4);
		}
		if (chkboxChList5.Checked)
		{
			num += getSSScount(ncStart5, ncStop5, tbStep5);
		}
		return num;
	}

	private int getSSScount(NumericUpDown ncSt, NumericUpDown ncEnd, TextBox tbStep)
	{
		int num = Convert.ToInt32(ncSt.Value);
		int num2 = Convert.ToInt32(ncEnd.Value);
		int num3 = 0;
		int num4 = Convert.ToInt32(tbStep.Text);
		for (int i = num; i <= num2; i += num4)
		{
			num3++;
		}
		return num3;
	}

	private void timer1_Tick(object sender, EventArgs e)
	{
		try
		{
			if (workerThread.ThreadState == System.Threading.ThreadState.Running)
			{
				return;
			}
			BeginInvoke((MethodInvoker)delegate
			{
				LogDataToCSV();
			});
			BeginInvoke((MethodInvoker)delegate
			{
				LogRawDataToCSV();
			});
			BeginInvoke((MethodInvoker)delegate
			{
				copyCustomFiles_WLAN();
			});
			BeginInvoke((MethodInvoker)delegate
			{
				EnableGroupBoxes(Enable: true);
			});
			Shutdown();
			timer1.Enabled = false;
			if (!filePath.Contains("GPS") && !filePath.Contains("GLO") && !filePath.Contains("BDS") && !filePath.Contains("GAL"))
			{
				BeginInvoke((MethodInvoker)delegate
				{
					chart1.SaveImage(filePath + ".png", ChartImageFormat.Png);
				});
			}
			bnRunStop.Text = "Run";
			BeginInvoke((MethodInvoker)delegate
			{
				SetTestStatus("No test running");
			});
			Console.Beep(1046, 62);
			Console.Beep(523, 62);
			Console.Beep(1046, 62);
			if (commandLineMode && autoCloseApp)
			{
				BeginInvoke((MethodInvoker)delegate
				{
					Environment.ExitCode = 0;
				});
				BeginInvoke((MethodInvoker)delegate
				{
					Application.Exit();
				});
			}
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper("Error:" + ex.Message, "");
		}
	}

	private void CopyFilesToOutputFolder(string[] filenames, string targetFolder)
	{
		if (filenames.Length > 0)
		{
			foreach (string text in filenames)
			{
				File.Move(text, targetFolder + "\\" + Path.GetFileNameWithoutExtension(filePath) + "_" + Path.GetFileName(text));
			}
		}
	}

	private void copyCustomFiles_WLAN()
	{
		try
		{
			string text = cbMode.SelectedItem.ToString();
			if (text.Contains("WLAN"))
			{
				string[] files = Directory.GetFiles("C:\\Qualcomm\\QDART\\Temp", "NPT_WLANFFT_*", SearchOption.TopDirectoryOnly);
				CopyFilesToOutputFolder(files, Path.GetDirectoryName(filePath));
			}
		}
		catch (Exception)
		{
		}
	}

	private void LogDataToCSV()
	{
		if (tbLogFileFolder.Text == "")
		{
			tbLogFileFolder.Text = "C:\\Temp\\NPT5";
		}
		if (!Directory.Exists(tbLogFileFolder.Text))
		{
			DirectoryInfo directoryInfo = Directory.CreateDirectory(tbLogFileFolder.Text);
			if (directoryInfo == null)
			{
				ShowMessageBoxWrapper("Directory creation failed. Check Log File folder name and permissions", "");
				return;
			}
		}
		StringBuilder stringBuilder = new StringBuilder();
		string text = cbMode.SelectedItem.ToString();
		string text2 = cbBand.SelectedItem.ToString();
		try
		{
			if (text.Contains("GPS_L5"))
			{
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\WB_IQ_GPSL5_GALE5A__0_RefScan.png", filePath + ".png");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\WB_IQ_GPSL5_GALE5A__0_RefScan.txt", filePath + ".txt");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\Summary_WB_IQ_GPSL5_GALE5A_0_RefScan.txt", filePath + "_Summary.txt");
				return;
			}
			if (text.Contains("GPS"))
			{
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\GPS_0_RefScan.png", filePath + ".png");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\GPS_0_RefScan.txt", filePath + ".txt");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\Summary_WB_IQ_GPS_0_RefScan.txt", filePath + "_Summary.txt");
				return;
			}
			if (text.Contains("GLO"))
			{
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\GLO_" + ncSingleChannel.Value + "_RefScan.png", filePath + ".png");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\GLO_" + ncSingleChannel.Value + "_RefScan.txt", filePath + ".txt");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\Summary_WB_IQ_GLO_" + ncSingleChannel.Value + "_RefScan.txt", filePath + "_Summary.txt");
				return;
			}
			if (text.Contains("BDS"))
			{
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\BDS_0_RefScan.png", filePath + ".png");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\BDS_0_RefScan.txt", filePath + ".txt");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\Summary_WB_IQ_BDS_0_RefScan.txt", filePath + "_Summary.txt");
				return;
			}
			if (text.Contains("GAL"))
			{
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\GAL_0_RefScan.png", filePath + ".png");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\GAL_0_RefScan.txt", filePath + ".txt");
				File.Copy("C:\\Qualcomm\\QDART\\Temp\\Summary_WB_IQ_GAL_0_RefScan.txt", filePath + "_Summary.txt");
				return;
			}
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper(ex.Message, "");
		}
		string text3 = "";
		bool flag = true;
		string text4 = "";
		foreach (Result res in ResList)
		{
			text3 = string.Format("{0},{1},{2},{3},{4}", "Time", "Mode", "Band", "Channel", "Freq");
			object[] array = new object[5] { res.DateTimeStamp, text, text2, null, null };
			int channelC = res.channelC0;
			array[3] = channelC.ToString();
			double freqC = res.freqC0;
			array[4] = freqC.ToString();
			text4 = string.Format("{0},{1},{2},{3},{4}", array);
			if (cbBW.Enabled)
			{
				string text5 = cbBW.SelectedItem.ToString();
				text3 += ",Bandwidth";
				text4 = text4 + "," + text5;
			}
			if (cbChain.Enabled)
			{
				string text6 = cbChain.SelectedItem.ToString();
				text3 += ",Chain";
				text4 = text4 + "," + text6;
			}
			if (cbMode.SelectedItem.ToString().Contains("WLAN"))
			{
				string text7 = "unk";
				if (chkBxWLANCh0.Checked && chkBxWLANCh1.Checked)
				{
					text7 = "CH0 + CH1";
				}
				else if (chkBxWLANCh0.Checked)
				{
					text7 = "CH0";
				}
				else if (chkBxWLANCh1.Checked)
				{
					text7 = "CH1";
				}
				text3 += ",Chain";
				text4 = text4 + "," + text7;
			}
			if (text.Contains("LTE") && chkBoxEnableTx.Checked)
			{
				text3 += ",StartRB";
				text4 = text4 + "," + tbStartRB.Text;
				text3 += ",NumRB";
				text4 = text4 + "," + tbNumRB.Text;
			}
			text3 += ",Num of Averages";
			text4 = text4 + "," + tbNoOfAverages.Text;
			if (cbMode.SelectedItem.ToString().Contains("WLAN"))
			{
				if (WLANrxChainMask == 1)
				{
					text3 += ",RX0";
					text4 = text4 + "," + Math.Round(res.rssiC0, 2);
				}
				else if (WLANrxChainMask == 2)
				{
					text3 += ",RX1";
					text4 = text4 + "," + Math.Round(res.rssiC0, 2);
				}
				else if (WLANrxChainMask == 3)
				{
					text3 += ",RX0";
					text4 = text4 + "," + Math.Round(res.rssiC0, 2);
					text3 += ",RX1";
					text4 = text4 + "," + Math.Round(res.rssiC1, 2);
				}
			}
			else
			{
				text3 += ",RX0";
				text4 = text4 + "," + Math.Round(res.rssiC0, 2);
				if (cbDiversity.Checked)
				{
					text3 += ",RX1";
					text4 = text4 + "," + Math.Round(res.rssiC1, 2);
				}
				if (cb_LTEC2C3.Checked)
				{
					text3 += ",RX2";
					text4 = text4 + "," + Math.Round(res.rssiC2, 2);
					text3 += ",RX3";
					text4 = text4 + "," + Math.Round(res.rssiC3, 2);
				}
			}
			if (chkboxCalScan.Checked)
			{
				text3 += ",CAL_TONE_PWR";
				text4 = text4 + "," + tbCalPower.Text;
				text3 += ",CAL_TONE_OFFSET";
				text4 = text4 + "," + tbCalOffset.Text;
			}
			if (chkBoxEnableTx.Checked)
			{
				text3 += ",TARGET_TX_PWR";
				text4 = text4 + "," + tbPower.Text;
			}
			if (radioButtonLimitLine.Checked)
			{
				if (cbMode.SelectedItem.ToString().Contains("WLAN"))
				{
					if (WLANrxChainMask == 1)
					{
						text3 += ",DELTA_RX0 (from Limit)";
						double result = 0.0;
						text4 = ((!double.TryParse(tbLimitLineRX0.Text, out result)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC0 - result, 2)));
					}
					else if (WLANrxChainMask == 2)
					{
						text3 += ",DELTA_RX1 (from Limit)";
						double result2 = 0.0;
						text4 = ((!double.TryParse(tbLimitLineRX0.Text, out result2)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC0 - result2, 2)));
					}
					else if (WLANrxChainMask == 3)
					{
						text3 += ",DELTA_RX0 (from Limit)";
						double result3 = 0.0;
						text4 = ((!double.TryParse(tbLimitLineRX0.Text, out result3)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC0 - result3, 2)));
						text3 += ",DELTA_RX1 (from Limit)";
						double result4 = 0.0;
						text4 = ((!double.TryParse(tbLimitLineRX1.Text, out result4)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC1 - result4, 2)));
					}
				}
				else
				{
					text3 += ",DELTA_RX0 (from Limit)";
					double result5 = 0.0;
					text4 = ((!double.TryParse(tbLimitLineRX0.Text, out result5)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC0 - result5, 2)));
					if (cbDiversity.Checked)
					{
						double result6 = 0.0;
						text3 += ",DELTA_RX1 (from Limit)";
						text4 = ((!double.TryParse(tbLimitLineRX1.Text, out result6)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC1 - result6, 2)));
					}
					if (cb_LTEC2C3.Checked)
					{
						double result7 = 0.0;
						text3 += ",DELTA_RX2 (from Limit)";
						text4 = ((!double.TryParse(tbLimitLineRX2.Text, out result7)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC2 - result7, 2)));
						double result8 = 0.0;
						text3 += ",DELTA_RX3 (from Limit)";
						text4 = ((!double.TryParse(tbLimitLineRX3.Text, out result8)) ? (text4 + ", ") : (text4 + "," + Math.Round(res.rssiC3 - result8, 2)));
					}
				}
			}
			else if (radioButtonDeltaLimit.Checked)
			{
				if (cbMode.SelectedItem.ToString().Contains("WLAN"))
				{
					if (WLANrxChainMask == 1)
					{
						text3 += ",DELTA_RX0 (from Parent)";
						bool flag2 = false;
						foreach (Result parentDataRes in ParentDataResList)
						{
							if (res.freqC0 == parentDataRes.freqC0 && parentDataRes.rssiC0 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC0 - parentDataRes.rssiC0, 2);
								flag2 = true;
							}
						}
						if (!flag2)
						{
							text4 += ", ";
						}
					}
					else if (WLANrxChainMask == 2)
					{
						text3 += ",DELTA_RX1 (from Parent)";
						bool flag3 = false;
						foreach (Result parentDataRes2 in ParentDataResList)
						{
							if (res.freqC0 == parentDataRes2.freqC0 && parentDataRes2.rssiC0 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC0 - parentDataRes2.rssiC0, 2);
								flag3 = true;
							}
						}
						if (!flag3)
						{
							text4 += ", ";
						}
					}
					else if (WLANrxChainMask == 3)
					{
						text3 += ",DELTA_RX0 (from Parent)";
						bool flag4 = false;
						foreach (Result parentDataRes3 in ParentDataResList)
						{
							if (res.freqC0 == parentDataRes3.freqC0 && parentDataRes3.rssiC0 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC0 - parentDataRes3.rssiC0, 2);
								flag4 = true;
							}
						}
						if (!flag4)
						{
							text4 += ", ";
						}
						text3 += ",DELTA_RX1 (from Parent)";
						flag4 = false;
						foreach (Result parentDataRes4 in ParentDataResList)
						{
							if (res.freqC1 == parentDataRes4.freqC1 && parentDataRes4.rssiC1 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC1 - parentDataRes4.rssiC1, 2);
								flag4 = true;
							}
						}
						if (!flag4)
						{
							text4 += ", ";
						}
					}
				}
				else
				{
					text3 += ",DELTA_RX0 (from Parent)";
					bool flag5 = false;
					foreach (Result parentDataRes5 in ParentDataResList)
					{
						if (res.freqC0 == parentDataRes5.freqC0 && parentDataRes5.rssiC0 != 9999.0)
						{
							text4 = text4 + "," + Math.Round(res.rssiC0 - parentDataRes5.rssiC0, 2);
							flag5 = true;
						}
					}
					if (!flag5)
					{
						text4 += ", ";
					}
					if (cbDiversity.Checked)
					{
						text3 += ",DELTA_RX1 (from Parent)";
						foreach (Result parentDataRes6 in ParentDataResList)
						{
							if (res.freqC0 == parentDataRes6.freqC0 && parentDataRes6.rssiC1 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC1 - parentDataRes6.rssiC1, 2);
								flag5 = true;
							}
						}
						if (!flag5)
						{
							text4 += ", ";
						}
					}
					if (cb_LTEC2C3.Checked)
					{
						text3 += ",DELTA_RX2 (from Parent)";
						foreach (Result parentDataRes7 in ParentDataResList)
						{
							if (res.freqC2 == parentDataRes7.freqC2 && parentDataRes7.rssiC2 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC2 - parentDataRes7.rssiC2, 2);
								flag5 = true;
							}
						}
						if (!flag5)
						{
							text4 += ", ";
						}
						text3 += ",DELTA_RX3 (from Parent)";
						foreach (Result parentDataRes8 in ParentDataResList)
						{
							if (res.freqC3 == parentDataRes8.freqC3 && parentDataRes8.rssiC3 != 9999.0)
							{
								text4 = text4 + "," + Math.Round(res.rssiC3 - parentDataRes8.rssiC3, 2);
								flag5 = true;
							}
						}
						if (!flag5)
						{
							text4 += ", ";
						}
					}
				}
			}
			if (flag)
			{
				stringBuilder.AppendLine(text3);
				stringBuilder.AppendLine(text4);
				flag = false;
			}
			else
			{
				stringBuilder.AppendLine(text4);
			}
		}
		if (filePath != "")
		{
			File.WriteAllText(filePath + ".csv", stringBuilder.ToString());
		}
		else
		{
			ShowMessageBoxWrapper("Error generating Log File Name", "");
		}
	}

	private void LogRawDataToCSV()
	{
		if (tbLogFileFolder.Text == "")
		{
			tbLogFileFolder.Text = "C:\\Temp\\NPT5";
		}
		if (!Directory.Exists(tbLogFileFolder.Text))
		{
			DirectoryInfo directoryInfo = Directory.CreateDirectory(tbLogFileFolder.Text);
			if (directoryInfo == null)
			{
				ShowMessageBoxWrapper("Directory creation failed. Check Log File folder name and permissions", "");
				return;
			}
		}
		StringBuilder stringBuilder = new StringBuilder();
		string text = cbMode.SelectedItem.ToString();
		string text2 = cbBand.SelectedItem.ToString();
		string text3 = "";
		bool flag = true;
		string text4 = "";
		foreach (Result res in ResList)
		{
			int num = 0;
			if (cbDiversity.Checked || (cbMode.SelectedItem.ToString().Contains("WLAN") && WLANrxChainMask == 3))
			{
				num = 1;
			}
			if (cb_LTEC2C3.Checked && (cbMode.SelectedItem.ToString().Contains("LTE") || cbMode.SelectedItem.ToString().Contains("SUB6")))
			{
				num = 3;
			}
			for (int i = 0; i <= num; i++)
			{
				text3 = string.Format("{0},{1},{2},{3},{4}", "Time", "Mode", "Band", "Channel", "Freq");
				object[] array = new object[5] { res.DateTimeStamp, text, text2, null, null };
				int channelC = res.channelC0;
				array[3] = channelC.ToString();
				double freqC = res.freqC0;
				array[4] = freqC.ToString();
				text4 = string.Format("{0},{1},{2},{3},{4}", array);
				if (cbBW.Enabled)
				{
					string text5 = cbBW.SelectedItem.ToString();
					text3 += ",Bandwidth";
					text4 = text4 + "," + text5;
				}
				if (cbChain.Enabled)
				{
					string text6 = cbChain.SelectedItem.ToString();
					text3 += ",Chain";
					text4 = text4 + "," + text6;
				}
				if (text.Contains("LTE") && chkBoxEnableTx.Checked)
				{
					text3 += ",StartRB";
					text4 = text4 + "," + tbStartRB.Text;
					text3 += ",NumRB";
					text4 = text4 + "," + tbNumRB.Text;
				}
				if (chkboxCalScan.Checked)
				{
					text3 += ",CAL_TONE_PWR";
					text4 = text4 + "," + tbCalPower.Text;
					text3 += ",CAL_TONE_OFFSET";
					text4 = text4 + "," + tbCalOffset.Text;
				}
				if (chkBoxEnableTx.Checked)
				{
					text3 += ",TARGET_TX_PWR";
					text4 = text4 + "," + tbPower.Text;
				}
				if (cbMode.SelectedItem.ToString().Contains("WLAN"))
				{
					if (num == 0)
					{
						if (chkBxWLANCh0.Checked)
						{
							text3 += ",RxId";
							text4 += ",0";
						}
						else if (chkBxWLANCh1.Checked)
						{
							text3 += ",RxId";
							text4 += ",1";
						}
					}
					else
					{
						text3 += ",RxId";
						text4 = text4 + "," + i;
					}
				}
				else
				{
					text3 += ",RxId";
					text4 = text4 + "," + i;
				}
				for (int j = 0; j < res.rawrssiC0list.Count; j++)
				{
					text3 = text3 + ",RX" + j.ToString("D4");
				}
				text3 += ",RxAGC_Mean";
				text3 += ",RxAGC_95thPercentile";
				text3 += ",RxAGC_Max";
				switch (i)
				{
				case 0:
				{
					for (int m = 0; m < res.rawrssiC0list.Count; m++)
					{
						text4 = text4 + "," + Math.Round(res.rawrssiC0list[m], 2);
					}
					text4 = text4 + "," + res.rawrssiC0list.Average();
					text4 = text4 + "," + Calculate95thPercentile(res.rawrssiC0list);
					text4 = text4 + "," + res.rawrssiC0list.Max();
					break;
				}
				case 1:
				{
					for (int l = 0; l < res.rawrssiC0list.Count; l++)
					{
						text4 = text4 + "," + Math.Round(res.rawrssiC1list[l], 2);
					}
					text4 = text4 + "," + res.rawrssiC1list.Average();
					text4 = text4 + "," + Calculate95thPercentile(res.rawrssiC1list);
					text4 = text4 + "," + res.rawrssiC1list.Max();
					break;
				}
				case 2:
				{
					for (int n = 0; n < res.rawrssiC0list.Count; n++)
					{
						text4 = text4 + "," + Math.Round(res.rawrssiC2list[n], 2);
					}
					text4 = text4 + "," + res.rawrssiC2list.Average();
					text4 = text4 + "," + Calculate95thPercentile(res.rawrssiC2list);
					text4 = text4 + "," + res.rawrssiC2list.Max();
					break;
				}
				case 3:
				{
					for (int k = 0; k < res.rawrssiC0list.Count; k++)
					{
						text4 = text4 + "," + Math.Round(res.rawrssiC3list[k], 2);
					}
					text4 = text4 + "," + res.rawrssiC3list.Average();
					text4 = text4 + "," + Calculate95thPercentile(res.rawrssiC3list);
					text4 = text4 + "," + res.rawrssiC3list.Max();
					break;
				}
				}
				if (flag)
				{
					stringBuilder.AppendLine(text3);
					stringBuilder.AppendLine(text4);
					flag = false;
					i = 0;
				}
				else
				{
					stringBuilder.AppendLine(text4);
				}
			}
		}
		if (filePath != "")
		{
			if (stringBuilder.ToString() != "")
			{
				File.WriteAllText(filePath + "_raw.csv", stringBuilder.ToString());
			}
		}
		else
		{
			ShowMessageBoxWrapper("Error generating raw log file name", "");
		}
	}

	private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
	{
		if (workerThread != null)
		{
			if (IsInitialized && cbOnlineModeOnExit.Checked)
			{
				SetOnlineMode();
				Thread.Sleep(100);
			}
			abortFlag = true;
			int num = 0;
			while (workerThread.ThreadState == System.Threading.ThreadState.Running && num <= 10000)
			{
				Thread.Sleep(500);
				num += 500;
			}
			Shutdown();
		}
		else if (IsInitialized)
		{
			if (cbOnlineModeOnExit.Checked)
			{
				SetOnlineMode();
			}
			Shutdown();
		}
	}

	private bool ReadConfigFile()
	{
		TechInformation = XMLHandler.ReadInXML();
		if (TechInformation == null)
		{
			return false;
		}
		numeric_BmId.Visible = false;
		label_BmId.Visible = false;
		foreach (TechInfo item in TechInformation)
		{
			if (item.VisibleOnGUI.Count > 0 && item.VisibleOnGUI[0] == "true")
			{
				cbMode.Items.Add(item.Alias);
			}
			if (item.Alias == "NR5GMMW")
			{
				numeric_BmId.Visible = true;
				label_BmId.Visible = true;
			}
		}
		cbMode.SelectedIndex = 0;
		return true;
	}

	private void cbMode_SelectedIndexChanged(object sender, EventArgs e)
	{
		string text = cbMode.SelectedItem.ToString();
		cbBand.Items.Clear();
		cbBW.Items.Clear();
		cbTxBW.Items.Clear();
		cbChipID.Items.Clear();
		cbChain.Items.Clear();
		chkBoxEnableTx.Checked = false;
		if (text.Contains("NR5GMMW"))
		{
			numeric_BmId.Enabled = true;
			label_BmId.Enabled = true;
		}
		else
		{
			numeric_BmId.Enabled = false;
			label_BmId.Enabled = false;
		}
		if (text.Contains("CDMA") || text.Contains("WCDMA") || text.Contains("TDSCDMA") || text.Contains("LTE") || text.Contains("GSM"))
		{
			cbDiversity.Enabled = true;
			cbDiversity.Checked = true;
			gbWWAN_ChainCtrl.Enabled = true;
			gbWLANCtrls.Enabled = false;
			cbModemType.Enabled = true;
			gbLimitTesting.Enabled = true;
			chkbxFTMDaemon.Enabled = false;
		}
		else if (text.Contains("WLAN"))
		{
			cbDiversity.Checked = false;
			cbDiversity.Enabled = false;
			gbWWAN_ChainCtrl.Enabled = false;
			cbModemType.Enabled = false;
			gbWLANCtrls.Enabled = true;
			chkBxWLANCh0.Checked = true;
			chkBxWLANCh1.Checked = false;
			gbLimitTesting.Enabled = true;
			chkbxFTMDaemon.Enabled = true;
		}
		else if (text.Contains("BT") || text.Contains("FM"))
		{
			gbWLANCtrls.Enabled = false;
			cbDiversity.Checked = false;
			cbDiversity.Enabled = false;
			cbModemType.Enabled = false;
			gbWWAN_ChainCtrl.Enabled = false;
			gbLimitTesting.Enabled = true;
			chkbxFTMDaemon.Enabled = true;
		}
		else if (text.Contains("GPS") || text.Contains("GLONASS") || text.Contains("BDS") || text.Contains("GALILEO"))
		{
			gbWWAN_ChainCtrl.Enabled = false;
			gbWLANCtrls.Enabled = false;
			gbLimitTesting.Enabled = false;
			chkbxFTMDaemon.Enabled = false;
		}
		else if (text.Contains("NR5GMMW"))
		{
			cbDiversity.Enabled = true;
			cbDiversity.Checked = false;
			gbWWAN_ChainCtrl.Enabled = true;
			gbWLANCtrls.Enabled = false;
			cbModemType.Enabled = true;
			gbLimitTesting.Enabled = true;
			chkbxFTMDaemon.Enabled = false;
		}
		else if (text.Contains("NR5GSUB6"))
		{
			cbDiversity.Enabled = true;
			cbDiversity.Checked = true;
			gbWWAN_ChainCtrl.Enabled = true;
			gbWLANCtrls.Enabled = false;
			cbModemType.Enabled = true;
			gbLimitTesting.Enabled = true;
			chkbxFTMDaemon.Enabled = false;
		}
		foreach (TechInfo item in TechInformation)
		{
			if (!(item.Alias == text))
			{
				continue;
			}
			if (item.TxSupportedOnGUI.Count > 0 && item.TxSupportedOnGUI[0] == "true")
			{
				GroupBoxTransmitter.Enabled = true;
			}
			else
			{
				GroupBoxTransmitter.Enabled = false;
				chkBoxEnableTx.Checked = false;
			}
			if (item.MaxPower.Count > 0)
			{
				tbPower.Text = item.MaxPower[0];
			}
			else
			{
				tbPower.Text = "";
				chkBoxEnableTx.Checked = false;
			}
			foreach (BandToChans bandAndChannel in item.BandAndChannels)
			{
				string[] array = bandAndChannel.Band.Split(' ');
				string text2 = "";
				for (int i = 1; i < array.Count(); i++)
				{
					text2 += array[i];
				}
				cbBand.Items.Add(text2);
			}
			if (item.ConnectivityIDs.Count > 0)
			{
				cbChipID.Enabled = true;
				foreach (string connectivityID in item.ConnectivityIDs)
				{
					string[] array2 = connectivityID.Split(' ');
					string text3 = "";
					for (int j = 1; j < array2.Count(); j++)
					{
						text3 += array2[j];
					}
					cbChipID.Items.Add(text3);
				}
			}
			else
			{
				cbChipID.Items.Clear();
				cbChipID.Enabled = false;
				cbWLANPhyId.Enabled = false;
				lbPhyId.Enabled = false;
				cbMeasMode.Enabled = false;
			}
			tbCalOffset.Text = "200";
			tbCalPower.Text = "-85";
			NoOfMeasurements = "20";
			if (item.ParamsWhenVictim.Count > 0)
			{
				foreach (Parameter item2 in item.ParamsWhenVictim)
				{
					if (item2.Name == "Victim ADB pre Ref Command Sequence")
					{
						victim_preRef = item2.Value;
					}
					if (item2.Name == "Victim ADB FTM Daemon Check Command Sequence")
					{
						victim_daemonCheck = item2.Value;
					}
					if (item2.Name == "eepFName")
					{
						eepFName = item2.Value;
					}
					if (item2.Name == "Number of Measurements")
					{
						NoOfMeasurements = item2.Value;
					}
					if (item2.Name == "Constellation Type")
					{
						GNSSConstellationType = item2.Value;
					}
					if (item2.Name == "Collect Mode")
					{
						GNSSCollectMode = item2.Value;
					}
					if (item2.Name == "Test Equipment Automation type")
					{
						GNSSTestEquipmentAutomationType = item2.Value;
					}
					if (item2.Name == "GLO hardware channel to be used")
					{
						GLOHWChannel = item2.Value;
					}
					if (item2.Name == "Signal Generator Offset")
					{
						GNSSSigGenOffset = item2.Value;
						tbCalOffset.Text = item2.Value;
					}
					if (item2.Name == "Signal Generator Level")
					{
						GNSSSigGenLevel = item2.Value;
						tbCalPower.Text = item2.Value;
					}
					if (item2.Name == "kilo samples")
					{
						GNSSkiloSamples = item2.Value;
					}
					if (item2.Name == "Number of Incoherent Integrations")
					{
						GNSSIntegrations = item2.Value;
					}
					if (item2.Name == "Auto-switch GNSS Ext LNA mode")
					{
						GNSSAutoSwitchExtLNA = item2.Value;
					}
					if (item2.Name == "Disable Auto OTFSA?")
					{
						GNSSOTFSADisabled = item2.Value;
					}
					if (item2.Name == "Generate FFT bin files")
					{
						GNSSGenerateFFTBinFiles = item2.Value;
					}
					if (item2.Name == "WCN3990 2G Rx Gain Index")
					{
						WLAN2GRxGainIndex = item2.Value;
					}
					if (item2.Name == "WCN3990 5G Rx Gain Index")
					{
						WLAN5GRxGainIndex = item2.Value;
					}
					if (item2.Name == "Victim1 2G xLNA State")
					{
						WLAN2GxLNAState = item2.Value;
					}
					if (item2.Name == "Victim1 5G xLNA State")
					{
						WLAN5GxLNAState = item2.Value;
					}
					if (item2.Name == "FTM TX Measure")
					{
						FTMTxMeasure = item2.Value;
					}
				}
			}
			tbNoOfAverages.Text = NoOfMeasurements;
			if (item.SupportedVictimChainsOnGUI.Count > 0)
			{
				cbChain.Enabled = true;
				lbChainSub.Enabled = true;
				foreach (string item3 in item.SupportedVictimChainsOnGUI)
				{
					if (int.TryParse(item3, out var result))
					{
						cbChain.Items.Add(result);
					}
				}
			}
			else
			{
				cbChain.Items.Clear();
				cbChain.Enabled = false;
				lbChainSub.Enabled = false;
			}
			if (text.Contains("GPS") || text.Contains("GLO") || text.Contains("BDS") || text.Contains("GAL"))
			{
				cbTEControlType.Enabled = true;
			}
			else
			{
				cbTEControlType.Enabled = false;
			}
		}
		if (cbBand.Items.Count > 0)
		{
			cbBand.SelectedIndex = 0;
		}
		if (cbChipID.Items.Count > 0)
		{
			cbChipID.SelectedIndex = 0;
		}
		if (cbChain.Items.Count > 0)
		{
			cbChain.SelectedIndex = 0;
		}
	}

	private void cbBand_SelectedIndexChanged(object sender, EventArgs e)
	{
		string text = cbMode.SelectedItem.ToString();
		string text2 = cbBand.SelectedItem.ToString();
		chkboxChList1.Enabled = false;
		chkboxChList2.Enabled = false;
		chkboxChList3.Enabled = false;
		chkboxChList4.Enabled = false;
		chkboxChList5.Enabled = false;
		ncStart1.Enabled = false;
		ncStart2.Enabled = false;
		ncStart3.Enabled = false;
		ncStart4.Enabled = false;
		ncStart5.Enabled = false;
		ncStop1.Enabled = false;
		ncStop2.Enabled = false;
		ncStop3.Enabled = false;
		ncStop4.Enabled = false;
		ncStop5.Enabled = false;
		tbStep1.Enabled = false;
		tbStep2.Enabled = false;
		tbStep3.Enabled = false;
		tbStep4.Enabled = false;
		tbStep5.Enabled = false;
		cbBW.Items.Clear();
		cbBW.Enabled = false;
		cbTxBW.Items.Clear();
		cbTxBW.Enabled = false;
		foreach (TechInfo item in TechInformation)
		{
			if (item.Alias == text)
			{
				clearChannelControls();
				int num = 0;
				foreach (BandToChans bandAndChannel in item.BandAndChannels)
				{
					string[] array = bandAndChannel.Band.Split(' ');
					string text3 = "";
					for (int i = 1; i < array.Count(); i++)
					{
						text3 += array[i];
					}
					if (!(text2 == text3))
					{
						continue;
					}
					int.TryParse(array[0], out SelectedRFModeEnumValue);
					string chans = bandAndChannel.Chans;
					array = chans.Split(',');
					for (int j = 0; j < array.Length; j++)
					{
						if (array[j].StartsWith("SSS"))
						{
							string sssIn = array[j] + "," + array[j + 1] + "," + array[j + 2];
							setSSS(sssIn, num++);
						}
					}
					break;
				}
			}
			if (!(item.Alias == text))
			{
				continue;
			}
			foreach (BandToChans bandAndChannel2 in item.BandAndChannels)
			{
				string text4 = "";
				string text5 = "";
				string[] array2 = bandAndChannel2.Band.Split(' ');
				for (int k = 1; k < array2.Count(); k++)
				{
					text4 += array2[k];
				}
				if (!(text4 == text2))
				{
					continue;
				}
				if (bandAndChannel2.Bandwidths.Count > 0)
				{
					cbBW.Enabled = true;
					cbTxBW.Enabled = true;
					foreach (string bandwidth in bandAndChannel2.Bandwidths)
					{
						array2 = bandwidth.Split(' ');
						text5 = "";
						for (int l = 1; l < array2.Count(); l++)
						{
							text5 += array2[l];
						}
						cbBW.Items.Add(text5);
						cbTxBW.Items.Add(text5);
						if (text.Contains("NR5GMMW"))
						{
							cbBW.Text = "100MHz";
							cbTxBW.Text = "100MHz";
						}
						else if (text.Contains("NR5GSUB6"))
						{
							cbBW.SelectedIndex = 0;
							cbTxBW.SelectedIndex = 0;
						}
						else
						{
							cbBW.Text = "10MHz";
							cbTxBW.Text = "10MHz";
						}
					}
				}
				else
				{
					cbBW.Items.Clear();
					cbBW.Enabled = false;
					cbTxBW.Items.Clear();
					cbTxBW.Enabled = false;
				}
			}
		}
		if (text.Contains("WLAN"))
		{
			if (tbStep1.Enabled)
			{
				tbStep1.Enabled = false;
			}
			if (tbStep2.Enabled)
			{
				tbStep2.Enabled = false;
			}
			if (tbStep3.Enabled)
			{
				tbStep3.Enabled = false;
			}
			if (tbStep4.Enabled)
			{
				tbStep4.Enabled = false;
			}
			if (tbStep5.Enabled)
			{
				tbStep5.Enabled = false;
			}
		}
		ValidateBandEdgeChannels();
		if (text2.Contains("GPS") || text2.Contains("GLO") || text2.Contains("BDS") || text2.Contains("GAL"))
		{
			chkBoxSingleChMode.Checked = true;
			chkBoxSingleChMode.Enabled = false;
		}
		else
		{
			chkBoxSingleChMode.Checked = false;
			chkBoxSingleChMode.Enabled = true;
		}
	}

	private string getChannelListString()
	{
		int num = 0;
		int num2 = 0;
		int num3 = 0;
		int num4 = 0;
		int num5 = 0;
		int num6 = 0;
		int num7 = 0;
		int num8 = 0;
		int num9 = 0;
		int num10 = 0;
		string text = "";
		if (!chkBoxSingleChMode.Checked)
		{
			if (chkboxChList1.Checked)
			{
				num = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStart1.Value));
				num6 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStop1.Value));
				object obj = text;
				text = string.Concat(obj, "SSS(", num, ",", num6, ",", tbStep1.Text, "),");
			}
			if (chkboxChList2.Checked)
			{
				num2 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStart2.Value));
				num7 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStop2.Value));
				object obj2 = text;
				text = string.Concat(obj2, "SSS(", num2, ",", num7, ",", tbStep2.Text, "),");
			}
			if (chkboxChList3.Checked)
			{
				num3 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStart3.Value));
				num8 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStop3.Value));
				object obj3 = text;
				text = string.Concat(obj3, "SSS(", num3, ",", num8, ",", tbStep3.Text, "),");
			}
			if (chkboxChList4.Checked)
			{
				num4 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStart4.Value));
				num9 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStop4.Value));
				object obj4 = text;
				text = string.Concat(obj4, "SSS(", num4, ",", num9, ",", tbStep4.Text, "),");
			}
			if (chkboxChList5.Checked)
			{
				num5 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStart5.Value));
				num10 = GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncStop5.Value));
				object obj5 = text;
				text = string.Concat(obj5, "SSS(", num5, ",", num10, ",", tbStep5.Text, "),");
			}
			return text.Substring(0, text.Length - 1);
		}
		return Convert.ToString(GetULChannelWrapper(SelectedRFModeEnumValue, Convert.ToInt32(ncSingleChannel.Value)));
	}

	private int GetULChannelWrapper(int RfModeEnumValue, int DLChannel)
	{
		string text = cbMode.SelectedItem.ToString();
		if (text.Contains("WLAN") || text.Contains("BT") || text.Contains("FM") || text.Contains("GPS") || text.Contains("GLO") || text.Contains("BDS") || text.Contains("GAL"))
		{
			return DLChannel;
		}
		return GetULChannel(RfModeEnumValue, DLChannel);
	}

	private void InitializeFilePath()
	{
		filePath = "";
		string text = cbMode.SelectedItem.ToString();
		string text2 = cbBand.SelectedItem.ToString();
		if (tbLogFileFolder.Text == "")
		{
			tbLogFileFolder.Text = "C:\\Temp\\NPT5";
		}
		filePath = tbLogFileFolder.Text + "\\";
		if (logFilePrefix != "")
		{
			filePath = filePath + logFilePrefix + "_";
		}
		filePath = filePath + ID + "_";
		if (!text2.Contains(text))
		{
			filePath += text;
		}
		filePath = filePath + text2 + "_";
		if (chkBoxSingleChMode.Checked)
		{
			object obj = filePath;
			filePath = string.Concat(obj, "CH", ncSingleChannel.Value, "_");
		}
		filePath += DateTime.Now.ToString("yyMMddhmmss");
	}

	private string getRfModeString()
	{
		string text = cbMode.SelectedItem.ToString();
		string text2 = cbBand.SelectedItem.ToString();
		foreach (TechInfo item in TechInformation)
		{
			if (!(item.Alias == text))
			{
				continue;
			}
			foreach (BandToChans bandAndChannel in item.BandAndChannels)
			{
				string[] array = bandAndChannel.Band.Split(' ');
				string text3 = "";
				for (int i = 1; i < array.Count(); i++)
				{
					text3 += array[i];
				}
				if (text2 == text3)
				{
					return array[0];
				}
			}
			break;
		}
		throw new Exception("Could not find RF Mode");
	}

	private bool getLTERXBWenumString(out string BWenumStr)
	{
		BWenumStr = "";
		string text = "";
		string text2 = "";
		if (cbMode.SelectedIndex > -1)
		{
			text = cbMode.SelectedItem.ToString();
		}
		if (cbBand.SelectedIndex > -1)
		{
			text2 = cbBand.SelectedItem.ToString();
		}
		foreach (TechInfo item in TechInformation)
		{
			if (!(item.Alias == text))
			{
				continue;
			}
			foreach (BandToChans bandAndChannel in item.BandAndChannels)
			{
				string text3 = "";
				string text4 = "";
				string[] array = bandAndChannel.Band.Split(' ');
				for (int i = 1; i < array.Count(); i++)
				{
					text3 += array[i];
				}
				if (!(text3 == text2) || bandAndChannel.Bandwidths.Count <= 0)
				{
					continue;
				}
				foreach (string bandwidth in bandAndChannel.Bandwidths)
				{
					array = bandwidth.Split(' ');
					text4 = "";
					for (int j = 1; j < array.Count(); j++)
					{
						text4 += array[j];
					}
					if ((string)cbBW.SelectedItem == text4)
					{
						BWenumStr = array[0];
						return true;
					}
				}
			}
		}
		return false;
	}

	private bool getLTETXBWenumString(out string BWenumStr)
	{
		BWenumStr = "";
		string text = "";
		string text2 = "";
		if (cbMode.SelectedIndex > -1)
		{
			text = cbMode.SelectedItem.ToString();
		}
		if (cbBand.SelectedIndex > -1)
		{
			text2 = cbBand.SelectedItem.ToString();
		}
		foreach (TechInfo item in TechInformation)
		{
			if (!(item.Alias == text))
			{
				continue;
			}
			foreach (BandToChans bandAndChannel in item.BandAndChannels)
			{
				string text3 = "";
				string text4 = "";
				string[] array = bandAndChannel.Band.Split(' ');
				for (int i = 1; i < array.Count(); i++)
				{
					text3 += array[i];
				}
				if (!(text3 == text2) || bandAndChannel.Bandwidths.Count <= 0)
				{
					continue;
				}
				foreach (string bandwidth in bandAndChannel.Bandwidths)
				{
					array = bandwidth.Split(' ');
					text4 = "";
					for (int j = 1; j < array.Count(); j++)
					{
						text4 += array[j];
					}
					if ((string)cbTxBW.SelectedItem == text4)
					{
						BWenumStr = array[0];
						return true;
					}
				}
			}
		}
		return false;
	}

	private void clearChannelControls()
	{
		NumericUpDown numericUpDown = ncStart1;
		NumericUpDown numericUpDown2 = ncStop1;
		NumericUpDown numericUpDown3 = ncStart1;
		decimal num2 = (ncStop1.Maximum = 0m);
		decimal num4 = (numericUpDown3.Maximum = num2);
		decimal minimum = (numericUpDown2.Minimum = num4);
		numericUpDown.Minimum = minimum;
		NumericUpDown numericUpDown4 = ncStart1;
		decimal value = (ncStop1.Value = 0m);
		numericUpDown4.Value = value;
		tbStep1.Text = "";
		chkboxChList1.Checked = false;
		NumericUpDown numericUpDown5 = ncStart2;
		NumericUpDown numericUpDown6 = ncStop2;
		NumericUpDown numericUpDown7 = ncStart2;
		decimal num8 = (ncStop2.Maximum = 0m);
		decimal num10 = (numericUpDown7.Maximum = num8);
		decimal minimum2 = (numericUpDown6.Minimum = num10);
		numericUpDown5.Minimum = minimum2;
		NumericUpDown numericUpDown8 = ncStart2;
		decimal value2 = (ncStop2.Value = 0m);
		numericUpDown8.Value = value2;
		tbStep2.Text = "";
		chkboxChList2.Checked = false;
		NumericUpDown numericUpDown9 = ncStart3;
		NumericUpDown numericUpDown10 = ncStop3;
		NumericUpDown numericUpDown11 = ncStart3;
		decimal num14 = (ncStop3.Maximum = 0m);
		decimal num16 = (numericUpDown11.Maximum = num14);
		decimal minimum3 = (numericUpDown10.Minimum = num16);
		numericUpDown9.Minimum = minimum3;
		NumericUpDown numericUpDown12 = ncStart3;
		decimal value3 = (ncStop3.Value = 0m);
		numericUpDown12.Value = value3;
		tbStep3.Text = "";
		chkboxChList3.Checked = false;
		NumericUpDown numericUpDown13 = ncStart4;
		NumericUpDown numericUpDown14 = ncStop4;
		NumericUpDown numericUpDown15 = ncStart4;
		decimal num20 = (ncStop4.Maximum = 0m);
		decimal num22 = (numericUpDown15.Maximum = num20);
		decimal minimum4 = (numericUpDown14.Minimum = num22);
		numericUpDown13.Minimum = minimum4;
		NumericUpDown numericUpDown16 = ncStart4;
		decimal value4 = (ncStop4.Value = 0m);
		numericUpDown16.Value = value4;
		tbStep4.Text = "";
		chkboxChList4.Checked = false;
		NumericUpDown numericUpDown17 = ncStart5;
		NumericUpDown numericUpDown18 = ncStop5;
		NumericUpDown numericUpDown19 = ncStart5;
		decimal num26 = (ncStop5.Maximum = 0m);
		decimal num28 = (numericUpDown19.Maximum = num26);
		decimal minimum5 = (numericUpDown18.Minimum = num28);
		numericUpDown17.Minimum = minimum5;
		NumericUpDown numericUpDown20 = ncStart5;
		decimal value5 = (ncStop5.Value = 0m);
		numericUpDown20.Value = value5;
		tbStep5.Text = "";
		chkboxChList5.Checked = false;
	}

	private void SetAllChannelControlsState(bool IsEnabled, bool EnableOnlySelectedRows)
	{
		if (!IsEnabled)
		{
			chkboxChList1.Enabled = IsEnabled;
			chkboxChList2.Enabled = IsEnabled;
			chkboxChList3.Enabled = IsEnabled;
			chkboxChList4.Enabled = IsEnabled;
			chkboxChList5.Enabled = IsEnabled;
			ncStart1.Enabled = IsEnabled;
			ncStart2.Enabled = IsEnabled;
			ncStart3.Enabled = IsEnabled;
			ncStart4.Enabled = IsEnabled;
			ncStart5.Enabled = IsEnabled;
			ncStop1.Enabled = IsEnabled;
			ncStop2.Enabled = IsEnabled;
			ncStop3.Enabled = IsEnabled;
			ncStop4.Enabled = IsEnabled;
			ncStop5.Enabled = IsEnabled;
			tbStep1.Enabled = IsEnabled;
			tbStep2.Enabled = IsEnabled;
			tbStep3.Enabled = IsEnabled;
			tbStep4.Enabled = IsEnabled;
			tbStep5.Enabled = IsEnabled;
			return;
		}
		if (chkboxChList1.Checked)
		{
			chkboxChList1.Enabled = IsEnabled;
			ncStart1.Enabled = IsEnabled;
			ncStop1.Enabled = IsEnabled;
			tbStep1.Enabled = IsEnabled;
		}
		if (chkboxChList2.Checked)
		{
			chkboxChList2.Enabled = IsEnabled;
			ncStart2.Enabled = IsEnabled;
			ncStop2.Enabled = IsEnabled;
			tbStep2.Enabled = IsEnabled;
		}
		if (chkboxChList3.Checked)
		{
			chkboxChList3.Enabled = IsEnabled;
			ncStart3.Enabled = IsEnabled;
			ncStop3.Enabled = IsEnabled;
			tbStep3.Enabled = IsEnabled;
		}
		if (chkboxChList4.Checked)
		{
			chkboxChList4.Enabled = IsEnabled;
			ncStart4.Enabled = IsEnabled;
			ncStop4.Enabled = IsEnabled;
			tbStep4.Enabled = IsEnabled;
		}
		if (chkboxChList5.Checked)
		{
			chkboxChList5.Enabled = IsEnabled;
			ncStart5.Enabled = IsEnabled;
			ncStop5.Enabled = IsEnabled;
		}
	}

	private void setSSS(string sssIn, int index)
	{
		try
		{
			if (!IsInitialized)
			{
				Init();
				IsInitialized = true;
			}
			string[] array = sssIn.Split('(');
			array = array[1].Split(')');
			array = array[0].Split(',');
			string text = cbMode.SelectedItem.ToString();
			int num;
			int num2;
			if (!text.Contains("BT") && !text.Contains("WLAN") && !text.Contains("FM") && !text.Contains("GPS") && !text.Contains("GLO") && !text.Contains("BDS") && !text.Contains("GAL"))
			{
				num = GetDLChannel(SelectedRFModeEnumValue, Convert.ToInt32(array[0]));
				num2 = GetDLChannel(SelectedRFModeEnumValue, Convert.ToInt32(array[1]));
			}
			else
			{
				num = Convert.ToInt32(array[0]);
				num2 = Convert.ToInt32(array[1]);
			}
			switch (index)
			{
			case 0:
			{
				NumericUpDown numericUpDown9 = ncStart1;
				decimal minimum5 = (ncStop1.Minimum = Convert.ToDecimal(num));
				numericUpDown9.Minimum = minimum5;
				NumericUpDown numericUpDown10 = ncStart1;
				decimal maximum5 = (ncStop1.Maximum = Convert.ToDecimal(num2));
				numericUpDown10.Maximum = maximum5;
				ncStart1.Value = ncStart1.Minimum;
				ncStop1.Value = ncStart1.Maximum;
				tbStep1.Text = array[2];
				StartCh1 = num;
				StopCh1 = num2;
				chkboxChList1.Enabled = true;
				chkboxChList1.Checked = true;
				ncStart1.Enabled = true;
				ncStop1.Enabled = true;
				tbStep1.Enabled = true;
				break;
			}
			case 1:
			{
				NumericUpDown numericUpDown7 = ncStart2;
				decimal minimum4 = (ncStop2.Minimum = Convert.ToDecimal(num));
				numericUpDown7.Minimum = minimum4;
				NumericUpDown numericUpDown8 = ncStart2;
				decimal maximum4 = (ncStop2.Maximum = Convert.ToDecimal(num2));
				numericUpDown8.Maximum = maximum4;
				ncStart2.Value = ncStart2.Minimum;
				ncStop2.Value = ncStart2.Maximum;
				tbStep2.Text = array[2];
				StartCh2 = num;
				StopCh2 = num2;
				chkboxChList2.Enabled = true;
				chkboxChList2.Checked = true;
				ncStart2.Enabled = true;
				ncStop2.Enabled = true;
				tbStep2.Enabled = true;
				break;
			}
			case 2:
			{
				NumericUpDown numericUpDown5 = ncStart3;
				decimal minimum3 = (ncStop3.Minimum = Convert.ToDecimal(num));
				numericUpDown5.Minimum = minimum3;
				NumericUpDown numericUpDown6 = ncStart3;
				decimal maximum3 = (ncStop3.Maximum = Convert.ToDecimal(num2));
				numericUpDown6.Maximum = maximum3;
				ncStart3.Value = ncStart3.Minimum;
				ncStop3.Value = ncStart3.Maximum;
				tbStep3.Text = array[2];
				StartCh3 = num;
				StopCh3 = num2;
				chkboxChList3.Enabled = true;
				chkboxChList3.Checked = true;
				ncStart3.Enabled = true;
				ncStop3.Enabled = true;
				tbStep3.Enabled = true;
				break;
			}
			case 3:
			{
				NumericUpDown numericUpDown3 = ncStart4;
				decimal minimum2 = (ncStop4.Minimum = Convert.ToDecimal(num));
				numericUpDown3.Minimum = minimum2;
				NumericUpDown numericUpDown4 = ncStart4;
				decimal maximum2 = (ncStop4.Maximum = Convert.ToDecimal(num2));
				numericUpDown4.Maximum = maximum2;
				ncStart4.Value = ncStart4.Minimum;
				ncStop4.Value = ncStart4.Maximum;
				tbStep4.Text = array[2];
				StartCh4 = num;
				StopCh4 = num2;
				chkboxChList4.Enabled = true;
				chkboxChList4.Checked = true;
				ncStart4.Enabled = true;
				ncStop4.Enabled = true;
				tbStep4.Enabled = true;
				break;
			}
			case 4:
			{
				NumericUpDown numericUpDown = ncStart5;
				decimal minimum = (ncStop5.Minimum = Convert.ToDecimal(num));
				numericUpDown.Minimum = minimum;
				NumericUpDown numericUpDown2 = ncStart5;
				decimal maximum = (ncStop5.Maximum = Convert.ToDecimal(num2));
				numericUpDown2.Maximum = maximum;
				ncStart5.Value = ncStart5.Minimum;
				ncStop5.Value = ncStart5.Maximum;
				tbStep5.Text = array[2];
				StartCh5 = num;
				StopCh5 = num2;
				chkboxChList5.Enabled = true;
				chkboxChList5.Checked = true;
				ncStart5.Enabled = true;
				ncStop5.Enabled = true;
				tbStep5.Enabled = true;
				break;
			}
			}
			ConfigureUIForSingleChannelMode();
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper(ex.Message, "");
		}
	}

	private decimal GetLowestChannelForSelectedBand()
	{
		List<decimal> list = new List<decimal>();
		if (chkboxChList1.Checked)
		{
			list.Add(ncStart1.Value);
		}
		if (chkboxChList2.Checked)
		{
			list.Add(ncStart2.Value);
		}
		if (chkboxChList3.Checked)
		{
			list.Add(ncStart3.Value);
		}
		if (chkboxChList4.Checked)
		{
			list.Add(ncStart4.Value);
		}
		if (chkboxChList5.Checked)
		{
			list.Add(ncStart5.Value);
		}
		if (list.Count > 0)
		{
			return list.Min();
		}
		ShowMessageBoxWrapper("Error: No channel is defined", "");
		return 0m;
	}

	private decimal GetHighestChannelForSelectedBand()
	{
		List<decimal> list = new List<decimal>();
		if (chkboxChList1.Checked)
		{
			list.Add(ncStop1.Value);
		}
		if (chkboxChList2.Checked)
		{
			list.Add(ncStop2.Value);
		}
		if (chkboxChList3.Checked)
		{
			list.Add(ncStop3.Value);
		}
		if (chkboxChList4.Checked)
		{
			list.Add(ncStop4.Value);
		}
		if (chkboxChList5.Checked)
		{
			list.Add(ncStop5.Value);
		}
		if (list.Count > 0)
		{
			return list.Max();
		}
		ShowMessageBoxWrapper("Error: No channel is defined", "");
		return 0m;
	}

	private void button1_Click(object sender, EventArgs e)
	{
		string rfModeString = getRfModeString();
		SetNptGuiParam("rf_mode", rfModeString);
		string channelListString = getChannelListString();
		SetNptGuiParam("victimChannels", channelListString);
	}

	private void chkBoxEnableTx_CheckedChanged(object sender, EventArgs e)
	{
		string text = cbMode.SelectedItem.ToString();
		if (chkBoxEnableTx.Checked)
		{
			if (text.Contains("LTE"))
			{
				groupBoxRB.Enabled = true;
			}
		}
		else
		{
			groupBoxRB.Enabled = false;
		}
		ValidateBandEdgeChannels();
	}

	private void InitializeControls()
	{
		groupBoxRB.Enabled = false;
		cbDiversity.Checked = true;
		radioButtonOff.Checked = true;
		tbLimitLineRX0.Enabled = false;
		tbLimitLineRX1.Enabled = false;
		tbLimitLineRX2.Enabled = false;
		tbLimitLineRX3.Enabled = false;
		tbDeltaLimitRX0.Enabled = false;
		tbDeltaLimitRX1.Enabled = false;
		tbDeltaLimitRX2.Enabled = false;
		tbDeltaLimitRX3.Enabled = false;
		tbParentDataFile.Enabled = false;
		bnBrowseDataFile.Enabled = false;
		labelDataFile1.Enabled = false;
		labelDataFile2.Enabled = false;
		tbLogFileFolder.Text = "C:\\Temp\\NPT5";
		chkboxCalScan.Checked = false;
		tbCalPower.Text = "-85";
		tbCalOffset.Text = "200";
		ncStartDelay.Value = 0m;
		cbTEControlType.SelectedIndex = 0;
		cbAntennaSwitch.SelectedIndex = 0;
		if (Settings.Default.Ftmdaemon == 1)
		{
			chkbxFTMDaemon.Checked = true;
		}
		else
		{
			chkbxFTMDaemon.Checked = false;
		}
		if (Settings.Default.ModemType == 1)
		{
			cbModemType.SelectedIndex = 1;
		}
		else
		{
			cbModemType.SelectedIndex = 0;
		}
		if (Settings.Default.AveragingType == 0)
		{
			cbRSSIType.SelectedIndex = 0;
		}
		else if (Settings.Default.AveragingType == 1)
		{
			cbRSSIType.SelectedIndex = 1;
		}
		else if (Settings.Default.AveragingType == 2)
		{
			cbRSSIType.SelectedIndex = 2;
		}
		if (Settings.Default.marktransients == 1)
		{
			cbTransientCheck.Checked = true;
		}
		else
		{
			cbTransientCheck.Checked = false;
		}
		if (Settings.Default.UDT_Mode == 1)
		{
			cb_UDTMode.Checked = true;
		}
		else
		{
			cb_UDTMode.Checked = false;
		}
		tb_UDTIp.Text = Settings.Default.UDT_IPAddress;
	}

	private void chkboxMaxPower_CheckedChanged(object sender, EventArgs e)
	{
		string text = cbMode.SelectedItem.ToString();
		if (chkboxMaxPower.Checked)
		{
			foreach (TechInfo item in TechInformation)
			{
				if (item.Alias == text && item.MaxPower.Count > 0)
				{
					tbPower.Text = item.MaxPower[0];
					tbPower.Enabled = false;
				}
			}
			return;
		}
		tbPower.Enabled = true;
	}

	private void bnCheckPhoneConnected_Click(object sender, EventArgs e)
	{
		CheckPhoneConnection();
	}

	private bool CheckPhoneConnection()
	{
		if (!IsInitialized)
		{
			Init();
			IsInitialized = true;
		}
		bool flag = false;
		if (cb_UDTMode.Checked)
		{
			return true;
		}
		for (int i = 0; i < 5; i++)
		{
			flag = IsPhoneConnected();
			if (flag)
			{
				break;
			}
			Thread.Sleep(500);
		}
		Thread.Sleep(1000);
		if (flag)
		{
			IntPtr intPtr = Marshal.AllocHGlobal(1024);
			int ComportNo;
			if (chkboxTargetDeviceType.Checked)
			{
				ComportNo = GetAPQPhoneComport(intPtr, 1024);
			}
			else
			{
				ComportNo = GetPhoneComportAndID(intPtr, 1024);
			}
			string retval = Marshal.PtrToStringAnsi(intPtr);
			Marshal.FreeHGlobal(intPtr);
			BeginInvoke((MethodInvoker)delegate
			{
				tbImei.Text = retval;
			});
			ID = retval;
			BeginInvoke((MethodInvoker)delegate
			{
				labelPhoneStatus.ForeColor = Color.Green;
			});
			BeginInvoke((MethodInvoker)delegate
			{
				labelPhoneStatus.Text = "Phone detected at " + Environment.NewLine + "COM port " + ComportNo;
			});
			return true;
		}
		BeginInvoke((MethodInvoker)delegate
		{
			labelPhoneStatus.ForeColor = Color.Red;
		});
		BeginInvoke((MethodInvoker)delegate
		{
			labelPhoneStatus.Text = "No phone detected!";
		});
		tbImei.Text = "";
		return false;
	}

	private void radioButtonLimitLine_CheckedChanged(object sender, EventArgs e)
	{
		if (radioButtonLimitLine.Checked)
		{
			tbLimitLineRX0.Enabled = true;
			tbLimitLineRX1.Enabled = true;
			tbLimitLineRX2.Enabled = true;
			tbLimitLineRX3.Enabled = true;
		}
		else
		{
			tbLimitLineRX0.Enabled = false;
			tbLimitLineRX1.Enabled = false;
			tbLimitLineRX2.Enabled = false;
			tbLimitLineRX3.Enabled = false;
		}
	}

	private void radioButtonDeltaLimit_CheckedChanged(object sender, EventArgs e)
	{
		if (radioButtonDeltaLimit.Checked)
		{
			tbParentDataFile.Enabled = true;
			bnBrowseDataFile.Enabled = true;
			labelDataFile1.Enabled = true;
			labelDataFile2.Enabled = true;
			tbDeltaLimitRX0.Enabled = true;
			tbDeltaLimitRX1.Enabled = true;
			tbDeltaLimitRX2.Enabled = true;
			tbDeltaLimitRX3.Enabled = true;
		}
		else
		{
			tbParentDataFile.Enabled = false;
			bnBrowseDataFile.Enabled = false;
			labelDataFile1.Enabled = false;
			labelDataFile2.Enabled = false;
			tbDeltaLimitRX0.Enabled = false;
			tbDeltaLimitRX1.Enabled = false;
			tbDeltaLimitRX2.Enabled = false;
			tbDeltaLimitRX3.Enabled = false;
		}
	}

	private void bnBrowseDataFile_Click(object sender, EventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.Title = "Select Parent Data File";
		if (Directory.Exists(tbLogFileFolder.Text))
		{
			openFileDialog.InitialDirectory = tbLogFileFolder.Text;
		}
		else
		{
			openFileDialog.InitialDirectory = "c:\\";
		}
		openFileDialog.Filter = "CSV Files (*.csv)|*.csv";
		openFileDialog.RestoreDirectory = true;
		DialogResult dialogResult = openFileDialog.ShowDialog();
		if (dialogResult == DialogResult.OK)
		{
			_ = openFileDialog.FileName;
			tbParentDataFile.Text = openFileDialog.FileName;
			LoadParentDataFile(openFileDialog.FileName);
		}
	}

	private void LoadParentDataFile(string filename)
	{
		try
		{
			StreamReader streamReader = new StreamReader(File.OpenRead(filename));
			ParentDataColumnIndex.Clear();
			ParentDataResList.Clear();
			bool flag = true;
			while (!streamReader.EndOfStream)
			{
				string text = streamReader.ReadLine();
				string[] array = text.Split(',');
				if (array.Length <= 0)
				{
					continue;
				}
				if (flag)
				{
					int num = 0;
					string[] array2 = array;
					foreach (string value in array2)
					{
						ParentDataColumnIndex.Add(num, value);
						num++;
					}
					flag = false;
					continue;
				}
				int num2 = 0;
				Result item = default(Result);
				item.channelC0 = 0;
				item.freqC0 = 0.0;
				item.rssiC0 = 9999.0;
				item.DateTimeStamp = "";
				item.channelC1 = 0;
				item.freqC1 = 0.0;
				item.rssiC1 = 9999.0;
				string[] array3 = array;
				foreach (string text2 in array3)
				{
					if (ParentDataColumnIndex[num2].Equals("Time"))
					{
						item.DateTimeStamp = text2;
					}
					else if (ParentDataColumnIndex[num2].Equals("Mode"))
					{
						item.Mode = text2;
						ParentMode = text2;
					}
					else if (ParentDataColumnIndex[num2].Equals("Band"))
					{
						item.Band = text2;
						ParentBand = text2;
					}
					else if (ParentDataColumnIndex[num2].Equals("Channel"))
					{
						int result = 0;
						if (int.TryParse(text2, out result))
						{
							item.channelC0 = result;
							item.channelC1 = result;
						}
					}
					else if (ParentDataColumnIndex[num2].Equals("Freq"))
					{
						double result2 = 0.0;
						if (double.TryParse(text2, out result2))
						{
							item.freqC0 = result2;
							item.freqC1 = result2;
						}
					}
					else if (ParentDataColumnIndex[num2].Equals("RX0"))
					{
						double result3 = 0.0;
						if (double.TryParse(text2, out result3))
						{
							item.rssiC0 = result3;
						}
					}
					else if (ParentDataColumnIndex[num2].Equals("RX1"))
					{
						double result4 = 0.0;
						if (double.TryParse(text2, out result4))
						{
							item.rssiC1 = result4;
						}
					}
					num2++;
				}
				ParentDataResList.Add(item);
			}
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper("Error loading Parent data file :" + ex.Message, "");
		}
	}

	private char checkAbort()
	{
		if (abortFlag)
		{
			return '\u0001';
		}
		return '\0';
	}

	private void tbYmax_TextChanged(object sender, EventArgs e)
	{
		BeginInvoke((MethodInvoker)delegate
		{
			SetYmax(tbYmax.Text);
		});
	}

	private void SetYmax(string Ymax)
	{
		double result = 0.0;
		double num = chart1.ChartAreas[0].AxisY.Minimum;
		if (double.IsNaN(num))
		{
			num = Convert.ToDouble(tbYmin.Text);
		}
		if (double.TryParse(Ymax, out result) && result > num)
		{
			chart1.ChartAreas[0].AxisY.Maximum = result;
		}
	}

	private void tbYmin_TextChanged(object sender, EventArgs e)
	{
		BeginInvoke((MethodInvoker)delegate
		{
			SetYmin(tbYmin.Text);
		});
	}

	private void SetYmin(string Ymin)
	{
		double result = 0.0;
		double num = chart1.ChartAreas[0].AxisY.Maximum;
		if (double.IsNaN(num))
		{
			num = Convert.ToDouble(tbYmax.Text);
		}
		if (double.TryParse(Ymin, out result) && result < num)
		{
			chart1.ChartAreas[0].AxisY.Minimum = result;
		}
	}

	private void bnSaveChart_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		saveFileDialog.Title = "Provide Location to Save Image";
		if (Directory.Exists(tbLogFileFolder.Text))
		{
			saveFileDialog.InitialDirectory = tbLogFileFolder.Text;
		}
		else
		{
			saveFileDialog.InitialDirectory = "c:\\";
		}
		saveFileDialog.Filter = "PNG Files (*.png)|*.png";
		saveFileDialog.OverwritePrompt = true;
		string text = "";
		string text2 = cbMode.SelectedItem.ToString();
		string text3 = cbBand.SelectedItem.ToString();
		text = ((!text3.Contains(text2)) ? (ID + "_" + text2 + text3 + "_" + DateTime.Now.ToString("yyMMddhmmss")) : (ID + "_" + text3 + "_" + DateTime.Now.ToString("yyMMddhmmss")));
		saveFileDialog.FileName = text;
		DialogResult dialogResult = saveFileDialog.ShowDialog();
		if (dialogResult == DialogResult.OK)
		{
			_ = saveFileDialog.FileName;
			try
			{
				chart1.SaveImage(saveFileDialog.FileName, ChartImageFormat.Png);
			}
			catch (Exception ex)
			{
				ShowMessageBoxWrapper("Image Save failed. Message:" + ex.Message, "");
			}
		}
	}

	private void bnAbout_Click(object sender, EventArgs e)
	{
		NPTDllVersion = "";
		try
		{
			FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo("SubSysNPT_NET.dll");
			NPTDllVersion = versionInfo.FileVersion;
		}
		catch
		{
		}
		AboutBox1 aboutBox = new AboutBox1(NPTDllVersion);
		aboutBox.Show();
	}

	private void cbChipID_SelectedIndexChanged(object sender, EventArgs e)
	{
		string text = cbChipID.SelectedItem.ToString();
		foreach (TechInfo item in TechInformation)
		{
			if (item.Alias == "WLAN" && item.ParamsWhenVictim.Count > 0)
			{
				foreach (Parameter item2 in item.ParamsWhenVictim)
				{
					if (item2.Name == "WCN3990 2G Rx Gain Index" && item2.CompatibleConnID == text)
					{
						WLAN2GRxGainIndex = item2.Value;
					}
					if (item2.Name == "WCN3990 5G Rx Gain Index" && item2.CompatibleConnID == text)
					{
						WLAN5GRxGainIndex = item2.Value;
					}
					if (item2.Name == "Victim1 2G xLNA State" && item2.CompatibleConnID == text)
					{
						WLAN2GxLNAState = item2.Value;
					}
					if (item2.Name == "Victim1 5G xLNA State" && item2.CompatibleConnID == text)
					{
						WLAN5GxLNAState = item2.Value;
					}
				}
			}
			foreach (string connectivityID in item.ConnectivityIDs)
			{
				string[] array = connectivityID.Split(' ');
				string text2 = "";
				for (int i = 1; i < array.Count(); i++)
				{
					text2 += array[i];
				}
				if (text == text2)
				{
					ChipID = array[0];
					if (ChipID == "3" && cbMode.SelectedItem.ToString().ToUpper().Contains("WLAN"))
					{
						cbWLANPhyId.Enabled = true;
						lbPhyId.Enabled = true;
						cbMeasMode.Enabled = true;
					}
					else
					{
						cbWLANPhyId.Enabled = false;
						lbPhyId.Enabled = false;
						cbMeasMode.Enabled = false;
					}
					cbWLANPhyId.SelectedIndex = 0;
					cbMeasMode.SelectedIndex = 1;
					return;
				}
			}
		}
	}

	private void bnOpenLogFolder_Click(object sender, EventArgs e)
	{
		try
		{
			Process.Start(tbLogFileFolder.Text);
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper("Folder not found. Message: " + ex.Message, "");
		}
	}

	private void bnEditPathLoss_Click(object sender, EventArgs e)
	{
		try
		{
			ProcessStartInfo processStartInfo = new ProcessStartInfo();
			processStartInfo.FileName = "QDART_MFG_StationCal.exe";
			processStartInfo.CreateNoWindow = true;
			using (Process.Start(processStartInfo))
			{
			}
		}
		catch (Exception)
		{
			try
			{
				ProcessStartInfo processStartInfo2 = new ProcessStartInfo();
				processStartInfo2.FileName = "notepad.exe";
				processStartInfo2.CreateNoWindow = true;
				processStartInfo2.Arguments = "..\\Databases\\CalDB_NET.xml";
				using (Process.Start(processStartInfo2))
				{
				}
			}
			catch (Exception)
			{
				ShowMessageBoxWrapper("Unable to open ..\\Databases\\CalDB_Net.xml for editing. Please make sure the file exists and manually update the file if required", "");
			}
		}
	}

	private void bnSetSigGen_Click(object sender, EventArgs e)
	{
		try
		{
			ProcessStartInfo processStartInfo = new ProcessStartInfo();
			processStartInfo.FileName = "QDART_MFG_CfgEditor.exe";
			processStartInfo.CreateNoWindow = true;
			using (Process.Start(processStartInfo))
			{
			}
		}
		catch (Exception)
		{
			try
			{
				ProcessStartInfo processStartInfo2 = new ProcessStartInfo();
				processStartInfo2.FileName = "notepad.exe";
				processStartInfo2.CreateNoWindow = true;
				processStartInfo2.Arguments = "..\\Databases\\equipconfig.xml";
				using (Process.Start(processStartInfo2))
				{
				}
			}
			catch (Exception)
			{
				ShowMessageBoxWrapper("Unable to open equipconfig.xml. Please make sure the file exists and manually update the file if required", "");
			}
		}
	}

	private void MainForm_Load(object sender, EventArgs e)
	{
		ToolTip toolTip = new ToolTip();
		toolTip.ReshowDelay = 550;
		toolTip.AutoPopDelay = 6000;
		toolTip.InitialDelay = 800;
		toolTip.ShowAlways = true;
		toolTip.SetToolTip(chkboxCalScan, "Calibration Scan can be used to check device receiver calibration. Needs a supported GPIB signal generator.CW signal is swept while recording the RSSI from the device under test receiver");
		toolTip.SetToolTip(cbChipID, "Select the Qualcomm connectivity chip for the target");
		toolTip.SetToolTip(cbDiversity, "Enable RSSI collection on secondary/diversity receiver");
		toolTip.SetToolTip(bnEditPathLoss, "Set up RF path loss which is used while setting up the signal generator for cal scan. Edits CalDB_NET.xml");
		toolTip.SetToolTip(bnSetSigGen, "Select the signal generator model and GPIB related parameters. Edits equipconfig.xml");
		toolTip.SetToolTip(chkboxTargetDeviceType, "Select this box if your target is an APQ with WAN modem. An APQ device with WAN modem will enumerate two ports in QPST." + Environment.NewLine + "Leave this option unchecked for pure APQ targets with no WAN modem where only 1 port might be enumerated in QPST.");
		toolTip.SetToolTip(lbChainSub, "Select the Subscription number for cellular tech or chain for WLAN");
		toolTip.SetToolTip(cbChain, "Select the Subscription number for cellular tech or chain for WLAN");
		FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo("SubSysNPT_NET.dll");
		NPTDllVersion = versionInfo.FileVersion;
		Text = "QDART Noise Profiling Tool (Proprietary to Qualcomm Technologies) V " + NPTDllVersion;
		Update();
		if (commandLineMode)
		{
			if (tempymin != 999.0)
			{
				tbYmin.Text = tempymin.ToString();
			}
			if (tempymax != 999.0)
			{
				tbYmax.Text = tempymax.ToString();
			}
		}
		if (AutoCloseApp_CLI)
		{
			Environment.ExitCode = appExitErrorCode;
			Application.Exit();
		}
	}

	private void chkBoxSingleChMode_CheckedChanged(object sender, EventArgs e)
	{
		ConfigureUIForSingleChannelMode();
	}

	private void ConfigureUIForSingleChannelMode()
	{
		if (chkBoxSingleChMode.Checked)
		{
			SetAllChannelControlsState(IsEnabled: false, EnableOnlySelectedRows: true);
			ncSingleChannel.Enabled = true;
			ncSingleChannel.Minimum = GetLowestChannelForSelectedBand();
			ncSingleChannel.Maximum = GetHighestChannelForSelectedBand();
			ncSingleChannel.Value = ncSingleChannel.Minimum;
		}
		else
		{
			SetAllChannelControlsState(IsEnabled: true, EnableOnlySelectedRows: true);
			ncSingleChannel.Enabled = false;
		}
	}

	private void SetTestStatus(string status)
	{
		lbTestStatus.Text = status;
	}

	private void cbTxBW_SelectedIndexChanged(object sender, EventArgs e)
	{
		switch (cbTxBW.SelectedItem.ToString())
		{
		case "1P4MHz":
			tbStartRB.Text = "0";
			tbNumRB.Text = "6";
			break;
		case "3MHz":
			tbStartRB.Text = "0";
			tbNumRB.Text = "15";
			break;
		case "5MHz":
			tbStartRB.Text = "0";
			tbNumRB.Text = "25";
			break;
		case "10MHz":
			tbStartRB.Text = "0";
			tbNumRB.Text = "50";
			break;
		case "15MHz":
			tbStartRB.Text = "0";
			tbNumRB.Text = "75";
			break;
		case "20MHz":
			tbStartRB.Text = "0";
			tbNumRB.Text = "100";
			break;
		default:
			tbStartRB.Text = "0";
			tbNumRB.Text = "50";
			break;
		}
		ValidateBandEdgeChannels();
		ConfigureUIForSingleChannelMode();
	}

	private void cbBW_SelectedIndexChanged(object sender, EventArgs e)
	{
		ValidateBandEdgeChannels();
		ConfigureUIForSingleChannelMode();
		cbTxBW.SelectedIndex = cbBW.SelectedIndex;
	}

	private void ValidateBandEdgeChannels()
	{
		try
		{
			string text = cbMode.SelectedItem.ToString();
			if (text.Contains("GPS") || text.Contains("GLO") || text.Contains("BDS") || text.Contains("GAL"))
			{
				return;
			}
			int result = 0;
			int result2 = 0;
			int result3 = 0;
			int result4 = 0;
			int isTxOnORSelfDesense = 0;
			getLTERXBWenumString(out var BWenumStr);
			getLTETXBWenumString(out var BWenumStr2);
			int.TryParse(BWenumStr, out result);
			int.TryParse(BWenumStr2, out result2);
			string s = tbStartRB.Text;
			string s2 = tbNumRB.Text;
			int.TryParse(s, out result3);
			int.TryParse(s2, out result4);
			if (chkBoxEnableTx.Checked)
			{
				isTxOnORSelfDesense = 1;
			}
			if (chkboxChList1.Checked)
			{
				ncStart1.Value = StartCh1;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStart1.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					++ncStart1.Value;
				}
				ncStop1.Value = StopCh1;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStop1.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					--ncStop1.Value;
				}
			}
			if (chkboxChList2.Checked)
			{
				ncStart2.Value = StartCh2;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStart2.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					++ncStart2.Value;
				}
				ncStop2.Value = StopCh2;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStop2.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					--ncStop2.Value;
				}
			}
			if (chkboxChList3.Checked)
			{
				ncStart3.Value = StartCh3;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStart3.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					++ncStart3.Value;
				}
				ncStop3.Value = StopCh3;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStop3.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					--ncStop3.Value;
				}
			}
			if (chkboxChList4.Checked)
			{
				ncStart4.Value = StartCh4;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStart4.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					++ncStart4.Value;
				}
				ncStop4.Value = StopCh4;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStop4.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					--ncStop4.Value;
				}
			}
			if (chkboxChList5.Checked)
			{
				ncStart5.Value = StartCh5;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStart5.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					++ncStart5.Value;
				}
				ncStop5.Value = StopCh5;
				while (IsChannelValid(SelectedRFModeEnumValue, (int)ncStop5.Value, result, result2, isTxOnORSelfDesense, result3, result4) == 0)
				{
					--ncStop5.Value;
				}
			}
		}
		catch (Exception ex)
		{
			ShowMessageBoxWrapper("ValidateBandEdgeChannels() :" + ex.Message, "");
		}
	}

	private void tbStartRB_TextChanged(object sender, EventArgs e)
	{
		ValidateBandEdgeChannels();
		ConfigureUIForSingleChannelMode();
	}

	private void tbNumRB_TextChanged(object sender, EventArgs e)
	{
		ValidateBandEdgeChannels();
		ConfigureUIForSingleChannelMode();
	}

	private void bnBrowseLogFolder_Click(object sender, EventArgs e)
	{
		FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
		if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
		{
			tbLogFileFolder.Text = folderBrowserDialog.SelectedPath;
		}
	}

	private void ShowMessageWrapper(string msg)
	{
		if (commandLineMode)
		{
			errorString = errorString + Environment.NewLine + msg;
		}
		else
		{
			MessageBox.Show(msg);
		}
	}

	private void cbModemType_SelectedIndexChanged(object sender, EventArgs e)
	{
		if (cbModemType.SelectedIndex == 0)
		{
			Settings.Default.ModemType = 0;
			cbAntennaSwitch.Enabled = false;
			lbAntennaSw.Enabled = false;
		}
		else
		{
			Settings.Default.ModemType = 1;
			cbAntennaSwitch.Enabled = true;
			lbAntennaSw.Enabled = true;
		}
		Settings.Default.Save();
	}

	private void cbMeasMode_SelectedIndexChanged(object sender, EventArgs e)
	{
		if (cbMode.SelectedItem.ToString().Contains("WLAN"))
		{
			if (cbMeasMode.SelectedItem.ToString().Contains("1MHz"))
			{
				tbStep1.Text = "4";
			}
			else if (cbMeasMode.SelectedItem.ToString().Contains("20MHz"))
			{
				tbStep1.Enabled = true;
				tbStep1.Text = "1";
			}
		}
	}

	private void ShowMessageBoxWrapper(string message, string title)
	{
		if (commandLineMode)
		{
			Console.WriteLine(message);
		}
		else
		{
			MessageBox.Show(message, title);
		}
	}

	private void chkBxWLANCh0_CheckedChanged(object sender, EventArgs e)
	{
		if (chkBxWLANCh0.Checked)
		{
			WLANrxChainMask |= 1;
		}
		else
		{
			WLANrxChainMask &= 2;
		}
	}

	private void chkBxWLANCh1_CheckedChanged(object sender, EventArgs e)
	{
		if (chkBxWLANCh1.Checked)
		{
			WLANrxChainMask |= 2;
		}
		else
		{
			WLANrxChainMask &= 1;
		}
	}

	private void chkbxFTMDaemon_CheckedChanged(object sender, EventArgs e)
	{
		if (!chkbxFTMDaemon.Checked)
		{
			Settings.Default.Ftmdaemon = 0;
		}
		else
		{
			Settings.Default.Ftmdaemon = 1;
		}
		Settings.Default.Save();
	}

	private void bnWLANmore_Click(object sender, EventArgs e)
	{
		if (int.TryParse(WLAN2GRxGainIndex, out var result) && int.TryParse(WLAN5GRxGainIndex, out var result2))
		{
			FormWLANMoreSettings formWLANMoreSettings = new FormWLANMoreSettings();
			formWLANMoreSettings.UpdateInfo += WLANMore_Update;
			formWLANMoreSettings.InitializeInfo(result, result2, WLAN2GxLNAState == "1", WLAN5GxLNAState == "1");
			formWLANMoreSettings.ShowDialog();
		}
	}

	private void WLANMore_Update(int GainIdx2G, int GainIdx5G, bool xLNAState2G, bool xLNAState5G)
	{
		WLAN2GRxGainIndex = GainIdx2G.ToString();
		WLAN5GRxGainIndex = GainIdx5G.ToString();
		WLAN2GxLNAState = (xLNAState2G ? "1" : "0");
		WLAN5GxLNAState = (xLNAState5G ? "1" : "0");
	}

	private void cbRSSIType_SelectedIndexChanged(object sender, EventArgs e)
	{
		if (cbRSSIType.SelectedItem.ToString().ToLower().Contains("mean"))
		{
			Settings.Default.AveragingType = 0;
			measAveragingType = "0";
		}
		else if (cbRSSIType.SelectedItem.ToString().ToLower().Contains("95thpercentile"))
		{
			Settings.Default.AveragingType = 1;
			measAveragingType = "1";
		}
		else
		{
			Settings.Default.AveragingType = 2;
			measAveragingType = "2";
		}
		Settings.Default.Save();
	}

	private void cb_LTEC2C3_CheckedChanged(object sender, EventArgs e)
	{
		if (cb_LTEC2C3.Checked)
		{
			LTERx2Rx3bitmap = "1";
			cbDiversity.Checked = true;
			cbDiversity.Enabled = false;
		}
		else
		{
			LTERx2Rx3bitmap = "0";
			cbDiversity.Enabled = true;
		}
	}

	private void tbLogFilePrefix_TextChanged(object sender, EventArgs e)
	{
		logFilePrefix = tbLogFilePrefix.Text;
	}

	private double Calculate95thPercentile(List<double> rssiList)
	{
		List<double> list = new List<double>(rssiList);
		list.Sort();
		if (list.Count > 1)
		{
			return list[(int)(0.95 * (double)list.Count) - 1];
		}
		if (list.Count == 1)
		{
			return list[0];
		}
		throw new Exception("Zero items in Rssi array");
	}

	private void AddMarkerLegend()
	{
		if (!cbMode.SelectedItem.ToString().ToLower().Contains("wlan"))
		{
			LegendItem legendItem = new LegendItem();
			legendItem.ImageStyle = LegendImageStyle.Marker;
			legendItem.MarkerStyle = MarkerStyle.Star5;
			legendItem.MarkerColor = Color.DarkBlue;
			legendItem.Cells.Add(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft);
			legendItem.Cells.Add(LegendCellType.Text, "Transient > 3 dB", ContentAlignment.MiddleLeft);
			legendItem.MarkerSize = 10;
			legendItem.Name = "TransientLegend3dB";
			chart1.Legends[0].CustomItems.Add(legendItem);
		}
		LegendItem legendItem2 = new LegendItem();
		legendItem2.ImageStyle = LegendImageStyle.Marker;
		legendItem2.MarkerStyle = MarkerStyle.Star10;
		legendItem2.MarkerColor = Color.DarkBlue;
		legendItem2.Cells.Add(LegendCellType.SeriesSymbol, "", ContentAlignment.MiddleLeft);
		legendItem2.Cells.Add(LegendCellType.Text, "Transient > 6 dB", ContentAlignment.MiddleLeft);
		legendItem2.MarkerSize = 15;
		legendItem2.Name = "TransientLegend6dB";
		chart1.Legends[0].CustomItems.Add(legendItem2);
	}

	private void cbTransientCheck_CheckedChanged(object sender, EventArgs e)
	{
		if (!cbTransientCheck.Checked)
		{
			Settings.Default.marktransients = 0;
		}
		else
		{
			Settings.Default.marktransients = 1;
		}
		Settings.Default.Save();
	}

	private void cb_Fusion_CheckedChanged(object sender, EventArgs e)
	{
		if (cb_Fusion.Checked)
		{
			chkboxTargetDeviceType.Checked = false;
		}
	}

	private void chkboxTargetDeviceType_CheckedChanged(object sender, EventArgs e)
	{
		if (chkboxTargetDeviceType.Checked)
		{
			cb_Fusion.Checked = false;
		}
	}

	private void cb_UDTMode_CheckedChanged(object sender, EventArgs e)
	{
		if (!cb_UDTMode.Checked)
		{
			Settings.Default.UDT_Mode = 0;
		}
		else
		{
			Settings.Default.UDT_Mode = 1;
		}
		Settings.Default.Save();
	}

	private void tb_UDTIp_TextChanged(object sender, EventArgs e)
	{
		Settings.Default.UDT_IPAddress = tb_UDTIp.Text;
	}

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

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NPTGUI.MainForm));
		this.bnRunStop = new System.Windows.Forms.Button();
		this.timer1 = new System.Windows.Forms.Timer(this.components);
		this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
		this.groupBoxUUTConfig = new System.Windows.Forms.GroupBox();
		this.chkbxFTMDaemon = new System.Windows.Forms.CheckBox();
		this.gbWLANCtrls = new System.Windows.Forms.GroupBox();
		this.bnWLANmore = new System.Windows.Forms.Button();
		this.label29 = new System.Windows.Forms.Label();
		this.label26 = new System.Windows.Forms.Label();
		this.label27 = new System.Windows.Forms.Label();
		this.chkBxWLANCh0 = new System.Windows.Forms.CheckBox();
		this.cbMeasMode = new System.Windows.Forms.ComboBox();
		this.chkBxWLANCh1 = new System.Windows.Forms.CheckBox();
		this.lbPhyId = new System.Windows.Forms.Label();
		this.cbWLANPhyId = new System.Windows.Forms.ComboBox();
		this.gbWWAN_ChainCtrl = new System.Windows.Forms.GroupBox();
		this.label_BmId = new System.Windows.Forms.Label();
		this.numeric_BmId = new System.Windows.Forms.NumericUpDown();
		this.cb_LTEC2C3 = new System.Windows.Forms.CheckBox();
		this.lbAntennaSw = new System.Windows.Forms.Label();
		this.cbAntennaSwitch = new System.Windows.Forms.ComboBox();
		this.lbChainSub = new System.Windows.Forms.Label();
		this.cbChain = new System.Windows.Forms.ComboBox();
		this.cbDiversity = new System.Windows.Forms.CheckBox();
		this.label25 = new System.Windows.Forms.Label();
		this.label23 = new System.Windows.Forms.Label();
		this.cbTxBW = new System.Windows.Forms.ComboBox();
		this.cbModemType = new System.Windows.Forms.ComboBox();
		this.label12 = new System.Windows.Forms.Label();
		this.cbChipID = new System.Windows.Forms.ComboBox();
		this.gbReceiver = new System.Windows.Forms.GroupBox();
		this.cbRSSIType = new System.Windows.Forms.ComboBox();
		this.lbSamples = new System.Windows.Forms.Label();
		this.tbNoOfAverages = new System.Windows.Forms.TextBox();
		this.GroupBoxTransmitter = new System.Windows.Forms.GroupBox();
		this.groupBoxRB = new System.Windows.Forms.GroupBox();
		this.label7 = new System.Windows.Forms.Label();
		this.label6 = new System.Windows.Forms.Label();
		this.tbNumRB = new System.Windows.Forms.TextBox();
		this.tbStartRB = new System.Windows.Forms.TextBox();
		this.chkboxMaxPower = new System.Windows.Forms.CheckBox();
		this.label9 = new System.Windows.Forms.Label();
		this.tbPower = new System.Windows.Forms.TextBox();
		this.chkBoxEnableTx = new System.Windows.Forms.CheckBox();
		this.label8 = new System.Windows.Forms.Label();
		this.cbBW = new System.Windows.Forms.ComboBox();
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.ncSingleChannel = new System.Windows.Forms.NumericUpDown();
		this.chkBoxSingleChMode = new System.Windows.Forms.CheckBox();
		this.chkboxChList5 = new System.Windows.Forms.CheckBox();
		this.tbStep5 = new System.Windows.Forms.TextBox();
		this.ncStop5 = new System.Windows.Forms.NumericUpDown();
		this.ncStart5 = new System.Windows.Forms.NumericUpDown();
		this.chkboxChList4 = new System.Windows.Forms.CheckBox();
		this.chkboxChList3 = new System.Windows.Forms.CheckBox();
		this.chkboxChList2 = new System.Windows.Forms.CheckBox();
		this.chkboxChList1 = new System.Windows.Forms.CheckBox();
		this.label5 = new System.Windows.Forms.Label();
		this.label4 = new System.Windows.Forms.Label();
		this.label3 = new System.Windows.Forms.Label();
		this.tbStep4 = new System.Windows.Forms.TextBox();
		this.tbStep3 = new System.Windows.Forms.TextBox();
		this.tbStep2 = new System.Windows.Forms.TextBox();
		this.tbStep1 = new System.Windows.Forms.TextBox();
		this.ncStop4 = new System.Windows.Forms.NumericUpDown();
		this.ncStart4 = new System.Windows.Forms.NumericUpDown();
		this.ncStop3 = new System.Windows.Forms.NumericUpDown();
		this.ncStart3 = new System.Windows.Forms.NumericUpDown();
		this.ncStop2 = new System.Windows.Forms.NumericUpDown();
		this.ncStart2 = new System.Windows.Forms.NumericUpDown();
		this.ncStop1 = new System.Windows.Forms.NumericUpDown();
		this.ncStart1 = new System.Windows.Forms.NumericUpDown();
		this.label2 = new System.Windows.Forms.Label();
		this.label1 = new System.Windows.Forms.Label();
		this.cbBand = new System.Windows.Forms.ComboBox();
		this.cbMode = new System.Windows.Forms.ComboBox();
		this.chkboxTargetDeviceType = new System.Windows.Forms.CheckBox();
		this.bnCheckPhoneConnected = new System.Windows.Forms.Button();
		this.groupBoxPhoneStatus = new System.Windows.Forms.GroupBox();
		this.label32 = new System.Windows.Forms.Label();
		this.cb_UDTMode = new System.Windows.Forms.CheckBox();
		this.tb_UDTIp = new System.Windows.Forms.TextBox();
		this.label31 = new System.Windows.Forms.Label();
		this.tb_HWID = new System.Windows.Forms.TextBox();
		this.cb_Fusion = new System.Windows.Forms.CheckBox();
		this.tbImei = new System.Windows.Forms.TextBox();
		this.labelPhoneStatus = new System.Windows.Forms.Label();
		this.cbOnlineModeOnExit = new System.Windows.Forms.CheckBox();
		this.gbDataLogOption = new System.Windows.Forms.GroupBox();
		this.tbLogFilePrefix = new System.Windows.Forms.TextBox();
		this.label30 = new System.Windows.Forms.Label();
		this.bnBrowseLogFolder = new System.Windows.Forms.Button();
		this.bnOpenLogFolder = new System.Windows.Forms.Button();
		this.tbLogFileFolder = new System.Windows.Forms.TextBox();
		this.lbLogFileFolder = new System.Windows.Forms.Label();
		this.gbChartOptions = new System.Windows.Forms.GroupBox();
		this.cbTransientCheck = new System.Windows.Forms.CheckBox();
		this.bnSaveChart = new System.Windows.Forms.Button();
		this.label15 = new System.Windows.Forms.Label();
		this.label14 = new System.Windows.Forms.Label();
		this.tbYmin = new System.Windows.Forms.TextBox();
		this.tbYmax = new System.Windows.Forms.TextBox();
		this.gbLimitTesting = new System.Windows.Forms.GroupBox();
		this.tbLimitExcdRX3 = new System.Windows.Forms.TextBox();
		this.tbDeltaLimitRX3 = new System.Windows.Forms.TextBox();
		this.tbDeltaLimitRX2 = new System.Windows.Forms.TextBox();
		this.tbLimitExcdRX2 = new System.Windows.Forms.TextBox();
		this.tbLimitLineRX3 = new System.Windows.Forms.TextBox();
		this.tbMaxFreqRX3 = new System.Windows.Forms.TextBox();
		this.tbMaxFreqRX2 = new System.Windows.Forms.TextBox();
		this.tbLimitLineRX2 = new System.Windows.Forms.TextBox();
		this.tbMaxChanRX3 = new System.Windows.Forms.TextBox();
		this.label22 = new System.Windows.Forms.Label();
		this.tbMaxDeltaRX2 = new System.Windows.Forms.TextBox();
		this.label28 = new System.Windows.Forms.Label();
		this.tbMaxChanRX2 = new System.Windows.Forms.TextBox();
		this.tbMaxDeltaRX3 = new System.Windows.Forms.TextBox();
		this.label19 = new System.Windows.Forms.Label();
		this.label18 = new System.Windows.Forms.Label();
		this.label17 = new System.Windows.Forms.Label();
		this.label16 = new System.Windows.Forms.Label();
		this.tbLimitExcdRX1 = new System.Windows.Forms.TextBox();
		this.tbDeltaLimitRX1 = new System.Windows.Forms.TextBox();
		this.tbDeltaLimitRX0 = new System.Windows.Forms.TextBox();
		this.tbLimitExcdRX0 = new System.Windows.Forms.TextBox();
		this.bnBrowseDataFile = new System.Windows.Forms.Button();
		this.tbLimitLineRX1 = new System.Windows.Forms.TextBox();
		this.tbMaxFreqRX1 = new System.Windows.Forms.TextBox();
		this.labelDataFile2 = new System.Windows.Forms.Label();
		this.labelDataFile1 = new System.Windows.Forms.Label();
		this.tbMaxFreqRX0 = new System.Windows.Forms.TextBox();
		this.tbLimitLineRX0 = new System.Windows.Forms.TextBox();
		this.tbParentDataFile = new System.Windows.Forms.TextBox();
		this.tbMaxChanRX1 = new System.Windows.Forms.TextBox();
		this.label11 = new System.Windows.Forms.Label();
		this.tbMaxDeltaRX0 = new System.Windows.Forms.TextBox();
		this.label10 = new System.Windows.Forms.Label();
		this.tbMaxChanRX0 = new System.Windows.Forms.TextBox();
		this.tbMaxDeltaRX1 = new System.Windows.Forms.TextBox();
		this.radioButtonDeltaLimit = new System.Windows.Forms.RadioButton();
		this.radioButtonLimitLine = new System.Windows.Forms.RadioButton();
		this.radioButtonOff = new System.Windows.Forms.RadioButton();
		this.lbRunInfo = new System.Windows.Forms.Label();
		this.bnAbout = new System.Windows.Forms.Button();
		this.gbCalibrationScan = new System.Windows.Forms.GroupBox();
		this.label24 = new System.Windows.Forms.Label();
		this.cbTEControlType = new System.Windows.Forms.ComboBox();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.tbCalOffset = new System.Windows.Forms.TextBox();
		this.tbCalPower = new System.Windows.Forms.TextBox();
		this.bnEditPathLoss = new System.Windows.Forms.Button();
		this.bnSetSigGen = new System.Windows.Forms.Button();
		this.label13 = new System.Windows.Forms.Label();
		this.lbCalPower = new System.Windows.Forms.Label();
		this.chkboxCalScan = new System.Windows.Forms.CheckBox();
		this.label20 = new System.Windows.Forms.Label();
		this.label21 = new System.Windows.Forms.Label();
		this.lbTestStatus = new System.Windows.Forms.Label();
		this.ncStartDelay = new System.Windows.Forms.NumericUpDown();
		this.gbMisc = new System.Windows.Forms.GroupBox();
		((System.ComponentModel.ISupportInitialize)this.chart1).BeginInit();
		this.groupBoxUUTConfig.SuspendLayout();
		this.gbWLANCtrls.SuspendLayout();
		this.gbWWAN_ChainCtrl.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.numeric_BmId).BeginInit();
		this.gbReceiver.SuspendLayout();
		this.GroupBoxTransmitter.SuspendLayout();
		this.groupBoxRB.SuspendLayout();
		this.groupBox2.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.ncSingleChannel).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop5).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart5).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop4).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart4).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop3).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart3).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop2).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart2).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop1).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart1).BeginInit();
		this.groupBoxPhoneStatus.SuspendLayout();
		this.gbDataLogOption.SuspendLayout();
		this.gbChartOptions.SuspendLayout();
		this.gbLimitTesting.SuspendLayout();
		this.gbCalibrationScan.SuspendLayout();
		this.groupBox1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.ncStartDelay).BeginInit();
		this.gbMisc.SuspendLayout();
		base.SuspendLayout();
		this.bnRunStop.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
		this.bnRunStop.Location = new System.Drawing.Point(954, 12);
		this.bnRunStop.Name = "bnRunStop";
		this.bnRunStop.Size = new System.Drawing.Size(71, 36);
		this.bnRunStop.TabIndex = 0;
		this.bnRunStop.Text = "Run";
		this.bnRunStop.UseVisualStyleBackColor = true;
		this.bnRunStop.Click += new System.EventHandler(bnRunStop_Click);
		this.timer1.Tick += new System.EventHandler(timer1_Tick);
		this.chart1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
		this.chart1.BackColor = System.Drawing.SystemColors.Control;
		this.chart1.BorderlineColor = System.Drawing.Color.DarkGray;
		this.chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
		this.chart1.BorderlineWidth = 2;
		this.chart1.BorderSkin.BackColor = System.Drawing.Color.Transparent;
		chartArea.BackColor = System.Drawing.SystemColors.ControlLightLight;
		chartArea.Name = "ChartArea1";
		this.chart1.ChartAreas.Add(chartArea);
		legend.Name = "Legend1";
		this.chart1.Legends.Add(legend);
		this.chart1.Location = new System.Drawing.Point(12, 412);
		this.chart1.Name = "chart1";
		series.ChartArea = "ChartArea1";
		series.EmptyPointStyle.Color = System.Drawing.Color.Transparent;
		series.IsXValueIndexed = true;
		series.Legend = "Legend1";
		series.Name = "RX0";
		this.chart1.Series.Add(series);
		this.chart1.Size = new System.Drawing.Size(996, 440);
		this.chart1.TabIndex = 5;
		this.chart1.Text = "chart1";
		this.groupBoxUUTConfig.Controls.Add(this.chkbxFTMDaemon);
		this.groupBoxUUTConfig.Controls.Add(this.gbWLANCtrls);
		this.groupBoxUUTConfig.Controls.Add(this.gbWWAN_ChainCtrl);
		this.groupBoxUUTConfig.Controls.Add(this.label25);
		this.groupBoxUUTConfig.Controls.Add(this.label23);
		this.groupBoxUUTConfig.Controls.Add(this.cbTxBW);
		this.groupBoxUUTConfig.Controls.Add(this.cbModemType);
		this.groupBoxUUTConfig.Controls.Add(this.label12);
		this.groupBoxUUTConfig.Controls.Add(this.cbChipID);
		this.groupBoxUUTConfig.Controls.Add(this.gbReceiver);
		this.groupBoxUUTConfig.Controls.Add(this.GroupBoxTransmitter);
		this.groupBoxUUTConfig.Controls.Add(this.label8);
		this.groupBoxUUTConfig.Controls.Add(this.cbBW);
		this.groupBoxUUTConfig.Controls.Add(this.groupBox2);
		this.groupBoxUUTConfig.Controls.Add(this.label2);
		this.groupBoxUUTConfig.Controls.Add(this.label1);
		this.groupBoxUUTConfig.Controls.Add(this.cbBand);
		this.groupBoxUUTConfig.Controls.Add(this.cbMode);
		this.groupBoxUUTConfig.Location = new System.Drawing.Point(372, 12);
		this.groupBoxUUTConfig.Name = "groupBoxUUTConfig";
		this.groupBoxUUTConfig.Size = new System.Drawing.Size(575, 266);
		this.groupBoxUUTConfig.TabIndex = 6;
		this.groupBoxUUTConfig.TabStop = false;
		this.groupBoxUUTConfig.Text = "Unit Under Test Configuration";
		this.chkbxFTMDaemon.AutoSize = true;
		this.chkbxFTMDaemon.Location = new System.Drawing.Point(77, 175);
		this.chkbxFTMDaemon.Name = "chkbxFTMDaemon";
		this.chkbxFTMDaemon.Size = new System.Drawing.Size(106, 17);
		this.chkbxFTMDaemon.TabIndex = 39;
		this.chkbxFTMDaemon.Text = "ftmdaemon cmds";
		this.chkbxFTMDaemon.UseVisualStyleBackColor = true;
		this.chkbxFTMDaemon.CheckedChanged += new System.EventHandler(chkbxFTMDaemon_CheckedChanged);
		this.gbWLANCtrls.Controls.Add(this.bnWLANmore);
		this.gbWLANCtrls.Controls.Add(this.label29);
		this.gbWLANCtrls.Controls.Add(this.label26);
		this.gbWLANCtrls.Controls.Add(this.label27);
		this.gbWLANCtrls.Controls.Add(this.chkBxWLANCh0);
		this.gbWLANCtrls.Controls.Add(this.cbMeasMode);
		this.gbWLANCtrls.Controls.Add(this.chkBxWLANCh1);
		this.gbWLANCtrls.Controls.Add(this.lbPhyId);
		this.gbWLANCtrls.Controls.Add(this.cbWLANPhyId);
		this.gbWLANCtrls.Location = new System.Drawing.Point(312, 199);
		this.gbWLANCtrls.Name = "gbWLANCtrls";
		this.gbWLANCtrls.Size = new System.Drawing.Size(254, 58);
		this.gbWLANCtrls.TabIndex = 38;
		this.gbWLANCtrls.TabStop = false;
		this.gbWLANCtrls.Text = "WLAN";
		this.bnWLANmore.FlatAppearance.BorderColor = System.Drawing.Color.DimGray;
		this.bnWLANmore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnWLANmore.Location = new System.Drawing.Point(206, 18);
		this.bnWLANmore.Name = "bnWLANmore";
		this.bnWLANmore.Size = new System.Drawing.Size(42, 23);
		this.bnWLANmore.TabIndex = 38;
		this.bnWLANmore.Text = "More";
		this.bnWLANmore.UseVisualStyleBackColor = true;
		this.bnWLANmore.Click += new System.EventHandler(bnWLANmore_Click);
		this.label29.AutoSize = true;
		this.label29.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label29.Location = new System.Drawing.Point(133, 42);
		this.label29.Name = "label29";
		this.label29.Size = new System.Drawing.Size(50, 12);
		this.label29.TabIndex = 37;
		this.label29.Text = "WLAN BW";
		this.label26.AutoSize = true;
		this.label26.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label26.Location = new System.Drawing.Point(2, 40);
		this.label26.Name = "label26";
		this.label26.Size = new System.Drawing.Size(24, 12);
		this.label26.TabIndex = 34;
		this.label26.Text = "CH0";
		this.label27.AutoSize = true;
		this.label27.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.label27.Location = new System.Drawing.Point(26, 40);
		this.label27.Name = "label27";
		this.label27.Size = new System.Drawing.Size(24, 12);
		this.label27.TabIndex = 35;
		this.label27.Text = "CH1";
		this.chkBxWLANCh0.AutoSize = true;
		this.chkBxWLANCh0.Location = new System.Drawing.Point(10, 21);
		this.chkBxWLANCh0.Name = "chkBxWLANCh0";
		this.chkBxWLANCh0.Size = new System.Drawing.Size(15, 14);
		this.chkBxWLANCh0.TabIndex = 31;
		this.chkBxWLANCh0.UseVisualStyleBackColor = true;
		this.chkBxWLANCh0.CheckedChanged += new System.EventHandler(chkBxWLANCh0_CheckedChanged);
		this.cbMeasMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbMeasMode.FormattingEnabled = true;
		this.cbMeasMode.Items.AddRange(new object[2] { "20MHz", "1MHz" });
		this.cbMeasMode.Location = new System.Drawing.Point(127, 19);
		this.cbMeasMode.Name = "cbMeasMode";
		this.cbMeasMode.Size = new System.Drawing.Size(66, 21);
		this.cbMeasMode.TabIndex = 30;
		this.cbMeasMode.SelectedIndexChanged += new System.EventHandler(cbMeasMode_SelectedIndexChanged);
		this.chkBxWLANCh1.AutoSize = true;
		this.chkBxWLANCh1.Location = new System.Drawing.Point(31, 21);
		this.chkBxWLANCh1.Name = "chkBxWLANCh1";
		this.chkBxWLANCh1.Size = new System.Drawing.Size(15, 14);
		this.chkBxWLANCh1.TabIndex = 32;
		this.chkBxWLANCh1.UseVisualStyleBackColor = true;
		this.chkBxWLANCh1.CheckedChanged += new System.EventHandler(chkBxWLANCh1_CheckedChanged);
		this.lbPhyId.AutoSize = true;
		this.lbPhyId.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lbPhyId.Location = new System.Drawing.Point(60, 42);
		this.lbPhyId.Name = "lbPhyId";
		this.lbPhyId.Size = new System.Drawing.Size(59, 12);
		this.lbPhyId.TabIndex = 29;
		this.lbPhyId.Text = "WLAN PhyId";
		this.cbWLANPhyId.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbWLANPhyId.FormattingEnabled = true;
		this.cbWLANPhyId.Items.AddRange(new object[2] { "PhyA", "PhyB" });
		this.cbWLANPhyId.Location = new System.Drawing.Point(53, 19);
		this.cbWLANPhyId.Name = "cbWLANPhyId";
		this.cbWLANPhyId.Size = new System.Drawing.Size(68, 21);
		this.cbWLANPhyId.TabIndex = 28;
		this.gbWWAN_ChainCtrl.AutoSize = true;
		this.gbWWAN_ChainCtrl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
		this.gbWWAN_ChainCtrl.Controls.Add(this.label_BmId);
		this.gbWWAN_ChainCtrl.Controls.Add(this.numeric_BmId);
		this.gbWWAN_ChainCtrl.Controls.Add(this.cb_LTEC2C3);
		this.gbWWAN_ChainCtrl.Controls.Add(this.lbAntennaSw);
		this.gbWWAN_ChainCtrl.Controls.Add(this.cbAntennaSwitch);
		this.gbWWAN_ChainCtrl.Controls.Add(this.lbChainSub);
		this.gbWWAN_ChainCtrl.Controls.Add(this.cbChain);
		this.gbWWAN_ChainCtrl.Controls.Add(this.cbDiversity);
		this.gbWWAN_ChainCtrl.Location = new System.Drawing.Point(5, 191);
		this.gbWWAN_ChainCtrl.Name = "gbWWAN_ChainCtrl";
		this.gbWWAN_ChainCtrl.Padding = new System.Windows.Forms.Padding(1, 0, 5, 0);
		this.gbWWAN_ChainCtrl.Size = new System.Drawing.Size(300, 71);
		this.gbWWAN_ChainCtrl.TabIndex = 37;
		this.gbWWAN_ChainCtrl.TabStop = false;
		this.gbWWAN_ChainCtrl.Text = "WWAN";
		this.label_BmId.Anchor = System.Windows.Forms.AnchorStyles.Left;
		this.label_BmId.AutoSize = true;
		this.label_BmId.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f);
		this.label_BmId.Location = new System.Drawing.Point(248, 42);
		this.label_BmId.Name = "label_BmId";
		this.label_BmId.Size = new System.Drawing.Size(41, 12);
		this.label_BmId.TabIndex = 28;
		this.label_BmId.Text = "Beam ID";
		this.numeric_BmId.Anchor = System.Windows.Forms.AnchorStyles.Left;
		this.numeric_BmId.Location = new System.Drawing.Point(250, 22);
		this.numeric_BmId.Name = "numeric_BmId";
		this.numeric_BmId.Size = new System.Drawing.Size(42, 20);
		this.numeric_BmId.TabIndex = 27;
		this.cb_LTEC2C3.AutoSize = true;
		this.cb_LTEC2C3.Location = new System.Drawing.Point(6, 38);
		this.cb_LTEC2C3.Name = "cb_LTEC2C3";
		this.cb_LTEC2C3.Size = new System.Drawing.Size(92, 17);
		this.cb_LTEC2C3.TabIndex = 26;
		this.cb_LTEC2C3.Text = "RX2 and RX3";
		this.cb_LTEC2C3.UseVisualStyleBackColor = true;
		this.cb_LTEC2C3.CheckedChanged += new System.EventHandler(cb_LTEC2C3_CheckedChanged);
		this.lbAntennaSw.AutoSize = true;
		this.lbAntennaSw.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lbAntennaSw.Location = new System.Drawing.Point(179, 43);
		this.lbAntennaSw.Name = "lbAntennaSw";
		this.lbAntennaSw.Size = new System.Drawing.Size(42, 12);
		this.lbAntennaSw.TabIndex = 25;
		this.lbAntennaSw.Text = "Ant. Sw.";
		this.cbAntennaSwitch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbAntennaSwitch.FormattingEnabled = true;
		this.cbAntennaSwitch.Items.AddRange(new object[5] { "NoSwitch", "A", "B", "C", "D" });
		this.cbAntennaSwitch.Location = new System.Drawing.Point(165, 21);
		this.cbAntennaSwitch.Name = "cbAntennaSwitch";
		this.cbAntennaSwitch.Size = new System.Drawing.Size(80, 21);
		this.cbAntennaSwitch.TabIndex = 24;
		this.lbChainSub.AutoSize = true;
		this.lbChainSub.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lbChainSub.Location = new System.Drawing.Point(106, 44);
		this.lbChainSub.Name = "lbChainSub";
		this.lbChainSub.Size = new System.Drawing.Size(56, 12);
		this.lbChainSub.TabIndex = 23;
		this.lbChainSub.Text = "Chain/Subs.";
		this.cbChain.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbChain.FormattingEnabled = true;
		this.cbChain.Items.AddRange(new object[3] { "0", "1", "2" });
		this.cbChain.Location = new System.Drawing.Point(111, 21);
		this.cbChain.Name = "cbChain";
		this.cbChain.Size = new System.Drawing.Size(45, 21);
		this.cbChain.TabIndex = 22;
		this.cbDiversity.AutoSize = true;
		this.cbDiversity.Location = new System.Drawing.Point(6, 18);
		this.cbDiversity.Name = "cbDiversity";
		this.cbDiversity.Size = new System.Drawing.Size(96, 17);
		this.cbDiversity.TabIndex = 8;
		this.cbDiversity.Text = "Diversity (RX1)";
		this.cbDiversity.UseVisualStyleBackColor = true;
		this.label25.AutoSize = true;
		this.label25.Location = new System.Drawing.Point(11, 126);
		this.label25.Name = "label25";
		this.label25.Size = new System.Drawing.Size(59, 13);
		this.label25.TabIndex = 27;
		this.label25.Text = "RF Modem";
		this.label23.AutoSize = true;
		this.label23.Location = new System.Drawing.Point(13, 103);
		this.label23.Name = "label23";
		this.label23.Size = new System.Drawing.Size(42, 13);
		this.label23.TabIndex = 25;
		this.label23.Text = "TX BW";
		this.cbTxBW.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbTxBW.FormattingEnabled = true;
		this.cbTxBW.Location = new System.Drawing.Point(76, 99);
		this.cbTxBW.Name = "cbTxBW";
		this.cbTxBW.Size = new System.Drawing.Size(121, 21);
		this.cbTxBW.TabIndex = 24;
		this.cbTxBW.SelectedIndexChanged += new System.EventHandler(cbTxBW_SelectedIndexChanged);
		this.cbModemType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbModemType.DropDownWidth = 160;
		this.cbModemType.FormattingEnabled = true;
		this.cbModemType.Items.AddRange(new object[2] { "MDM9x45/MSM8996 or earlier", "MDM9x55/MSM8998 or later" });
		this.cbModemType.Location = new System.Drawing.Point(76, 124);
		this.cbModemType.Name = "cbModemType";
		this.cbModemType.Size = new System.Drawing.Size(121, 21);
		this.cbModemType.TabIndex = 26;
		this.cbModemType.SelectedIndexChanged += new System.EventHandler(cbModemType_SelectedIndexChanged);
		this.label12.AutoSize = true;
		this.label12.Location = new System.Drawing.Point(1, 155);
		this.label12.Name = "label12";
		this.label12.Size = new System.Drawing.Size(73, 13);
		this.label12.TabIndex = 20;
		this.label12.Text = "Conn. Chip ID";
		this.cbChipID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbChipID.FormattingEnabled = true;
		this.cbChipID.Location = new System.Drawing.Point(76, 150);
		this.cbChipID.Name = "cbChipID";
		this.cbChipID.Size = new System.Drawing.Size(121, 21);
		this.cbChipID.TabIndex = 19;
		this.cbChipID.SelectedIndexChanged += new System.EventHandler(cbChipID_SelectedIndexChanged);
		this.gbReceiver.Controls.Add(this.cbRSSIType);
		this.gbReceiver.Controls.Add(this.lbSamples);
		this.gbReceiver.Controls.Add(this.tbNoOfAverages);
		this.gbReceiver.Location = new System.Drawing.Point(438, 136);
		this.gbReceiver.Name = "gbReceiver";
		this.gbReceiver.Size = new System.Drawing.Size(131, 65);
		this.gbReceiver.TabIndex = 18;
		this.gbReceiver.TabStop = false;
		this.gbReceiver.Text = "Receiver";
		this.cbRSSIType.FormattingEnabled = true;
		this.cbRSSIType.Items.AddRange(new object[3] { "Mean", "95thPercentile", "Max" });
		this.cbRSSIType.Location = new System.Drawing.Point(9, 36);
		this.cbRSSIType.Name = "cbRSSIType";
		this.cbRSSIType.Size = new System.Drawing.Size(110, 21);
		this.cbRSSIType.TabIndex = 19;
		this.cbRSSIType.SelectedIndexChanged += new System.EventHandler(cbRSSIType_SelectedIndexChanged);
		this.lbSamples.AutoSize = true;
		this.lbSamples.Location = new System.Drawing.Point(6, 18);
		this.lbSamples.Name = "lbSamples";
		this.lbSamples.Size = new System.Drawing.Size(76, 13);
		this.lbSamples.TabIndex = 18;
		this.lbSamples.Text = "No of Samples";
		this.tbNoOfAverages.Location = new System.Drawing.Point(91, 16);
		this.tbNoOfAverages.Name = "tbNoOfAverages";
		this.tbNoOfAverages.Size = new System.Drawing.Size(28, 20);
		this.tbNoOfAverages.TabIndex = 17;
		this.tbNoOfAverages.Text = "20";
		this.GroupBoxTransmitter.Controls.Add(this.groupBoxRB);
		this.GroupBoxTransmitter.Controls.Add(this.chkboxMaxPower);
		this.GroupBoxTransmitter.Controls.Add(this.label9);
		this.GroupBoxTransmitter.Controls.Add(this.tbPower);
		this.GroupBoxTransmitter.Controls.Add(this.chkBoxEnableTx);
		this.GroupBoxTransmitter.Location = new System.Drawing.Point(438, 8);
		this.GroupBoxTransmitter.Name = "GroupBoxTransmitter";
		this.GroupBoxTransmitter.Size = new System.Drawing.Size(128, 129);
		this.GroupBoxTransmitter.TabIndex = 7;
		this.GroupBoxTransmitter.TabStop = false;
		this.GroupBoxTransmitter.Text = "Transmitter";
		this.groupBoxRB.Controls.Add(this.label7);
		this.groupBoxRB.Controls.Add(this.label6);
		this.groupBoxRB.Controls.Add(this.tbNumRB);
		this.groupBoxRB.Controls.Add(this.tbStartRB);
		this.groupBoxRB.Location = new System.Drawing.Point(6, 66);
		this.groupBoxRB.Name = "groupBoxRB";
		this.groupBoxRB.Size = new System.Drawing.Size(113, 57);
		this.groupBoxRB.TabIndex = 4;
		this.groupBoxRB.TabStop = false;
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(20, 36);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(44, 13);
		this.label7.TabIndex = 26;
		this.label7.Text = "NumRB";
		this.label6.AutoSize = true;
		this.label6.Location = new System.Drawing.Point(20, 15);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(44, 13);
		this.label6.TabIndex = 25;
		this.label6.Text = "StartRB";
		this.tbNumRB.Location = new System.Drawing.Point(66, 32);
		this.tbNumRB.Name = "tbNumRB";
		this.tbNumRB.Size = new System.Drawing.Size(28, 20);
		this.tbNumRB.TabIndex = 24;
		this.tbNumRB.TextChanged += new System.EventHandler(tbNumRB_TextChanged);
		this.tbStartRB.BackColor = System.Drawing.SystemColors.Window;
		this.tbStartRB.Location = new System.Drawing.Point(66, 11);
		this.tbStartRB.Name = "tbStartRB";
		this.tbStartRB.Size = new System.Drawing.Size(29, 20);
		this.tbStartRB.TabIndex = 23;
		this.tbStartRB.TextChanged += new System.EventHandler(tbStartRB_TextChanged);
		this.chkboxMaxPower.AutoSize = true;
		this.chkboxMaxPower.Location = new System.Drawing.Point(77, 21);
		this.chkboxMaxPower.Name = "chkboxMaxPower";
		this.chkboxMaxPower.Size = new System.Drawing.Size(46, 17);
		this.chkboxMaxPower.TabIndex = 3;
		this.chkboxMaxPower.Text = "Max";
		this.chkboxMaxPower.UseVisualStyleBackColor = true;
		this.chkboxMaxPower.CheckedChanged += new System.EventHandler(chkboxMaxPower_CheckedChanged);
		this.label9.AutoSize = true;
		this.label9.Location = new System.Drawing.Point(6, 47);
		this.label9.Name = "label9";
		this.label9.Size = new System.Drawing.Size(64, 13);
		this.label9.TabIndex = 2;
		this.label9.Text = "Power(dBm)";
		this.tbPower.Location = new System.Drawing.Point(70, 44);
		this.tbPower.Name = "tbPower";
		this.tbPower.Size = new System.Drawing.Size(30, 20);
		this.tbPower.TabIndex = 1;
		this.chkBoxEnableTx.AutoSize = true;
		this.chkBoxEnableTx.Location = new System.Drawing.Point(12, 21);
		this.chkBoxEnableTx.Name = "chkBoxEnableTx";
		this.chkBoxEnableTx.Size = new System.Drawing.Size(57, 17);
		this.chkBoxEnableTx.TabIndex = 0;
		this.chkBoxEnableTx.Text = "Tx ON";
		this.chkBoxEnableTx.UseVisualStyleBackColor = true;
		this.chkBoxEnableTx.CheckedChanged += new System.EventHandler(chkBoxEnableTx_CheckedChanged);
		this.label8.AutoSize = true;
		this.label8.Location = new System.Drawing.Point(13, 78);
		this.label8.Name = "label8";
		this.label8.Size = new System.Drawing.Size(43, 13);
		this.label8.TabIndex = 6;
		this.label8.Text = "RX BW";
		this.cbBW.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbBW.FormattingEnabled = true;
		this.cbBW.Location = new System.Drawing.Point(76, 74);
		this.cbBW.Name = "cbBW";
		this.cbBW.Size = new System.Drawing.Size(121, 21);
		this.cbBW.TabIndex = 5;
		this.cbBW.SelectedIndexChanged += new System.EventHandler(cbBW_SelectedIndexChanged);
		this.groupBox2.Controls.Add(this.ncSingleChannel);
		this.groupBox2.Controls.Add(this.chkBoxSingleChMode);
		this.groupBox2.Controls.Add(this.chkboxChList5);
		this.groupBox2.Controls.Add(this.tbStep5);
		this.groupBox2.Controls.Add(this.ncStop5);
		this.groupBox2.Controls.Add(this.ncStart5);
		this.groupBox2.Controls.Add(this.chkboxChList4);
		this.groupBox2.Controls.Add(this.chkboxChList3);
		this.groupBox2.Controls.Add(this.chkboxChList2);
		this.groupBox2.Controls.Add(this.chkboxChList1);
		this.groupBox2.Controls.Add(this.label5);
		this.groupBox2.Controls.Add(this.label4);
		this.groupBox2.Controls.Add(this.label3);
		this.groupBox2.Controls.Add(this.tbStep4);
		this.groupBox2.Controls.Add(this.tbStep3);
		this.groupBox2.Controls.Add(this.tbStep2);
		this.groupBox2.Controls.Add(this.tbStep1);
		this.groupBox2.Controls.Add(this.ncStop4);
		this.groupBox2.Controls.Add(this.ncStart4);
		this.groupBox2.Controls.Add(this.ncStop3);
		this.groupBox2.Controls.Add(this.ncStart3);
		this.groupBox2.Controls.Add(this.ncStop2);
		this.groupBox2.Controls.Add(this.ncStart2);
		this.groupBox2.Controls.Add(this.ncStop1);
		this.groupBox2.Controls.Add(this.ncStart1);
		this.groupBox2.Location = new System.Drawing.Point(202, 8);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Size = new System.Drawing.Size(228, 190);
		this.groupBox2.TabIndex = 4;
		this.groupBox2.TabStop = false;
		this.groupBox2.Text = "Channel Loop Settings (Downlink channels)";
		this.ncSingleChannel.Location = new System.Drawing.Point(154, 158);
		this.ncSingleChannel.Name = "ncSingleChannel";
		this.ncSingleChannel.Size = new System.Drawing.Size(57, 20);
		this.ncSingleChannel.TabIndex = 29;
		this.chkBoxSingleChMode.AutoSize = true;
		this.chkBoxSingleChMode.Location = new System.Drawing.Point(9, 160);
		this.chkBoxSingleChMode.Name = "chkBoxSingleChMode";
		this.chkBoxSingleChMode.Size = new System.Drawing.Size(149, 17);
		this.chkBoxSingleChMode.TabIndex = 28;
		this.chkBoxSingleChMode.Text = "Single Channel Mode Ch :";
		this.chkBoxSingleChMode.UseVisualStyleBackColor = true;
		this.chkBoxSingleChMode.CheckedChanged += new System.EventHandler(chkBoxSingleChMode_CheckedChanged);
		this.chkboxChList5.AutoSize = true;
		this.chkboxChList5.Location = new System.Drawing.Point(9, 132);
		this.chkboxChList5.Name = "chkboxChList5";
		this.chkboxChList5.Size = new System.Drawing.Size(15, 14);
		this.chkboxChList5.TabIndex = 27;
		this.chkboxChList5.UseVisualStyleBackColor = true;
		this.tbStep5.Location = new System.Drawing.Point(179, 129);
		this.tbStep5.Name = "tbStep5";
		this.tbStep5.Size = new System.Drawing.Size(40, 20);
		this.tbStep5.TabIndex = 26;
		this.ncStop5.Location = new System.Drawing.Point(109, 129);
		this.ncStop5.Name = "ncStop5";
		this.ncStop5.Size = new System.Drawing.Size(64, 20);
		this.ncStop5.TabIndex = 25;
		this.ncStart5.Location = new System.Drawing.Point(35, 129);
		this.ncStart5.Name = "ncStart5";
		this.ncStart5.Size = new System.Drawing.Size(68, 20);
		this.ncStart5.TabIndex = 24;
		this.chkboxChList4.AutoSize = true;
		this.chkboxChList4.Location = new System.Drawing.Point(9, 109);
		this.chkboxChList4.Name = "chkboxChList4";
		this.chkboxChList4.Size = new System.Drawing.Size(15, 14);
		this.chkboxChList4.TabIndex = 18;
		this.chkboxChList4.UseVisualStyleBackColor = true;
		this.chkboxChList3.AutoSize = true;
		this.chkboxChList3.Location = new System.Drawing.Point(9, 85);
		this.chkboxChList3.Name = "chkboxChList3";
		this.chkboxChList3.Size = new System.Drawing.Size(15, 14);
		this.chkboxChList3.TabIndex = 17;
		this.chkboxChList3.UseVisualStyleBackColor = true;
		this.chkboxChList2.AutoSize = true;
		this.chkboxChList2.Location = new System.Drawing.Point(9, 61);
		this.chkboxChList2.Name = "chkboxChList2";
		this.chkboxChList2.Size = new System.Drawing.Size(15, 14);
		this.chkboxChList2.TabIndex = 16;
		this.chkboxChList2.UseVisualStyleBackColor = true;
		this.chkboxChList1.AutoSize = true;
		this.chkboxChList1.Location = new System.Drawing.Point(9, 35);
		this.chkboxChList1.Name = "chkboxChList1";
		this.chkboxChList1.Size = new System.Drawing.Size(15, 14);
		this.chkboxChList1.TabIndex = 15;
		this.chkboxChList1.UseVisualStyleBackColor = true;
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(184, 17);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(29, 13);
		this.label5.TabIndex = 14;
		this.label5.Text = "Step";
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(107, 17);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(29, 13);
		this.label4.TabIndex = 13;
		this.label4.Text = "Stop";
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(51, 17);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(29, 13);
		this.label3.TabIndex = 12;
		this.label3.Text = "Start";
		this.tbStep4.Location = new System.Drawing.Point(179, 106);
		this.tbStep4.Name = "tbStep4";
		this.tbStep4.Size = new System.Drawing.Size(40, 20);
		this.tbStep4.TabIndex = 11;
		this.tbStep3.Location = new System.Drawing.Point(179, 82);
		this.tbStep3.Name = "tbStep3";
		this.tbStep3.Size = new System.Drawing.Size(40, 20);
		this.tbStep3.TabIndex = 10;
		this.tbStep2.Location = new System.Drawing.Point(179, 58);
		this.tbStep2.Name = "tbStep2";
		this.tbStep2.Size = new System.Drawing.Size(40, 20);
		this.tbStep2.TabIndex = 9;
		this.tbStep1.Location = new System.Drawing.Point(179, 32);
		this.tbStep1.Name = "tbStep1";
		this.tbStep1.Size = new System.Drawing.Size(40, 20);
		this.tbStep1.TabIndex = 8;
		this.ncStop4.Location = new System.Drawing.Point(109, 106);
		this.ncStop4.Name = "ncStop4";
		this.ncStop4.Size = new System.Drawing.Size(64, 20);
		this.ncStop4.TabIndex = 7;
		this.ncStart4.Location = new System.Drawing.Point(35, 106);
		this.ncStart4.Name = "ncStart4";
		this.ncStart4.Size = new System.Drawing.Size(68, 20);
		this.ncStart4.TabIndex = 6;
		this.ncStop3.Location = new System.Drawing.Point(109, 82);
		this.ncStop3.Name = "ncStop3";
		this.ncStop3.Size = new System.Drawing.Size(64, 20);
		this.ncStop3.TabIndex = 5;
		this.ncStart3.Location = new System.Drawing.Point(35, 82);
		this.ncStart3.Name = "ncStart3";
		this.ncStart3.Size = new System.Drawing.Size(68, 20);
		this.ncStart3.TabIndex = 4;
		this.ncStop2.Location = new System.Drawing.Point(109, 58);
		this.ncStop2.Name = "ncStop2";
		this.ncStop2.Size = new System.Drawing.Size(64, 20);
		this.ncStop2.TabIndex = 3;
		this.ncStart2.Location = new System.Drawing.Point(35, 58);
		this.ncStart2.Name = "ncStart2";
		this.ncStart2.Size = new System.Drawing.Size(68, 20);
		this.ncStart2.TabIndex = 2;
		this.ncStop1.Location = new System.Drawing.Point(109, 32);
		this.ncStop1.Name = "ncStop1";
		this.ncStop1.Size = new System.Drawing.Size(64, 20);
		this.ncStop1.TabIndex = 1;
		this.ncStart1.Location = new System.Drawing.Point(35, 32);
		this.ncStart1.Name = "ncStart1";
		this.ncStart1.Size = new System.Drawing.Size(68, 20);
		this.ncStart1.TabIndex = 0;
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(13, 52);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(32, 13);
		this.label2.TabIndex = 3;
		this.label2.Text = "Band";
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(13, 28);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(34, 13);
		this.label1.TabIndex = 2;
		this.label1.Text = "Mode";
		this.cbBand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbBand.FormattingEnabled = true;
		this.cbBand.Location = new System.Drawing.Point(76, 49);
		this.cbBand.Name = "cbBand";
		this.cbBand.Size = new System.Drawing.Size(121, 21);
		this.cbBand.TabIndex = 1;
		this.cbBand.SelectedIndexChanged += new System.EventHandler(cbBand_SelectedIndexChanged);
		this.cbMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbMode.FormattingEnabled = true;
		this.cbMode.Location = new System.Drawing.Point(76, 24);
		this.cbMode.Name = "cbMode";
		this.cbMode.Size = new System.Drawing.Size(121, 21);
		this.cbMode.TabIndex = 0;
		this.cbMode.SelectedIndexChanged += new System.EventHandler(cbMode_SelectedIndexChanged);
		this.chkboxTargetDeviceType.AutoSize = true;
		this.chkboxTargetDeviceType.Location = new System.Drawing.Point(20, 92);
		this.chkboxTargetDeviceType.Name = "chkboxTargetDeviceType";
		this.chkboxTargetDeviceType.Size = new System.Drawing.Size(83, 17);
		this.chkboxTargetDeviceType.TabIndex = 21;
		this.chkboxTargetDeviceType.Text = "APQ device";
		this.chkboxTargetDeviceType.UseVisualStyleBackColor = true;
		this.chkboxTargetDeviceType.CheckedChanged += new System.EventHandler(chkboxTargetDeviceType_CheckedChanged);
		this.bnCheckPhoneConnected.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
		this.bnCheckPhoneConnected.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnCheckPhoneConnected.Location = new System.Drawing.Point(31, 14);
		this.bnCheckPhoneConnected.Name = "bnCheckPhoneConnected";
		this.bnCheckPhoneConnected.Size = new System.Drawing.Size(139, 24);
		this.bnCheckPhoneConnected.TabIndex = 7;
		this.bnCheckPhoneConnected.Text = "CHECK PHONE CONN.";
		this.bnCheckPhoneConnected.UseVisualStyleBackColor = true;
		this.bnCheckPhoneConnected.Click += new System.EventHandler(bnCheckPhoneConnected_Click);
		this.groupBoxPhoneStatus.BackColor = System.Drawing.SystemColors.Control;
		this.groupBoxPhoneStatus.Controls.Add(this.label32);
		this.groupBoxPhoneStatus.Controls.Add(this.cb_UDTMode);
		this.groupBoxPhoneStatus.Controls.Add(this.tb_UDTIp);
		this.groupBoxPhoneStatus.Controls.Add(this.label31);
		this.groupBoxPhoneStatus.Controls.Add(this.tb_HWID);
		this.groupBoxPhoneStatus.Controls.Add(this.cb_Fusion);
		this.groupBoxPhoneStatus.Controls.Add(this.tbImei);
		this.groupBoxPhoneStatus.Controls.Add(this.labelPhoneStatus);
		this.groupBoxPhoneStatus.Controls.Add(this.bnCheckPhoneConnected);
		this.groupBoxPhoneStatus.Controls.Add(this.chkboxTargetDeviceType);
		this.groupBoxPhoneStatus.Location = new System.Drawing.Point(12, 12);
		this.groupBoxPhoneStatus.Name = "groupBoxPhoneStatus";
		this.groupBoxPhoneStatus.Size = new System.Drawing.Size(187, 175);
		this.groupBoxPhoneStatus.TabIndex = 8;
		this.groupBoxPhoneStatus.TabStop = false;
		this.groupBoxPhoneStatus.Text = "Connection Status";
		this.label32.AutoSize = true;
		this.label32.Location = new System.Drawing.Point(73, 143);
		this.label32.Name = "label32";
		this.label32.Size = new System.Drawing.Size(20, 13);
		this.label32.TabIndex = 27;
		this.label32.Text = "IP:";
		this.cb_UDTMode.AutoSize = true;
		this.cb_UDTMode.Location = new System.Drawing.Point(20, 142);
		this.cb_UDTMode.Name = "cb_UDTMode";
		this.cb_UDTMode.Size = new System.Drawing.Size(49, 17);
		this.cb_UDTMode.TabIndex = 26;
		this.cb_UDTMode.Text = "UDT";
		this.cb_UDTMode.UseVisualStyleBackColor = true;
		this.cb_UDTMode.CheckedChanged += new System.EventHandler(cb_UDTMode_CheckedChanged);
		this.tb_UDTIp.Location = new System.Drawing.Point(93, 140);
		this.tb_UDTIp.Name = "tb_UDTIp";
		this.tb_UDTIp.Size = new System.Drawing.Size(85, 20);
		this.tb_UDTIp.TabIndex = 25;
		this.tb_UDTIp.TextChanged += new System.EventHandler(tb_UDTIp_TextChanged);
		this.label31.AutoSize = true;
		this.label31.Location = new System.Drawing.Point(122, 100);
		this.label31.Name = "label31";
		this.label31.Size = new System.Drawing.Size(37, 13);
		this.label31.TabIndex = 24;
		this.label31.Text = "HWID";
		this.tb_HWID.Location = new System.Drawing.Point(110, 115);
		this.tb_HWID.Name = "tb_HWID";
		this.tb_HWID.Size = new System.Drawing.Size(66, 20);
		this.tb_HWID.TabIndex = 23;
		this.tb_HWID.Text = "2640,1969";
		this.cb_Fusion.AutoSize = true;
		this.cb_Fusion.Location = new System.Drawing.Point(20, 117);
		this.cb_Fusion.Name = "cb_Fusion";
		this.cb_Fusion.Size = new System.Drawing.Size(94, 17);
		this.cb_Fusion.TabIndex = 22;
		this.cb_Fusion.Text = "Fusion Device";
		this.cb_Fusion.UseVisualStyleBackColor = true;
		this.cb_Fusion.CheckedChanged += new System.EventHandler(cb_Fusion_CheckedChanged);
		this.tbImei.BackColor = System.Drawing.SystemColors.ControlLight;
		this.tbImei.BorderStyle = System.Windows.Forms.BorderStyle.None;
		this.tbImei.Location = new System.Drawing.Point(20, 68);
		this.tbImei.Name = "tbImei";
		this.tbImei.ReadOnly = true;
		this.tbImei.Size = new System.Drawing.Size(158, 13);
		this.tbImei.TabIndex = 11;
		this.labelPhoneStatus.BackColor = System.Drawing.SystemColors.ControlLight;
		this.labelPhoneStatus.Location = new System.Drawing.Point(20, 41);
		this.labelPhoneStatus.Name = "labelPhoneStatus";
		this.labelPhoneStatus.Size = new System.Drawing.Size(158, 26);
		this.labelPhoneStatus.TabIndex = 8;
		this.labelPhoneStatus.Text = "    ";
		this.cbOnlineModeOnExit.AutoSize = true;
		this.cbOnlineModeOnExit.Location = new System.Drawing.Point(957, 166);
		this.cbOnlineModeOnExit.Name = "cbOnlineModeOnExit";
		this.cbOnlineModeOnExit.Size = new System.Drawing.Size(80, 56);
		this.cbOnlineModeOnExit.TabIndex = 10;
		this.cbOnlineModeOnExit.Text = "Set device \r\nto online \r\nmode on\r\ntool exit";
		this.cbOnlineModeOnExit.UseVisualStyleBackColor = true;
		this.gbDataLogOption.Controls.Add(this.tbLogFilePrefix);
		this.gbDataLogOption.Controls.Add(this.label30);
		this.gbDataLogOption.Controls.Add(this.bnBrowseLogFolder);
		this.gbDataLogOption.Controls.Add(this.bnOpenLogFolder);
		this.gbDataLogOption.Controls.Add(this.tbLogFileFolder);
		this.gbDataLogOption.Controls.Add(this.lbLogFileFolder);
		this.gbDataLogOption.Location = new System.Drawing.Point(12, 193);
		this.gbDataLogOption.Name = "gbDataLogOption";
		this.gbDataLogOption.Size = new System.Drawing.Size(187, 102);
		this.gbDataLogOption.TabIndex = 9;
		this.gbDataLogOption.TabStop = false;
		this.gbDataLogOption.Text = "Data Log Option";
		this.tbLogFilePrefix.Location = new System.Drawing.Point(70, 43);
		this.tbLogFilePrefix.Name = "tbLogFilePrefix";
		this.tbLogFilePrefix.Size = new System.Drawing.Size(91, 20);
		this.tbLogFilePrefix.TabIndex = 6;
		this.tbLogFilePrefix.TextChanged += new System.EventHandler(tbLogFilePrefix_TextChanged);
		this.label30.AutoSize = true;
		this.label30.Location = new System.Drawing.Point(4, 51);
		this.label30.Name = "label30";
		this.label30.Size = new System.Drawing.Size(67, 13);
		this.label30.TabIndex = 5;
		this.label30.Text = "LogFilePrefix";
		this.bnBrowseLogFolder.Location = new System.Drawing.Point(164, 23);
		this.bnBrowseLogFolder.Name = "bnBrowseLogFolder";
		this.bnBrowseLogFolder.Size = new System.Drawing.Size(17, 20);
		this.bnBrowseLogFolder.TabIndex = 3;
		this.bnBrowseLogFolder.UseVisualStyleBackColor = true;
		this.bnBrowseLogFolder.Click += new System.EventHandler(bnBrowseLogFolder_Click);
		this.bnOpenLogFolder.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
		this.bnOpenLogFolder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnOpenLogFolder.Location = new System.Drawing.Point(40, 70);
		this.bnOpenLogFolder.Name = "bnOpenLogFolder";
		this.bnOpenLogFolder.Size = new System.Drawing.Size(118, 25);
		this.bnOpenLogFolder.TabIndex = 2;
		this.bnOpenLogFolder.Text = "Open Log Folder";
		this.bnOpenLogFolder.UseVisualStyleBackColor = true;
		this.bnOpenLogFolder.Click += new System.EventHandler(bnOpenLogFolder_Click);
		this.tbLogFileFolder.Location = new System.Drawing.Point(70, 23);
		this.tbLogFileFolder.Name = "tbLogFileFolder";
		this.tbLogFileFolder.Size = new System.Drawing.Size(91, 20);
		this.tbLogFileFolder.TabIndex = 1;
		this.lbLogFileFolder.AutoSize = true;
		this.lbLogFileFolder.Location = new System.Drawing.Point(4, 26);
		this.lbLogFileFolder.Name = "lbLogFileFolder";
		this.lbLogFileFolder.Size = new System.Drawing.Size(57, 13);
		this.lbLogFileFolder.TabIndex = 0;
		this.lbLogFileFolder.Text = "Log Folder";
		this.gbChartOptions.Controls.Add(this.cbTransientCheck);
		this.gbChartOptions.Controls.Add(this.bnSaveChart);
		this.gbChartOptions.Controls.Add(this.label15);
		this.gbChartOptions.Controls.Add(this.label14);
		this.gbChartOptions.Controls.Add(this.tbYmin);
		this.gbChartOptions.Controls.Add(this.tbYmax);
		this.gbChartOptions.Location = new System.Drawing.Point(12, 301);
		this.gbChartOptions.Name = "gbChartOptions";
		this.gbChartOptions.Size = new System.Drawing.Size(187, 101);
		this.gbChartOptions.TabIndex = 10;
		this.gbChartOptions.TabStop = false;
		this.gbChartOptions.Text = "Chart Options";
		this.cbTransientCheck.AutoSize = true;
		this.cbTransientCheck.Location = new System.Drawing.Point(20, 21);
		this.cbTransientCheck.Name = "cbTransientCheck";
		this.cbTransientCheck.Size = new System.Drawing.Size(145, 17);
		this.cbTransientCheck.TabIndex = 24;
		this.cbTransientCheck.Text = "Mark Transients on Chart";
		this.cbTransientCheck.UseVisualStyleBackColor = true;
		this.cbTransientCheck.CheckedChanged += new System.EventHandler(cbTransientCheck_CheckedChanged);
		this.bnSaveChart.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
		this.bnSaveChart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnSaveChart.Location = new System.Drawing.Point(95, 63);
		this.bnSaveChart.Name = "bnSaveChart";
		this.bnSaveChart.Size = new System.Drawing.Size(75, 23);
		this.bnSaveChart.TabIndex = 23;
		this.bnSaveChart.Text = "Save Chart";
		this.bnSaveChart.UseVisualStyleBackColor = true;
		this.bnSaveChart.Click += new System.EventHandler(bnSaveChart_Click);
		this.label15.AutoSize = true;
		this.label15.Location = new System.Drawing.Point(14, 50);
		this.label15.Name = "label15";
		this.label15.Size = new System.Drawing.Size(37, 13);
		this.label15.TabIndex = 1;
		this.label15.Text = "Y Max";
		this.label14.AutoSize = true;
		this.label14.Location = new System.Drawing.Point(14, 72);
		this.label14.Name = "label14";
		this.label14.Size = new System.Drawing.Size(34, 13);
		this.label14.TabIndex = 0;
		this.label14.Text = "Y Min";
		this.tbYmin.Location = new System.Drawing.Point(51, 68);
		this.tbYmin.Name = "tbYmin";
		this.tbYmin.Size = new System.Drawing.Size(30, 20);
		this.tbYmin.TabIndex = 18;
		this.tbYmin.Text = "-120";
		this.tbYmin.TextChanged += new System.EventHandler(tbYmin_TextChanged);
		this.tbYmax.Location = new System.Drawing.Point(51, 46);
		this.tbYmax.Name = "tbYmax";
		this.tbYmax.Size = new System.Drawing.Size(30, 20);
		this.tbYmax.TabIndex = 17;
		this.tbYmax.Text = "-60";
		this.tbYmax.TextChanged += new System.EventHandler(tbYmax_TextChanged);
		this.gbLimitTesting.Controls.Add(this.tbLimitExcdRX3);
		this.gbLimitTesting.Controls.Add(this.tbDeltaLimitRX3);
		this.gbLimitTesting.Controls.Add(this.tbDeltaLimitRX2);
		this.gbLimitTesting.Controls.Add(this.tbLimitExcdRX2);
		this.gbLimitTesting.Controls.Add(this.tbLimitLineRX3);
		this.gbLimitTesting.Controls.Add(this.tbMaxFreqRX3);
		this.gbLimitTesting.Controls.Add(this.tbMaxFreqRX2);
		this.gbLimitTesting.Controls.Add(this.tbLimitLineRX2);
		this.gbLimitTesting.Controls.Add(this.tbMaxChanRX3);
		this.gbLimitTesting.Controls.Add(this.label22);
		this.gbLimitTesting.Controls.Add(this.tbMaxDeltaRX2);
		this.gbLimitTesting.Controls.Add(this.label28);
		this.gbLimitTesting.Controls.Add(this.tbMaxChanRX2);
		this.gbLimitTesting.Controls.Add(this.tbMaxDeltaRX3);
		this.gbLimitTesting.Controls.Add(this.label19);
		this.gbLimitTesting.Controls.Add(this.label18);
		this.gbLimitTesting.Controls.Add(this.label17);
		this.gbLimitTesting.Controls.Add(this.label16);
		this.gbLimitTesting.Controls.Add(this.tbLimitExcdRX1);
		this.gbLimitTesting.Controls.Add(this.tbDeltaLimitRX1);
		this.gbLimitTesting.Controls.Add(this.tbDeltaLimitRX0);
		this.gbLimitTesting.Controls.Add(this.tbLimitExcdRX0);
		this.gbLimitTesting.Controls.Add(this.bnBrowseDataFile);
		this.gbLimitTesting.Controls.Add(this.tbLimitLineRX1);
		this.gbLimitTesting.Controls.Add(this.tbMaxFreqRX1);
		this.gbLimitTesting.Controls.Add(this.labelDataFile2);
		this.gbLimitTesting.Controls.Add(this.labelDataFile1);
		this.gbLimitTesting.Controls.Add(this.tbMaxFreqRX0);
		this.gbLimitTesting.Controls.Add(this.tbLimitLineRX0);
		this.gbLimitTesting.Controls.Add(this.tbParentDataFile);
		this.gbLimitTesting.Controls.Add(this.tbMaxChanRX1);
		this.gbLimitTesting.Controls.Add(this.label11);
		this.gbLimitTesting.Controls.Add(this.tbMaxDeltaRX0);
		this.gbLimitTesting.Controls.Add(this.label10);
		this.gbLimitTesting.Controls.Add(this.tbMaxChanRX0);
		this.gbLimitTesting.Controls.Add(this.tbMaxDeltaRX1);
		this.gbLimitTesting.Controls.Add(this.radioButtonDeltaLimit);
		this.gbLimitTesting.Controls.Add(this.radioButtonLimitLine);
		this.gbLimitTesting.Controls.Add(this.radioButtonOff);
		this.gbLimitTesting.Location = new System.Drawing.Point(205, 277);
		this.gbLimitTesting.Name = "gbLimitTesting";
		this.gbLimitTesting.Size = new System.Drawing.Size(742, 129);
		this.gbLimitTesting.TabIndex = 11;
		this.gbLimitTesting.TabStop = false;
		this.gbLimitTesting.Text = "Limit Testing";
		this.tbLimitExcdRX3.Enabled = false;
		this.tbLimitExcdRX3.Location = new System.Drawing.Point(448, 101);
		this.tbLimitExcdRX3.Name = "tbLimitExcdRX3";
		this.tbLimitExcdRX3.Size = new System.Drawing.Size(42, 20);
		this.tbLimitExcdRX3.TabIndex = 43;
		this.tbDeltaLimitRX3.Location = new System.Drawing.Point(213, 101);
		this.tbDeltaLimitRX3.Name = "tbDeltaLimitRX3";
		this.tbDeltaLimitRX3.Size = new System.Drawing.Size(34, 20);
		this.tbDeltaLimitRX3.TabIndex = 36;
		this.tbDeltaLimitRX3.Text = "2.0";
		this.tbDeltaLimitRX2.Location = new System.Drawing.Point(213, 81);
		this.tbDeltaLimitRX2.Name = "tbDeltaLimitRX2";
		this.tbDeltaLimitRX2.Size = new System.Drawing.Size(34, 20);
		this.tbDeltaLimitRX2.TabIndex = 35;
		this.tbDeltaLimitRX2.Text = "2.0";
		this.tbLimitExcdRX2.Enabled = false;
		this.tbLimitExcdRX2.Location = new System.Drawing.Point(448, 81);
		this.tbLimitExcdRX2.Name = "tbLimitExcdRX2";
		this.tbLimitExcdRX2.Size = new System.Drawing.Size(42, 20);
		this.tbLimitExcdRX2.TabIndex = 42;
		this.tbLimitLineRX3.Location = new System.Drawing.Point(123, 102);
		this.tbLimitLineRX3.Name = "tbLimitLineRX3";
		this.tbLimitLineRX3.Size = new System.Drawing.Size(34, 20);
		this.tbLimitLineRX3.TabIndex = 33;
		this.tbLimitLineRX3.Text = "-96";
		this.tbMaxFreqRX3.Enabled = false;
		this.tbMaxFreqRX3.Location = new System.Drawing.Point(375, 101);
		this.tbMaxFreqRX3.Name = "tbMaxFreqRX3";
		this.tbMaxFreqRX3.Size = new System.Drawing.Size(42, 20);
		this.tbMaxFreqRX3.TabIndex = 41;
		this.tbMaxFreqRX2.Enabled = false;
		this.tbMaxFreqRX2.Location = new System.Drawing.Point(374, 81);
		this.tbMaxFreqRX2.Name = "tbMaxFreqRX2";
		this.tbMaxFreqRX2.Size = new System.Drawing.Size(43, 20);
		this.tbMaxFreqRX2.TabIndex = 40;
		this.tbLimitLineRX2.Location = new System.Drawing.Point(123, 83);
		this.tbLimitLineRX2.Name = "tbLimitLineRX2";
		this.tbLimitLineRX2.Size = new System.Drawing.Size(34, 20);
		this.tbLimitLineRX2.TabIndex = 32;
		this.tbLimitLineRX2.Text = "-96";
		this.tbMaxChanRX3.Enabled = false;
		this.tbMaxChanRX3.Location = new System.Drawing.Point(325, 101);
		this.tbMaxChanRX3.Name = "tbMaxChanRX3";
		this.tbMaxChanRX3.Size = new System.Drawing.Size(43, 20);
		this.tbMaxChanRX3.TabIndex = 39;
		this.label22.AutoSize = true;
		this.label22.Location = new System.Drawing.Point(12, 105);
		this.label22.Name = "label22";
		this.label22.Size = new System.Drawing.Size(28, 13);
		this.label22.TabIndex = 31;
		this.label22.Text = "RX3";
		this.tbMaxDeltaRX2.Enabled = false;
		this.tbMaxDeltaRX2.Location = new System.Drawing.Point(277, 81);
		this.tbMaxDeltaRX2.Name = "tbMaxDeltaRX2";
		this.tbMaxDeltaRX2.Size = new System.Drawing.Size(46, 20);
		this.tbMaxDeltaRX2.TabIndex = 34;
		this.label28.AutoSize = true;
		this.label28.Location = new System.Drawing.Point(12, 86);
		this.label28.Name = "label28";
		this.label28.Size = new System.Drawing.Size(28, 13);
		this.label28.TabIndex = 30;
		this.label28.Text = "RX2";
		this.tbMaxChanRX2.Enabled = false;
		this.tbMaxChanRX2.Location = new System.Drawing.Point(325, 81);
		this.tbMaxChanRX2.Name = "tbMaxChanRX2";
		this.tbMaxChanRX2.Size = new System.Drawing.Size(43, 20);
		this.tbMaxChanRX2.TabIndex = 38;
		this.tbMaxDeltaRX3.Enabled = false;
		this.tbMaxDeltaRX3.Location = new System.Drawing.Point(277, 101);
		this.tbMaxDeltaRX3.Name = "tbMaxDeltaRX3";
		this.tbMaxDeltaRX3.Size = new System.Drawing.Size(46, 20);
		this.tbMaxDeltaRX3.TabIndex = 37;
		this.label19.AutoSize = true;
		this.label19.Enabled = false;
		this.label19.Location = new System.Drawing.Point(434, 18);
		this.label19.Name = "label19";
		this.label19.Size = new System.Drawing.Size(85, 13);
		this.label19.TabIndex = 29;
		this.label19.Text = "Limit Exceeded?";
		this.label18.AutoSize = true;
		this.label18.Enabled = false;
		this.label18.Location = new System.Drawing.Point(370, 18);
		this.label18.Name = "label18";
		this.label18.Size = new System.Drawing.Size(57, 13);
		this.label18.TabIndex = 28;
		this.label18.Text = "Frequency";
		this.label17.AutoSize = true;
		this.label17.Enabled = false;
		this.label17.Location = new System.Drawing.Point(322, 18);
		this.label17.Name = "label17";
		this.label17.Size = new System.Drawing.Size(46, 13);
		this.label17.TabIndex = 27;
		this.label17.Text = "Channel";
		this.label16.AutoSize = true;
		this.label16.Enabled = false;
		this.label16.Location = new System.Drawing.Point(272, 18);
		this.label16.Name = "label16";
		this.label16.Size = new System.Drawing.Size(52, 13);
		this.label16.TabIndex = 26;
		this.label16.Text = "MaxDelta";
		this.tbLimitExcdRX1.Enabled = false;
		this.tbLimitExcdRX1.Location = new System.Drawing.Point(448, 59);
		this.tbLimitExcdRX1.Name = "tbLimitExcdRX1";
		this.tbLimitExcdRX1.Size = new System.Drawing.Size(42, 20);
		this.tbLimitExcdRX1.TabIndex = 25;
		this.tbDeltaLimitRX1.Location = new System.Drawing.Point(213, 59);
		this.tbDeltaLimitRX1.Name = "tbDeltaLimitRX1";
		this.tbDeltaLimitRX1.Size = new System.Drawing.Size(34, 20);
		this.tbDeltaLimitRX1.TabIndex = 18;
		this.tbDeltaLimitRX1.Text = "2.0";
		this.tbDeltaLimitRX0.Location = new System.Drawing.Point(213, 39);
		this.tbDeltaLimitRX0.Name = "tbDeltaLimitRX0";
		this.tbDeltaLimitRX0.Size = new System.Drawing.Size(34, 20);
		this.tbDeltaLimitRX0.TabIndex = 17;
		this.tbDeltaLimitRX0.Text = "2.0";
		this.tbLimitExcdRX0.Enabled = false;
		this.tbLimitExcdRX0.Location = new System.Drawing.Point(448, 39);
		this.tbLimitExcdRX0.Name = "tbLimitExcdRX0";
		this.tbLimitExcdRX0.Size = new System.Drawing.Size(42, 20);
		this.tbLimitExcdRX0.TabIndex = 24;
		this.bnBrowseDataFile.FlatAppearance.BorderColor = System.Drawing.Color.DimGray;
		this.bnBrowseDataFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnBrowseDataFile.Location = new System.Drawing.Point(679, 47);
		this.bnBrowseDataFile.Name = "bnBrowseDataFile";
		this.bnBrowseDataFile.Size = new System.Drawing.Size(57, 22);
		this.bnBrowseDataFile.TabIndex = 15;
		this.bnBrowseDataFile.Text = "Browse";
		this.bnBrowseDataFile.UseVisualStyleBackColor = true;
		this.bnBrowseDataFile.Click += new System.EventHandler(bnBrowseDataFile_Click);
		this.tbLimitLineRX1.Location = new System.Drawing.Point(123, 60);
		this.tbLimitLineRX1.Name = "tbLimitLineRX1";
		this.tbLimitLineRX1.Size = new System.Drawing.Size(34, 20);
		this.tbLimitLineRX1.TabIndex = 6;
		this.tbLimitLineRX1.Text = "-96";
		this.tbMaxFreqRX1.Enabled = false;
		this.tbMaxFreqRX1.Location = new System.Drawing.Point(375, 59);
		this.tbMaxFreqRX1.Name = "tbMaxFreqRX1";
		this.tbMaxFreqRX1.Size = new System.Drawing.Size(42, 20);
		this.tbMaxFreqRX1.TabIndex = 23;
		this.labelDataFile2.AutoSize = true;
		this.labelDataFile2.Location = new System.Drawing.Point(529, 33);
		this.labelDataFile2.Name = "labelDataFile2";
		this.labelDataFile2.Size = new System.Drawing.Size(184, 13);
		this.labelDataFile2.TabIndex = 14;
		this.labelDataFile2.Text = "(Provide full path if not in Data Folder)";
		this.labelDataFile1.AutoSize = true;
		this.labelDataFile1.Location = new System.Drawing.Point(568, 19);
		this.labelDataFile1.Name = "labelDataFile1";
		this.labelDataFile1.Size = new System.Drawing.Size(83, 13);
		this.labelDataFile1.TabIndex = 13;
		this.labelDataFile1.Text = "Parent Data File";
		this.tbMaxFreqRX0.Enabled = false;
		this.tbMaxFreqRX0.Location = new System.Drawing.Point(374, 39);
		this.tbMaxFreqRX0.Name = "tbMaxFreqRX0";
		this.tbMaxFreqRX0.Size = new System.Drawing.Size(43, 20);
		this.tbMaxFreqRX0.TabIndex = 22;
		this.tbLimitLineRX0.Location = new System.Drawing.Point(123, 41);
		this.tbLimitLineRX0.Name = "tbLimitLineRX0";
		this.tbLimitLineRX0.Size = new System.Drawing.Size(34, 20);
		this.tbLimitLineRX0.TabIndex = 5;
		this.tbLimitLineRX0.Text = "-96";
		this.tbParentDataFile.Location = new System.Drawing.Point(532, 49);
		this.tbParentDataFile.Name = "tbParentDataFile";
		this.tbParentDataFile.Size = new System.Drawing.Size(141, 20);
		this.tbParentDataFile.TabIndex = 12;
		this.tbMaxChanRX1.Enabled = false;
		this.tbMaxChanRX1.Location = new System.Drawing.Point(325, 59);
		this.tbMaxChanRX1.Name = "tbMaxChanRX1";
		this.tbMaxChanRX1.Size = new System.Drawing.Size(43, 20);
		this.tbMaxChanRX1.TabIndex = 21;
		this.label11.AutoSize = true;
		this.label11.Location = new System.Drawing.Point(12, 63);
		this.label11.Name = "label11";
		this.label11.Size = new System.Drawing.Size(71, 13);
		this.label11.TabIndex = 4;
		this.label11.Text = "Diversity RX1";
		this.tbMaxDeltaRX0.Enabled = false;
		this.tbMaxDeltaRX0.Location = new System.Drawing.Point(277, 39);
		this.tbMaxDeltaRX0.Name = "tbMaxDeltaRX0";
		this.tbMaxDeltaRX0.Size = new System.Drawing.Size(46, 20);
		this.tbMaxDeltaRX0.TabIndex = 16;
		this.label10.AutoSize = true;
		this.label10.Location = new System.Drawing.Point(12, 44);
		this.label10.Name = "label10";
		this.label10.Size = new System.Drawing.Size(65, 13);
		this.label10.TabIndex = 3;
		this.label10.Text = "Primary RX0";
		this.tbMaxChanRX0.Enabled = false;
		this.tbMaxChanRX0.Location = new System.Drawing.Point(325, 39);
		this.tbMaxChanRX0.Name = "tbMaxChanRX0";
		this.tbMaxChanRX0.Size = new System.Drawing.Size(43, 20);
		this.tbMaxChanRX0.TabIndex = 20;
		this.tbMaxDeltaRX1.Enabled = false;
		this.tbMaxDeltaRX1.Location = new System.Drawing.Point(277, 59);
		this.tbMaxDeltaRX1.Name = "tbMaxDeltaRX1";
		this.tbMaxDeltaRX1.Size = new System.Drawing.Size(46, 20);
		this.tbMaxDeltaRX1.TabIndex = 19;
		this.radioButtonDeltaLimit.AutoSize = true;
		this.radioButtonDeltaLimit.Location = new System.Drawing.Point(196, 7);
		this.radioButtonDeltaLimit.Name = "radioButtonDeltaLimit";
		this.radioButtonDeltaLimit.Size = new System.Drawing.Size(77, 30);
		this.radioButtonDeltaLimit.TabIndex = 2;
		this.radioButtonDeltaLimit.TabStop = true;
		this.radioButtonDeltaLimit.Text = "Delta Limit \r\nwrt Parent";
		this.radioButtonDeltaLimit.UseVisualStyleBackColor = true;
		this.radioButtonDeltaLimit.CheckedChanged += new System.EventHandler(radioButtonDeltaLimit_CheckedChanged);
		this.radioButtonLimitLine.AutoSize = true;
		this.radioButtonLimitLine.Location = new System.Drawing.Point(108, 14);
		this.radioButtonLimitLine.Name = "radioButtonLimitLine";
		this.radioButtonLimitLine.Size = new System.Drawing.Size(69, 17);
		this.radioButtonLimitLine.TabIndex = 1;
		this.radioButtonLimitLine.TabStop = true;
		this.radioButtonLimitLine.Text = "Limit Line";
		this.radioButtonLimitLine.UseVisualStyleBackColor = true;
		this.radioButtonLimitLine.CheckedChanged += new System.EventHandler(radioButtonLimitLine_CheckedChanged);
		this.radioButtonOff.AutoSize = true;
		this.radioButtonOff.Location = new System.Drawing.Point(23, 14);
		this.radioButtonOff.Name = "radioButtonOff";
		this.radioButtonOff.Size = new System.Drawing.Size(39, 17);
		this.radioButtonOff.TabIndex = 0;
		this.radioButtonOff.TabStop = true;
		this.radioButtonOff.Text = "Off";
		this.radioButtonOff.UseVisualStyleBackColor = true;
		this.lbRunInfo.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
		this.lbRunInfo.AutoSize = true;
		this.lbRunInfo.Location = new System.Drawing.Point(369, 874);
		this.lbRunInfo.Name = "lbRunInfo";
		this.lbRunInfo.Size = new System.Drawing.Size(10, 13);
		this.lbRunInfo.TabIndex = 16;
		this.lbRunInfo.Text = ".";
		this.bnAbout.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
		this.bnAbout.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
		this.bnAbout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnAbout.Location = new System.Drawing.Point(954, 58);
		this.bnAbout.Name = "bnAbout";
		this.bnAbout.Size = new System.Drawing.Size(71, 28);
		this.bnAbout.TabIndex = 17;
		this.bnAbout.Text = "About";
		this.bnAbout.UseVisualStyleBackColor = true;
		this.bnAbout.Click += new System.EventHandler(bnAbout_Click);
		this.gbCalibrationScan.Controls.Add(this.label24);
		this.gbCalibrationScan.Controls.Add(this.cbTEControlType);
		this.gbCalibrationScan.Controls.Add(this.groupBox1);
		this.gbCalibrationScan.Controls.Add(this.chkboxCalScan);
		this.gbCalibrationScan.Location = new System.Drawing.Point(205, 12);
		this.gbCalibrationScan.Name = "gbCalibrationScan";
		this.gbCalibrationScan.Size = new System.Drawing.Size(161, 201);
		this.gbCalibrationScan.TabIndex = 18;
		this.gbCalibrationScan.TabStop = false;
		this.label24.AutoSize = true;
		this.label24.Location = new System.Drawing.Point(1, 40);
		this.label24.Name = "label24";
		this.label24.Size = new System.Drawing.Size(78, 13);
		this.label24.TabIndex = 27;
		this.label24.Text = "SigGen Control";
		this.cbTEControlType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbTEControlType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.cbTEControlType.FormattingEnabled = true;
		this.cbTEControlType.Items.AddRange(new object[4] { "Default", "Automated", "Manual", "Prompted" });
		this.cbTEControlType.Location = new System.Drawing.Point(81, 36);
		this.cbTEControlType.Name = "cbTEControlType";
		this.cbTEControlType.Size = new System.Drawing.Size(74, 21);
		this.cbTEControlType.TabIndex = 26;
		this.groupBox1.Controls.Add(this.tbCalOffset);
		this.groupBox1.Controls.Add(this.tbCalPower);
		this.groupBox1.Controls.Add(this.bnEditPathLoss);
		this.groupBox1.Controls.Add(this.bnSetSigGen);
		this.groupBox1.Controls.Add(this.label13);
		this.groupBox1.Controls.Add(this.lbCalPower);
		this.groupBox1.Location = new System.Drawing.Point(6, 55);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Size = new System.Drawing.Size(149, 143);
		this.groupBox1.TabIndex = 7;
		this.groupBox1.TabStop = false;
		this.tbCalOffset.Location = new System.Drawing.Point(82, 49);
		this.tbCalOffset.Name = "tbCalOffset";
		this.tbCalOffset.Size = new System.Drawing.Size(51, 20);
		this.tbCalOffset.TabIndex = 27;
		this.tbCalOffset.Text = "200";
		this.tbCalPower.Location = new System.Drawing.Point(82, 20);
		this.tbCalPower.Name = "tbCalPower";
		this.tbCalPower.Size = new System.Drawing.Size(51, 20);
		this.tbCalPower.TabIndex = 26;
		this.tbCalPower.Text = "-85";
		this.bnEditPathLoss.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
		this.bnEditPathLoss.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnEditPathLoss.Location = new System.Drawing.Point(28, 114);
		this.bnEditPathLoss.Name = "bnEditPathLoss";
		this.bnEditPathLoss.Size = new System.Drawing.Size(93, 23);
		this.bnEditPathLoss.TabIndex = 12;
		this.bnEditPathLoss.Text = "Set Path Loss";
		this.bnEditPathLoss.UseVisualStyleBackColor = true;
		this.bnEditPathLoss.Click += new System.EventHandler(bnEditPathLoss_Click);
		this.bnSetSigGen.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
		this.bnSetSigGen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		this.bnSetSigGen.Location = new System.Drawing.Point(28, 79);
		this.bnSetSigGen.Name = "bnSetSigGen";
		this.bnSetSigGen.Size = new System.Drawing.Size(93, 23);
		this.bnSetSigGen.TabIndex = 11;
		this.bnSetSigGen.Text = "Equip Config";
		this.bnSetSigGen.UseVisualStyleBackColor = true;
		this.bnSetSigGen.Click += new System.EventHandler(bnSetSigGen_Click);
		this.label13.AutoSize = true;
		this.label13.Location = new System.Drawing.Point(9, 52);
		this.label13.Name = "label13";
		this.label13.Size = new System.Drawing.Size(63, 13);
		this.label13.TabIndex = 10;
		this.label13.Text = "Offset (kHz)";
		this.lbCalPower.AutoSize = true;
		this.lbCalPower.Location = new System.Drawing.Point(7, 16);
		this.lbCalPower.Name = "lbCalPower";
		this.lbCalPower.Size = new System.Drawing.Size(69, 26);
		this.lbCalPower.TabIndex = 8;
		this.lbCalPower.Text = "Power Level \r\n      (dBm)";
		this.chkboxCalScan.AutoSize = true;
		this.chkboxCalScan.Location = new System.Drawing.Point(6, 16);
		this.chkboxCalScan.Name = "chkboxCalScan";
		this.chkboxCalScan.Size = new System.Drawing.Size(71, 17);
		this.chkboxCalScan.TabIndex = 0;
		this.chkboxCalScan.Text = "Cal Mode";
		this.chkboxCalScan.UseVisualStyleBackColor = true;
		this.label20.AutoSize = true;
		this.label20.Location = new System.Drawing.Point(1, 41);
		this.label20.Name = "label20";
		this.label20.Size = new System.Drawing.Size(70, 13);
		this.label20.TabIndex = 19;
		this.label20.Text = "Start Delay(s)";
		this.label21.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		this.label21.AutoSize = true;
		this.label21.Location = new System.Drawing.Point(49, 874);
		this.label21.Name = "label21";
		this.label21.Size = new System.Drawing.Size(64, 13);
		this.label21.TabIndex = 21;
		this.label21.Text = "Test Status:";
		this.lbTestStatus.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		this.lbTestStatus.AutoSize = true;
		this.lbTestStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25f, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, 0);
		this.lbTestStatus.Location = new System.Drawing.Point(108, 874);
		this.lbTestStatus.Name = "lbTestStatus";
		this.lbTestStatus.Size = new System.Drawing.Size(84, 13);
		this.lbTestStatus.TabIndex = 22;
		this.lbTestStatus.Text = "Test not running";
		this.ncStartDelay.Location = new System.Drawing.Point(15, 18);
		this.ncStartDelay.Maximum = new decimal(new int[4] { 5000, 0, 0, 0 });
		this.ncStartDelay.Name = "ncStartDelay";
		this.ncStartDelay.Size = new System.Drawing.Size(39, 20);
		this.ncStartDelay.TabIndex = 23;
		this.gbMisc.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
		this.gbMisc.Controls.Add(this.ncStartDelay);
		this.gbMisc.Controls.Add(this.label20);
		this.gbMisc.Location = new System.Drawing.Point(953, 92);
		this.gbMisc.Name = "gbMisc";
		this.gbMisc.Size = new System.Drawing.Size(72, 57);
		this.gbMisc.TabIndex = 23;
		this.gbMisc.TabStop = false;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1037, 889);
		base.Controls.Add(this.gbMisc);
		base.Controls.Add(this.lbTestStatus);
		base.Controls.Add(this.label21);
		base.Controls.Add(this.gbCalibrationScan);
		base.Controls.Add(this.cbOnlineModeOnExit);
		base.Controls.Add(this.bnAbout);
		base.Controls.Add(this.lbRunInfo);
		base.Controls.Add(this.gbLimitTesting);
		base.Controls.Add(this.gbChartOptions);
		base.Controls.Add(this.gbDataLogOption);
		base.Controls.Add(this.groupBoxPhoneStatus);
		base.Controls.Add(this.groupBoxUUTConfig);
		base.Controls.Add(this.chart1);
		base.Controls.Add(this.bnRunStop);
		base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
		base.Name = "MainForm";
		this.Text = "QDART Noise Profiling Tool (Proprietary to Qualcomm Technologies)";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(MainForm_FormClosing);
		base.Load += new System.EventHandler(MainForm_Load);
		((System.ComponentModel.ISupportInitialize)this.chart1).EndInit();
		this.groupBoxUUTConfig.ResumeLayout(false);
		this.groupBoxUUTConfig.PerformLayout();
		this.gbWLANCtrls.ResumeLayout(false);
		this.gbWLANCtrls.PerformLayout();
		this.gbWWAN_ChainCtrl.ResumeLayout(false);
		this.gbWWAN_ChainCtrl.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.numeric_BmId).EndInit();
		this.gbReceiver.ResumeLayout(false);
		this.gbReceiver.PerformLayout();
		this.GroupBoxTransmitter.ResumeLayout(false);
		this.GroupBoxTransmitter.PerformLayout();
		this.groupBoxRB.ResumeLayout(false);
		this.groupBoxRB.PerformLayout();
		this.groupBox2.ResumeLayout(false);
		this.groupBox2.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.ncSingleChannel).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop5).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart5).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop4).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart4).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop3).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart3).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop2).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart2).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStop1).EndInit();
		((System.ComponentModel.ISupportInitialize)this.ncStart1).EndInit();
		this.groupBoxPhoneStatus.ResumeLayout(false);
		this.groupBoxPhoneStatus.PerformLayout();
		this.gbDataLogOption.ResumeLayout(false);
		this.gbDataLogOption.PerformLayout();
		this.gbChartOptions.ResumeLayout(false);
		this.gbChartOptions.PerformLayout();
		this.gbLimitTesting.ResumeLayout(false);
		this.gbLimitTesting.PerformLayout();
		this.gbCalibrationScan.ResumeLayout(false);
		this.gbCalibrationScan.PerformLayout();
		this.groupBox1.ResumeLayout(false);
		this.groupBox1.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.ncStartDelay).EndInit();
		this.gbMisc.ResumeLayout(false);
		this.gbMisc.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
