using System.Collections;
using System.Collections.Generic;
using System.Windows.Controls;
using QRCT_modem_RF_Debug_tool;

namespace QFDT_Components;

public class WCN39XXStatic
{
	public delegate void AddItemToComboBoxAction();

	public static string chipSeriesName;

	public static List<obJectForComboBox> txModeList;

	public static List<obJectForComboBox> htModeList;

	public static List<obJectForComboBox> scrambler;

	public static List<obJectForComboBox> txPwrCtrlList;

	public static List<obJectForComboBox> channelNumbers11p;

	public static List<obJectForComboBox> channelNumbers;

	public static List<obJectForComboBox> TxRateOFDMLegacy;

	public static List<obJectForComboBox> TxRateNoHT_5m10m;

	public static List<obJectForComboBox> TxRateCCK;

	public static List<obJectForComboBox> TxRateCCK_5m10m;

	public static List<obJectForComboBox> TxRateDSRC5;

	public static List<obJectForComboBox> TxChainList;

	public static List<obJectForComboBox> TxPatternList;

	public static List<obJectForComboBox> broadcastList;

	public static void RefreshComboBox(AddItemToComboBoxAction act1, ComboBox cbx)
	{
		obJectForComboBox obJectForComboBox2 = null;
		if (cbx.SelectedItem != null)
		{
			obJectForComboBox2 = (obJectForComboBox)cbx.SelectedItem;
		}
		act1();
		cbx.SelectedIndex = 0;
		if (obJectForComboBox2 == null)
		{
			return;
		}
		foreach (obJectForComboBox item in (IEnumerable)cbx.Items)
		{
			if (item.CheckEqual(obJectForComboBox2))
			{
				cbx.SelectedItem = item;
				break;
			}
		}
	}

	public static void AddItemToComboBox(ComboBox cbx, List<obJectForComboBox> objList)
	{
		foreach (obJectForComboBox obj in objList)
		{
			cbx.Items.Add(obj);
		}
	}

	public static datapair parseTxScenarioParamsFromUI(ComboBox cbx)
	{
		datapair datapair = null;
		if (cbx.SelectedItem != null)
		{
			datapair = new datapair();
			datapair.show = (cbx.SelectedItem as obJectForComboBox).showContent;
			datapair.value = (cbx.SelectedItem as obJectForComboBox).realValue;
		}
		return datapair;
	}

	public static obJectForComboBox getCbxTypeFromScenarioType(datapair dp)
	{
		obJectForComboBox result = null;
		if (dp != null)
		{
			result = new obJectForComboBox(dp.show, dp.value);
		}
		return result;
	}

	public static string getRealValueAcFromShowContent(List<obJectForComboBox> objList, string showContent)
	{
		string result = null;
		if (objList != null && objList.Count > 0)
		{
			foreach (obJectForComboBox obj in objList)
			{
				if (obj.showContent == showContent)
				{
					result = obj.realValue;
					break;
				}
			}
		}
		return result;
	}

	public static void SetSelectedItem(ComboBox curBox, obJectForComboBox selValue)
	{
		if (selValue != null)
		{
			foreach (obJectForComboBox item in (IEnumerable)curBox.Items)
			{
				if (item.CheckEqual(selValue))
				{
					curBox.SelectedItem = item;
					return;
				}
			}
		}
		curBox.SelectedItem = null;
	}

	public static void updateWCN39xxInfo(ref WCN39xxInfo wcn39xx, List<WCN39xx_TxScenario> scenariolist)
	{
		wcn39xx = new WCN39xxInfo();
		if (scenariolist.Count > 0)
		{
			wcn39xx.ScenarioArray = new WCN39xx_TxScenario[scenariolist.Count];
			for (int i = 0; i < scenariolist.Count; i++)
			{
				wcn39xx.ScenarioArray[i] = scenariolist[i].DeepCopy();
			}
		}
	}

	static WCN39XXStatic()
	{
		chipSeriesName = "WCN39XX";
		txModeList = new List<obJectForComboBox>();
		txModeList.Add(new obJectForComboBox("Cont. Tx TX99", "3"));
		txModeList.Add(new obJectForComboBox("Disable Tx", "0"));
		htModeList = new List<obJectForComboBox>();
		htModeList.Add(new obJectForComboBox("No HT", "0"));
		htModeList.Add(new obJectForComboBox("CCK", "4"));
		htModeList.Add(new obJectForComboBox("DSRC5", "12"));
		TxChainList = new List<obJectForComboBox>();
		TxChainList.Add(new obJectForComboBox("Chain0", "1"));
		TxChainList.Add(new obJectForComboBox("Chain1", "2"));
		txPwrCtrlList = new List<obJectForComboBox>();
		txPwrCtrlList.Add(new obJectForComboBox("TxPowerForce_CLPC", "0"));
		txPwrCtrlList.Add(new obJectForComboBox("ForcedDesiredGain", "4"));
		channelNumbers11p = new List<obJectForComboBox>();
		channelNumbers11p.Add(new obJectForComboBox("170(5850)", "5850"));
		channelNumbers11p.Add(new obJectForComboBox("170(5852)", "5852"));
		channelNumbers11p.Add(new obJectForComboBox("172(5857)", "5857"));
		channelNumbers11p.Add(new obJectForComboBox("172(5860)", "5860"));
		channelNumbers11p.Add(new obJectForComboBox("172(5862)", "5862"));
		channelNumbers11p.Add(new obJectForComboBox("174(5867)", "5867"));
		channelNumbers11p.Add(new obJectForComboBox("174(5870)", "5870"));
		channelNumbers11p.Add(new obJectForComboBox("174(5872)", "5872"));
		channelNumbers11p.Add(new obJectForComboBox("176(5875)", "5875"));
		channelNumbers11p.Add(new obJectForComboBox("176(5877)", "5877"));
		channelNumbers11p.Add(new obJectForComboBox("176(5880)", "5880"));
		channelNumbers11p.Add(new obJectForComboBox("176(5882)", "5882"));
		channelNumbers11p.Add(new obJectForComboBox("178(5887)", "5887"));
		channelNumbers11p.Add(new obJectForComboBox("178(5890)", "5890"));
		channelNumbers11p.Add(new obJectForComboBox("178(5892)", "5892"));
		channelNumbers11p.Add(new obJectForComboBox("180(5897)", "5897"));
		channelNumbers11p.Add(new obJectForComboBox("180(5900)", "5900"));
		channelNumbers11p.Add(new obJectForComboBox("180(5902)", "5902"));
		channelNumbers11p.Add(new obJectForComboBox("182(5905)", "5905"));
		channelNumbers11p.Add(new obJectForComboBox("182(5907)", "5907"));
		channelNumbers11p.Add(new obJectForComboBox("182(5910)", "5910"));
		channelNumbers11p.Add(new obJectForComboBox("182(5912)", "5912"));
		channelNumbers11p.Add(new obJectForComboBox("184(5917)", "5917"));
		channelNumbers11p.Add(new obJectForComboBox("184(5920)", "5920"));
		channelNumbers11p.Add(new obJectForComboBox("184(5922)", "5922"));
		channelNumbers = new List<obJectForComboBox>();
		channelNumbers.Add(new obJectForComboBox("1(2412)", "2412"));
		channelNumbers.Add(new obJectForComboBox("2(2417)", "2417"));
		channelNumbers.Add(new obJectForComboBox("3(2422)", "2422"));
		channelNumbers.Add(new obJectForComboBox("4(2427)", "2427"));
		channelNumbers.Add(new obJectForComboBox("5(2432)", "2432"));
		channelNumbers.Add(new obJectForComboBox("6(2437)", "2437"));
		channelNumbers.Add(new obJectForComboBox("7(2442)", "2442"));
		channelNumbers.Add(new obJectForComboBox("8(2447)", "2447"));
		channelNumbers.Add(new obJectForComboBox("9(2452)", "2452"));
		channelNumbers.Add(new obJectForComboBox("10(2457)", "2457"));
		channelNumbers.Add(new obJectForComboBox("11(2462)", "2462"));
		channelNumbers.Add(new obJectForComboBox("12(2467)", "2467"));
		channelNumbers.Add(new obJectForComboBox("13(2472)", "2472"));
		channelNumbers.Add(new obJectForComboBox("14(2484)", "2484"));
		channelNumbers.Add(new obJectForComboBox("34(5170)", "5170"));
		channelNumbers.Add(new obJectForComboBox("36(5180)", "5180"));
		channelNumbers.Add(new obJectForComboBox("38(5190)", "5190"));
		channelNumbers.Add(new obJectForComboBox("40(5200)", "5200"));
		channelNumbers.Add(new obJectForComboBox("42(5210)", "5210"));
		channelNumbers.Add(new obJectForComboBox("44(5220)", "5220"));
		channelNumbers.Add(new obJectForComboBox("46(5230)", "5230"));
		channelNumbers.Add(new obJectForComboBox("48(5240)", "5240"));
		channelNumbers.Add(new obJectForComboBox("50(5250)", "5250"));
		channelNumbers.Add(new obJectForComboBox("52(5260)", "5260"));
		channelNumbers.Add(new obJectForComboBox("54(5270)", "5270"));
		channelNumbers.Add(new obJectForComboBox("56(5280)", "5280"));
		channelNumbers.Add(new obJectForComboBox("58(5290)", "5290"));
		channelNumbers.Add(new obJectForComboBox("60(5300)", "5300"));
		channelNumbers.Add(new obJectForComboBox("62(5310)", "5310"));
		channelNumbers.Add(new obJectForComboBox("64(5320)", "5320"));
		channelNumbers.Add(new obJectForComboBox("100(5500)", "5500"));
		channelNumbers.Add(new obJectForComboBox("102(5510)", "5510"));
		channelNumbers.Add(new obJectForComboBox("104(5520)", "5520"));
		channelNumbers.Add(new obJectForComboBox("106(5530)", "5530"));
		channelNumbers.Add(new obJectForComboBox("108(5540)", "5540"));
		channelNumbers.Add(new obJectForComboBox("110(5550)", "5550"));
		channelNumbers.Add(new obJectForComboBox("112(5560)", "5560"));
		channelNumbers.Add(new obJectForComboBox("114(5570)", "5570"));
		channelNumbers.Add(new obJectForComboBox("116(5580)", "5580"));
		channelNumbers.Add(new obJectForComboBox("118(5590)", "5590"));
		channelNumbers.Add(new obJectForComboBox("120(5600)", "5600"));
		channelNumbers.Add(new obJectForComboBox("122(5610)", "5610"));
		channelNumbers.Add(new obJectForComboBox("124(5620)", "5620"));
		channelNumbers.Add(new obJectForComboBox("126(5630)", "5630"));
		channelNumbers.Add(new obJectForComboBox("128(5640)", "5640"));
		channelNumbers.Add(new obJectForComboBox("130(5650)", "5650"));
		channelNumbers.Add(new obJectForComboBox("132(5660)", "5660"));
		channelNumbers.Add(new obJectForComboBox("134(5670)", "5670"));
		channelNumbers.Add(new obJectForComboBox("136(5680)", "5680"));
		channelNumbers.Add(new obJectForComboBox("138(5690)", "5690"));
		channelNumbers.Add(new obJectForComboBox("140(5700)", "5700"));
		channelNumbers.Add(new obJectForComboBox("142(5710)", "5710"));
		channelNumbers.Add(new obJectForComboBox("144(5720)", "5720"));
		channelNumbers.Add(new obJectForComboBox("146(5730)", "5730"));
		channelNumbers.Add(new obJectForComboBox("149(5745)", "5745"));
		channelNumbers.Add(new obJectForComboBox("151(5755)", "5755"));
		channelNumbers.Add(new obJectForComboBox("153(5765)", "5765"));
		channelNumbers.Add(new obJectForComboBox("155(5775)", "5775"));
		channelNumbers.Add(new obJectForComboBox("157(5785)", "5785"));
		channelNumbers.Add(new obJectForComboBox("159(5795)", "5795"));
		channelNumbers.Add(new obJectForComboBox("161(5805)", "5805"));
		channelNumbers.Add(new obJectForComboBox("163(5815)", "5815"));
		channelNumbers.Add(new obJectForComboBox("165(5825)", "5825"));
		channelNumbers.Add(new obJectForComboBox("169(5845)", "5845"));
		channelNumbers.Add(new obJectForComboBox("173(5865)", "5865"));
		channelNumbers.Add(new obJectForComboBox("177(5885)", "5885"));
		channelNumbers.Add(new obJectForComboBox("180(5905)", "5905"));
		TxRateOFDMLegacy = new List<obJectForComboBox>();
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_6Mbps", "8"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_9Mbps", "9"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_12Mbps", "10"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_18Mbps", "11"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_24Mbps", "12"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_36Mbps", "13"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_48Mbps", "14"));
		TxRateOFDMLegacy.Add(new obJectForComboBox("RATE_54Mbps", "15"));
		TxRateNoHT_5m10m = new List<obJectForComboBox>();
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_6Mbps_5", "1008"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_9Mbps_5", "1009"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_12Mbps_5", "1010"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_18Mbps_5", "1011"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_24Mbps_5", "1012"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_36Mbps_5", "1013"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_48Mbps_5", "1014"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_54Mbps_5", "1015"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_6Mbps_10", "1108"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_9Mbps_10", "1109"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_12Mbps_10", "1110"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_18Mbps_10", "1111"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_24Mbps_10", "1112"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_36Mbps_10", "1113"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_48Mbps_10", "1114"));
		TxRateNoHT_5m10m.Add(new obJectForComboBox("RATE_54Mbps_10", "1115"));
		TxRateCCK = new List<obJectForComboBox>();
		TxRateCCK.Add(new obJectForComboBox("RATE_1Mbps_L", "0"));
		TxRateCCK.Add(new obJectForComboBox("RATE_2Mbps_L", "1"));
		TxRateCCK.Add(new obJectForComboBox("RATE_2Mbps_S", "2"));
		TxRateCCK.Add(new obJectForComboBox("RATE_5_5Mbps_L", "3"));
		TxRateCCK.Add(new obJectForComboBox("RATE_5_5mbps_S", "4"));
		TxRateCCK.Add(new obJectForComboBox("RATE_11Mbps_L", "5"));
		TxRateCCK.Add(new obJectForComboBox("RATE_11Mbps_S", "6"));
		TxRateCCK_5m10m = new List<obJectForComboBox>();
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_1Mbps_L_5", "1000"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_2Mbps_L_5", "1001"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_2Mbps_S_5", "1002"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_5_5Mbps_L_5", "1003"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_5_5Mbps_S_5", "1004"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_11Mbps_L_5", "1005"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_11Mbps_S_5", "1006"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_1Mbps_L_10", "1100"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_2Mbps_L_10", "1101"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_2Mbps_S_10", "1102"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_5_5Mbps_L_10", "1103"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_5_5Mbps_S_10", "1104"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_11Mbps_L_10", "1105"));
		TxRateCCK_5m10m.Add(new obJectForComboBox("RATE_11Mbps_S_10", "1106"));
		TxRateDSRC5 = new List<obJectForComboBox>();
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_1p5Mbps_5", "1008"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_2p25Mbps_5", "1009"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_3Mbps_5", "1010"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_4p5Mbps_5", "1011"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_6Mbps_5", "1012"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_9Mbps_5", "1013"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_12Mbps_5", "1014"));
		TxRateDSRC5.Add(new obJectForComboBox("RATE_P_13p5Mbps_5", "1015"));
		TxPatternList = new List<obJectForComboBox>();
		TxPatternList.Add(new obJectForComboBox("ZEROS", "0"));
		TxPatternList.Add(new obJectForComboBox("ONES", "1"));
		TxPatternList.Add(new obJectForComboBox("REPEATING_10", "2"));
		TxPatternList.Add(new obJectForComboBox("PN7_PATTERN", "3"));
		TxPatternList.Add(new obJectForComboBox("PN9_PATTERN", "4"));
		TxPatternList.Add(new obJectForComboBox("PN15_PATTERN", "5"));
		scrambler = new List<obJectForComboBox>();
		scrambler.Add(new obJectForComboBox("On", "0"));
		scrambler.Add(new obJectForComboBox("Off", "1"));
		broadcastList = new List<obJectForComboBox>();
		broadcastList.Add(new obJectForComboBox("Unicast", "0"));
		broadcastList.Add(new obJectForComboBox("BroadCast", "1"));
	}
}
