using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Controls;
using DebugToolInstrumentInterface;
using QC.QMSLPhone;
using QRCT_modem_RF_Debug_tool;

namespace QFDT_Components;

public static class WlanConst
{
	public delegate void SendDebugMessage(MessageLevel level, string message);

	public const string strWcnNull = "WCN_Null";

	public const string strWcn36xx = "WCN36xx";

	public const string strWcn1312 = "WCN1312";

	public const string strWcn1314 = "WCN1314";

	public const string strWcn3620 = "WCN3610/15/20";

	public const string strWcn3660 = "WCN3660/A/B";

	public const string strWcn3680 = "WCN3680/B";

	public const string strClosedLoop = "ClosedLoop";

	public const string strUncheckedClosedLoop = "OpenLoop";

	public const string strOpenLoop = "OPEN LOOP";

	public const string strSCPC = "SCPC";

	public const string strCLPC = "CLPC";

	public const string strPwrCtrlAuto = "AUTO";

	public const string strPwrCtrlAutoSAR = "AUTO-SAR";

	public const string str_Chan_NotSet = "NOT SET";

	public const string str_CHAN_1_2412 = "RF_CHAN_1(2412)";

	public const string str_CHAN_2_2417 = "RF_CHAN_2(2417)";

	public const string str_CHAN_3_2422 = "RF_CHAN_3(2422)";

	public const string str_CHAN_4_2427 = "RF_CHAN_4(2427)";

	public const string str_CHAN_5_2432 = "RF_CHAN_5(2432)";

	public const string str_CHAN_6_2437 = "RF_CHAN_6(2437)";

	public const string str_CHAN_7_2442 = "RF_CHAN_7(2442)";

	public const string str_CHAN_8_2447 = "RF_CHAN_8(2447)";

	public const string str_CHAN_9_2452 = "RF_CHAN_9(2452)";

	public const string str_CHAN_10_2457 = "RF_CHAN_10(2457)";

	public const string str_CHAN_11_2462 = "RF_CHAN_11(2462)";

	public const string str_CHAN_12_2467 = "RF_CHAN_12(2467)";

	public const string str_CHAN_13_2472 = "RF_CHAN_13(2472)";

	public const string str_CHAN_14_2484 = "RF_CHAN_14(2484)";

	public const string str_CHAN_36_5180 = "RF_CHAN_36(5180)";

	public const string str_CHAN_38_5190 = "RF_CHAN_38(5190)";

	public const string str_CHAN_40_5200 = "RF_CHAN_40(5200)";

	public const string str_CHAN_42_5210 = "RF_CHAN_42(5210)";

	public const string str_CHAN_44_5220 = "RF_CHAN_44(5220)";

	public const string str_CHAN_46_5230 = "RF_CHAN_46(5230)";

	public const string str_CHAN_48_5240 = "RF_CHAN_48(5240)";

	public const string str_CHAN_50_5250 = "RF_CHAN_50(5250)";

	public const string str_CHAN_52_5260 = "RF_CHAN_52(5260)";

	public const string str_CHAN_54_5270 = "RF_CHAN_54(5270)";

	public const string str_CHAN_56_5280 = "RF_CHAN_56(5280)";

	public const string str_CHAN_58_5290 = "RF_CHAN_58(5290)";

	public const string str_CHAN_60_5300 = "RF_CHAN_60(5300)";

	public const string str_CHAN_62_5310 = "RF_CHAN_62(5310)";

	public const string str_CHAN_64_5320 = "RF_CHAN_64(5320)";

	public const string str_CHAN_100_5500 = "RF_CHAN_100(5500)";

	public const string str_CHAN_102_5510 = "RF_CHAN_102(5510)";

	public const string str_CHAN_104_5520 = "RF_CHAN_104(5520)";

	public const string str_CHAN_106_5530 = "RF_CHAN_106(5530)";

	public const string str_CHAN_108_5540 = "RF_CHAN_108(5540)";

	public const string str_CHAN_110_5550 = "RF_CHAN_110(5550)";

	public const string str_CHAN_112_5560 = "RF_CHAN_112(5560)";

	public const string str_CHAN_114_5570 = "RF_CHAN_114(5570)";

	public const string str_CHAN_116_5580 = "RF_CHAN_116(5580)";

	public const string str_CHAN_118_5590 = "RF_CHAN_118(5590)";

	public const string str_CHAN_120_5600 = "RF_CHAN_120(5600)";

	public const string str_CHAN_122_5610 = "RF_CHAN_122(5610)";

	public const string str_CHAN_124_5620 = "RF_CHAN_124(5620)";

	public const string str_CHAN_126_5630 = "RF_CHAN_126(5630)";

	public const string str_CHAN_128_5640 = "RF_CHAN_128(5640)";

	public const string str_CHAN_130_5650 = "RF_CHAN_130(5650)";

	public const string str_CHAN_132_5660 = "RF_CHAN_132(5660)";

	public const string str_CHAN_134_5670 = "RF_CHAN_134(5670)";

	public const string str_CHAN_136_5680 = "RF_CHAN_136(5680)";

	public const string str_CHAN_138_5690 = "RF_CHAN_138(5690)";

	public const string str_CHAN_140_5700 = "RF_CHAN_140(5700)";

	public const string str_CHAN_142_5710 = "RF_CHAN_142(5710)";

	public const string str_CHAN_144_5720 = "RF_CHAN_144(5720)";

	public const string str_CHAN_149_5745 = "RF_CHAN_149(5745)";

	public const string str_CHAN_151_5755 = "RF_CHAN_151(5755)";

	public const string str_CHAN_153_5765 = "RF_CHAN_153(5765)";

	public const string str_CHAN_155_5775 = "RF_CHAN_155(5775)";

	public const string str_CHAN_157_5785 = "RF_CHAN_157(5785)";

	public const string str_CHAN_159_5795 = "RF_CHAN_159(5795)";

	public const string str_CHAN_161_5805 = "RF_CHAN_161(5805)";

	public const string str_CHAN_163_5815 = "RF_CHAN_163(5815)";

	public const string str_CHAN_165_5825 = "RF_CHAN_165(5825)";

	public const string rate11bLong1mbps = "11b LONG 1 Mbps";

	public const string rate11bLong2mbps = "11b LONG 2 Mbps";

	public const string rate11bLong5_5mbps = "11b LONG 5.5 Mbps";

	public const string rate11bLong11mbps = "11b LONG 11 Mbps";

	public const string rate11bShort2mbps = "11b SHORT 2 Mbps";

	public const string rate11bShort5_5mbps = "11b SHORT 5.5 Mbps";

	public const string rate11bShort11mbps = "11b SHORT 11 Mbps";

	public const string rate11g6mbps = "11g 6 Mbps";

	public const string rate11g9mbps = "11g 9 Mbps";

	public const string rate11g12mbps = "11g 12 Mbps";

	public const string rate11g18mbps = "11g 18 Mbps";

	public const string rate11g24mbps = "11g 24 Mbps";

	public const string rate11g36mbps = "11g 36 Mbps";

	public const string rate11g48mbps = "11g 48 Mbps";

	public const string rate11g54mbps = "11g 54 Mbps";

	public const string rate11ag6mbps = "11a/g 6 Mbps";

	public const string rate11ag9mbps = "11a/g 9 Mbps";

	public const string rate11ag12mbps = "11a/g 12 Mbps";

	public const string rate11ag18mbps = "11a/g 18 Mbps";

	public const string rate11ag24mbps = "11a/g 24 Mbps";

	public const string rate11ag36mbps = "11a/g 36 Mbps";

	public const string rate11ag48mbps = "11a/g 48 Mbps";

	public const string rate11ag54mbps = "11a/g 54 Mbps";

	public const string rate11n6_5mbps = "MCS0 6.5 Mbps";

	public const string rate11n13mbps = "MCS1 13 Mbps";

	public const string rate11n19_5mbps = "MCS2 19.5 Mbps";

	public const string rate11n26mbps = "MCS3 26 Mbps";

	public const string rate11n39mbps = "MCS4 39 Mbps";

	public const string rate11n52mbps = "MCS5 52 Mbps";

	public const string rate11n58_5mbps = "MCS6 58.5 Mbps";

	public const string rate11n65mbps = "MCS7 65 Mbps";

	public const string rate11nMM7_2mbps = "MCS0 MM SG 7.2 Mbps";

	public const string rate11nMM14_4mbps = "MCS1 MM SG 14.4 Mbps";

	public const string rate11nMM21_7mbps = "MCS2 MM SG 21.7 Mbps";

	public const string rate11nMM28_9mbps = "MCS3 MM SG 28.9 Mbps";

	public const string rate11nMM43_3mbps = "MCS4 MM SG 43.3 Mbps";

	public const string rate11nMM57_8mbps = "MCS5 MM SG 57.8 Mbps";

	public const string rate11nMM65mbps = "MCS6 MM SG 65 Mbps";

	public const string rate11nMM72_2mbps = "MCS7 MM SG 72.2 Mbps";

	public const string rate11n13_5mbps_40 = "MCS0 13.5 Mbps (40MHz)";

	public const string rate11n27mbps_40 = "MCS1 27 Mbps (40MHz)";

	public const string rate11n40_5_5mbps_40 = "MCS2 40.5 Mbps (40MHz)";

	public const string rate11n54mbps_40 = "MCS3 54 Mbps (40MHz)";

	public const string rate11n81mbps_40 = "MCS4 81 Mbps (40MHz)";

	public const string rate11n108mbps_40 = "MCS5 108 Mbps (40MHz)";

	public const string rate11n121_5_5mbps_40 = "MCS6 121.5 Mbps (40MHz)";

	public const string rate11n135mbps_40 = "MCS7 135 Mbps (40MHz)";

	public const string rate11nMM15mbps_40 = "MCS0 MM SG 15 Mbps (40MHz)";

	public const string rate11nMM30mbps_40 = "MCS1 MM SG 30 Mbps (40MHz)";

	public const string rate11nMM45mbps_40 = "MCS2 MM SG 45 Mbps (40MHz)";

	public const string rate11nMM60mbps_40 = "MCS3 MM SG 60 Mbps (40MHz)";

	public const string rate11nMM90mbps_40 = "MCS4 MM SG 90 Mbps (40MHz)";

	public const string rate11nMM120mbps_40 = "MCS5 MM SG 120 Mbps (40MHz)";

	public const string rate11nMM135mbps_40 = "MCS6 MM SG 135 Mbps (40MHz)";

	public const string rate11nMM150mbps_40 = "MCS7 MM SG 150 Mbps (40MHz)";

	public const string rate11acMcs0Ngi6_5mbps_20 = "11ac MCS0 NGI 6.5 Mbps (20MHz)";

	public const string rate11acMcs1Ngi13mbps_20 = "11ac MCS1 NGI 13 Mbps (20MHz)";

	public const string rate11acMcs2Ngi19_5mbps_20 = "11ac MCS2 NGI 19.5 Mbps (20MHz)";

	public const string rate11acMcs3Ngi26mbps_20 = "11ac MCS3 NGI 26 Mbps (20MHz)";

	public const string rate11acMcs4Ngi39mbps_20 = "11ac MCS4 NGI 39 Mbps (20MHz)";

	public const string rate11acMcs5Ngi52mbps_20 = "11ac MCS5 NGI 52 Mbps (20MHz)";

	public const string rate11acMcs6Ngi58_5mbps_20 = "11ac MCS6 NGI 58.5 Mbps (20MHz)";

	public const string rate11acMcs7Ngi65mbps_20 = "11ac MCS7 NGI 65 Mbps (20MHz)";

	public const string rate11acMcs8Ngi78mbps_20 = "11ac MCS8 NGI 78 Mbps (20MHz)";

	public const string rate11acMcs9Ngi86_5mbps_20 = "11ac MCS9 NGI 86.5 Mbps (20MHz)";

	public const string rate11acMcs0Sgi7_2mbps_20 = "11ac MCS 0SGI 7.2 Mbps (20MHz)";

	public const string rate11acMcs1Sgi14_4mbps_20 = "11ac MCS1 SGI 14.4 Mbps (20MHz)";

	public const string rate11acMcs2Sgi21_6mbps_20 = "11ac MCS2 SGI 21.6 Mbps (20MHz)";

	public const string rate11acMcs3Sgi28_8mbps_20 = "11ac MCS3 SGI 28.8 Mbps (20MHz)";

	public const string rate11acMcs4Sgi43_3mbps_20 = "11ac MCS4 SGI 43.3 Mbps (20MHz)";

	public const string rate11acMcs5Sgi57_7mbps_20 = "11ac MCS5 SGI 57.7 Mbps (20MHz)";

	public const string rate11acMcs6Sgi65mbps_20 = "11ac MCS6 SGI 65 Mbps (20MHz)";

	public const string rate11acMcs7Sgi72_2mbps_20 = "11ac MCS7 SGI 72.2 Mbps (20MHz)";

	public const string rate11acMcs8Sgi86_6mbps_20 = "11ac MCS8 SGI 86.6 Mbps (20MHz)";

	public const string rate11acMcs9Sgi96_1mbps_20 = "11ac MCS9 SGI 96.1 Mbps (20MHz)";

	public const string rate11acMcsNgi13_5mbps_40 = "11ac MCS0 NGI 13.5 Mbps (40MHz)";

	public const string rate11acMcsNgi27mbps_40 = "11ac MCS1 NGI 27 Mbps (40MHz)";

	public const string rate11acMcsNgi40_5mbps_40 = "11ac MCS2 NGI 40 Mbps (40MHz)";

	public const string rate11acMcsNgi54mbps_40 = "11ac MCS3 NGI 54 Mbps (40MHz)";

	public const string rate11acMcsNgi81mbps_40 = "11ac MCS4 NGI 81 Mbps (40MHz)";

	public const string rate11acMcsNgi108mbps_40 = "11ac MCS5 NGI 108 Mbps (40MHz)";

	public const string rate11acMcsNgi121_5mbps_40 = "11ac MCS6 NGI 121.5 Mbps (40MHz)";

	public const string rate11acMcsNgi135mbps_40 = "11ac MCS7 NGI 135 Mbps (40MHz)";

	public const string rate11acMcsNgi162mbps_40 = "11ac MCS8 NGI 162 Mbps (40MHz)";

	public const string rate11acMcsNgi180mbps_40 = "11ac MCS9 NGI 180 Mbps (40MHz)";

	public const string rate11acMcsSgi15mbps_40 = "11ac MCS0 SGI 15 Mbps (40MHz)";

	public const string rate11acMcsSgi30mbps_40 = "11ac MCS1 SGI 30 Mbps (40MHz)";

	public const string rate11acMcsSgi45mbps_40 = "11ac MCS2 SGI 45 Mbps (40MHz)";

	public const string rate11acMcsSgi60mbps_40 = "11ac MCS3 SGI 60 Mbps (40MHz)";

	public const string rate11acMcsSgi90mbps_40 = "11ac MCS4 SGI 90 Mbps (40MHz)";

	public const string rate11acMcsSgi120mbps_40 = "11ac MCS5 SGI 120 Mbps (40MHz)";

	public const string rate11acMcsSgi135mbps_40 = "11ac MCS6 SGI 135 Mbps (40MHz)";

	public const string rate11acMcsSgi150mbps_40 = "11ac MCS7 SGI 150 Mbps (40MHz)";

	public const string rate11acMcsSgi180mbps_40 = "11ac MCS8 SGI 180 Mbps (40MHz)";

	public const string rate11acMcsSgi200mbps_40 = "11ac MCS9 SGI 200 Mbps (40MHz)";

	public const string rate11acMcsNgi29_35mbps_80 = "11ac MCS0 NGI 29.3 Mbps (80MHz)";

	public const string rate11acMcsNgi58_5mbps_80 = "11ac MCS1 NGI 58.5 Mbps (80MHz)";

	public const string rate11acMcsNgi87_8_5mbps_80 = "11ac MCS2 NGI 87.8 Mbps (80MHz)";

	public const string rate11acMcsNgi117mbps_80 = "11ac MCS3 NGI 117 Mbps (80MHz)";

	public const string rate11acMcsNgi175_5mbps_80 = "11ac MCS4 NGI 175.5 Mbps (80MHz)";

	public const string rate11acMcsNgi234mbps_80 = "11ac MCS5 NGI 234 Mbps (80MHz)";

	public const string rate11acMcsNgi263_3mbps_80 = "11ac MCS6 NGI 263.3 Mbps (80MHz)";

	public const string rate11acMcsNgi292_5mbps_80 = "11ac MCS7 NGI 292.5 Mbps (80MHz)";

	public const string rate11acMcsNgi351mbps_80 = "11ac MCS8 NGI 351 Mbps (80MHz)";

	public const string rate11acMcsNgi390mbps_80 = "11ac MCS9 NGI 390 Mbps (80MHz)";

	public const string rate11acMcsSgi32_5mbps_80 = "11ac MCS0 SGI 32.5 Mbps (80MHz)";

	public const string rate11acMcsSgi65mbps_80 = "11ac MCS1 SGI 65 Mbps (80MHz)";

	public const string rate11acMcsSgi97_5mbps_80 = "11ac MCS2 SGI 97.5 Mbps (80MHz)";

	public const string rate11acMcsSgi130mbps_80 = "11ac MCS3 SGI 130 Mbps (80MHz)";

	public const string rate11acMcsSgi195mbps_80 = "11ac MCS4 SGI 195 Mbps (80MHz)";

	public const string rate11acMcsSgi260mbps_80 = "11ac MCS5 SGI 260 Mbps (80MHz)";

	public const string rate11acMcsSgi292_5mbps_80 = "11ac MCS6 SGI 292.5 Mbps (80MHz)";

	public const string rate11acMcsSgi325mbps_80 = "11ac MCS7 SGI 325 Mbps (80MHz)";

	public const string rate11acMcsSgi390mbps_80 = "11ac MCS8 SGI 390 Mbps (80MHz)";

	public const string rate11acMcsSgi433_3mbps_80 = "11ac MCS9 SGI 433.3 Mbps (80MHz)";

	public static void SetSelectedItem<T>(ComboBox curBox, T selValue)
	{
		if (selValue != null && curBox.Items.Contains(selValue))
		{
			curBox.SelectedItem = selValue;
		}
		else
		{
			curBox.SelectedItem = null;
		}
	}

	public static bool CheckExist<T>(List<T> scenarioList, T obj) where T : IUserDefinedCompareEqual
	{
		bool result = false;
		foreach (T scenario in scenarioList)
		{
			if (scenario.IsEqual(obj))
			{
				result = true;
			}
		}
		return result;
	}

	public static void ConfigSigGen(ISignalGenerator pSG, double freq, double power, SendDebugMessage FuncCB)
	{
		if (pSG != null)
		{
			pSG.SetupGen();
			Thread.Sleep(800);
			pSG.SetModulationType();
			pSG.SetPowerLevel(power);
			FuncCB(MessageLevel.SUCCESS, "SigGen Power Level(dBm):  " + power);
			pSG.EnableOutput(onOff: true);
			Thread.Sleep(800);
			if (pSG.SetCenterFrequency(freq, 0.0))
			{
				FuncCB(MessageLevel.SUCCESS, "SigGen  Center " + freq + "MHz Success");
			}
			else
			{
				FuncCB(MessageLevel.FAIL, "SigGen  Center " + freq + "MHz FAIL");
			}
			return;
		}
		throw new Exception("Invalid Signal Generator Handle");
	}

	public static void startWlanApp_Diag(Phone phone, SendDebugMessage FuncCB)
	{
		ushort iFTM_Error_Code = 0;
		phone.FTM_AP_Utility(ref iFTM_Error_Code, 1, 1);
		FuncCB(MessageLevel.SUCCESS, $"QLIB_FTM_AP_UTILITY success, retErrCode = {iFTM_Error_Code}");
	}
}
