using System.Text;

namespace QCRPG.TSL.FMHCI.Packets;

public static class DefaultDataModeInfo
{
	public static DefaultDataModeEnum ValueToDefaultDataMode(uint value)
	{
		return value switch
		{
			0u => DefaultDataModeEnum.CUSTOM, 
			1u => DefaultDataModeEnum.RDS_PS_0, 
			2u => DefaultDataModeEnum.RDS_PS_1, 
			3u => DefaultDataModeEnum.RDS_PS_2, 
			4u => DefaultDataModeEnum.RDS_PS_3, 
			5u => DefaultDataModeEnum.RDS_PS_4, 
			6u => DefaultDataModeEnum.RDS_PS_5, 
			7u => DefaultDataModeEnum.RDS_PS_6, 
			8u => DefaultDataModeEnum.RDS_RT_0, 
			9u => DefaultDataModeEnum.RDS_RT_1, 
			10u => DefaultDataModeEnum.RDS_RT_2, 
			11u => DefaultDataModeEnum.RDS_RT_3, 
			12u => DefaultDataModeEnum.RDS_RT_4, 
			13u => DefaultDataModeEnum.RDS_CONFIG, 
			14u => DefaultDataModeEnum.RX_CONFIG, 
			15u => DefaultDataModeEnum.RX_TIMERS, 
			16u => DefaultDataModeEnum.RDS_TX_GROUPS, 
			17u => DefaultDataModeEnum.RDS_COUNT_0, 
			18u => DefaultDataModeEnum.RDS_COUNT_1, 
			19u => DefaultDataModeEnum.RDS_COUNT_2, 
			20u => DefaultDataModeEnum.RADIO_CONFIG, 
			21u => DefaultDataModeEnum.RX_CONFIG, 
			22u => DefaultDataModeEnum.RX_TIMERS, 
			23u => DefaultDataModeEnum.RX_STATIONS_0, 
			24u => DefaultDataModeEnum.RX_STATIONS_1, 
			25u => DefaultDataModeEnum.INT_CTRL, 
			26u => DefaultDataModeEnum.ERROR, 
			27u => DefaultDataModeEnum.CHIPID, 
			32u => DefaultDataModeEnum.CAL_DAT_0, 
			33u => DefaultDataModeEnum.CAL_DAT_1, 
			34u => DefaultDataModeEnum.CAL_DAT_2, 
			35u => DefaultDataModeEnum.CAL_DAT_3, 
			36u => DefaultDataModeEnum.CAL_CFG_0, 
			37u => DefaultDataModeEnum.CAL_CFG_1, 
			38u => DefaultDataModeEnum.DIG_INTF_0, 
			39u => DefaultDataModeEnum.DIG_INTF_1, 
			40u => DefaultDataModeEnum.DIG_AGC_0, 
			41u => DefaultDataModeEnum.DIG_AGC_1, 
			42u => DefaultDataModeEnum.DIG_AGC_2, 
			43u => DefaultDataModeEnum.DIG_AUDIO_0, 
			44u => DefaultDataModeEnum.DIG_AUDIO_1, 
			46u => DefaultDataModeEnum.DIG_AUDIO_3, 
			48u => DefaultDataModeEnum.DIG_RXRDS_0, 
			49u => DefaultDataModeEnum.DIG_DCC, 
			50u => DefaultDataModeEnum.DIG_SPUR, 
			51u => DefaultDataModeEnum.DIG_PILOT, 
			52u => DefaultDataModeEnum.DIG_RX, 
			53u => DefaultDataModeEnum.DIG_INTF_2, 
			54u => DefaultDataModeEnum.DIG_INTF_3, 
			55u => DefaultDataModeEnum.DIG_TX_0, 
			56u => DefaultDataModeEnum.DIG_TX_1, 
			57u => DefaultDataModeEnum.DIG_RXRDS_1, 
			58u => DefaultDataModeEnum.RDS_CUSTOM, 
			59u => DefaultDataModeEnum.CLK_SPUR, 
			60u => DefaultDataModeEnum.PHY_CONFIG, 
			61u => DefaultDataModeEnum.PHY_TXBLOCK, 
			62u => DefaultDataModeEnum.PHY_TCB, 
			63u => DefaultDataModeEnum.EXT_MODE, 
			64u => DefaultDataModeEnum.LOG, 
			_ => DefaultDataModeEnum.InvalidDefaultDataModeValue, 
		};
	}

	public static uint DefaultDataModeToValue(DefaultDataModeEnum enumItem)
	{
		return enumItem switch
		{
			DefaultDataModeEnum.CUSTOM => 0u, 
			DefaultDataModeEnum.RDS_PS_0 => 1u, 
			DefaultDataModeEnum.RDS_PS_1 => 2u, 
			DefaultDataModeEnum.RDS_PS_2 => 3u, 
			DefaultDataModeEnum.RDS_PS_3 => 4u, 
			DefaultDataModeEnum.RDS_PS_4 => 5u, 
			DefaultDataModeEnum.RDS_PS_5 => 6u, 
			DefaultDataModeEnum.RDS_PS_6 => 7u, 
			DefaultDataModeEnum.RDS_RT_0 => 8u, 
			DefaultDataModeEnum.RDS_RT_1 => 9u, 
			DefaultDataModeEnum.RDS_RT_2 => 10u, 
			DefaultDataModeEnum.RDS_RT_3 => 11u, 
			DefaultDataModeEnum.RDS_RT_4 => 12u, 
			DefaultDataModeEnum.RDS_CONFIG => 13u, 
			DefaultDataModeEnum.RX_CONFIG => 14u, 
			DefaultDataModeEnum.RX_TIMERS => 15u, 
			DefaultDataModeEnum.RDS_TX_GROUPS => 16u, 
			DefaultDataModeEnum.RDS_COUNT_0 => 17u, 
			DefaultDataModeEnum.RDS_COUNT_1 => 18u, 
			DefaultDataModeEnum.RDS_COUNT_2 => 19u, 
			DefaultDataModeEnum.RADIO_CONFIG => 20u, 
			_ => enumItem switch
			{
				DefaultDataModeEnum.RX_CONFIG => 21u, 
				DefaultDataModeEnum.RX_TIMERS => 22u, 
				DefaultDataModeEnum.RX_STATIONS_0 => 23u, 
				DefaultDataModeEnum.RX_STATIONS_1 => 24u, 
				DefaultDataModeEnum.INT_CTRL => 25u, 
				DefaultDataModeEnum.ERROR => 26u, 
				DefaultDataModeEnum.CHIPID => 27u, 
				DefaultDataModeEnum.CAL_DAT_0 => 32u, 
				DefaultDataModeEnum.CAL_DAT_1 => 33u, 
				DefaultDataModeEnum.CAL_DAT_2 => 34u, 
				DefaultDataModeEnum.CAL_DAT_3 => 35u, 
				DefaultDataModeEnum.CAL_CFG_0 => 36u, 
				DefaultDataModeEnum.CAL_CFG_1 => 37u, 
				DefaultDataModeEnum.DIG_INTF_0 => 38u, 
				DefaultDataModeEnum.DIG_INTF_1 => 39u, 
				DefaultDataModeEnum.DIG_AGC_0 => 40u, 
				DefaultDataModeEnum.DIG_AGC_1 => 41u, 
				DefaultDataModeEnum.DIG_AGC_2 => 42u, 
				DefaultDataModeEnum.DIG_AUDIO_0 => 43u, 
				DefaultDataModeEnum.DIG_AUDIO_1 => 44u, 
				DefaultDataModeEnum.DIG_AUDIO_3 => 46u, 
				DefaultDataModeEnum.DIG_RXRDS_0 => 48u, 
				DefaultDataModeEnum.DIG_DCC => 49u, 
				DefaultDataModeEnum.DIG_SPUR => 50u, 
				DefaultDataModeEnum.DIG_PILOT => 51u, 
				DefaultDataModeEnum.DIG_RX => 52u, 
				DefaultDataModeEnum.DIG_INTF_2 => 53u, 
				DefaultDataModeEnum.DIG_INTF_3 => 54u, 
				DefaultDataModeEnum.DIG_TX_0 => 55u, 
				DefaultDataModeEnum.DIG_TX_1 => 56u, 
				DefaultDataModeEnum.DIG_RXRDS_1 => 57u, 
				DefaultDataModeEnum.RDS_CUSTOM => 58u, 
				DefaultDataModeEnum.CLK_SPUR => 59u, 
				DefaultDataModeEnum.PHY_CONFIG => 60u, 
				DefaultDataModeEnum.PHY_TXBLOCK => 61u, 
				DefaultDataModeEnum.PHY_TCB => 62u, 
				DefaultDataModeEnum.EXT_MODE => 63u, 
				DefaultDataModeEnum.LOG => 64u, 
				_ => uint.MaxValue, 
			}, 
		};
	}

	public static string DefaultDataModeToString(DefaultDataModeEnum enumItem)
	{
		return enumItem switch
		{
			DefaultDataModeEnum.CUSTOM => "CUSTOM", 
			DefaultDataModeEnum.RDS_PS_0 => "RDS_PS_0", 
			DefaultDataModeEnum.RDS_PS_1 => "RDS_PS_1", 
			DefaultDataModeEnum.RDS_PS_2 => "RDS_PS_2", 
			DefaultDataModeEnum.RDS_PS_3 => "RDS_PS_3", 
			DefaultDataModeEnum.RDS_PS_4 => "RDS_PS_4", 
			DefaultDataModeEnum.RDS_PS_5 => "RDS_PS_5", 
			DefaultDataModeEnum.RDS_PS_6 => "RDS_PS_6", 
			DefaultDataModeEnum.RDS_RT_0 => "RDS_RT_0", 
			DefaultDataModeEnum.RDS_RT_1 => "RDS_RT_1", 
			DefaultDataModeEnum.RDS_RT_2 => "RDS_RT_2", 
			DefaultDataModeEnum.RDS_RT_3 => "RDS_RT_3", 
			DefaultDataModeEnum.RDS_RT_4 => "RDS_RT_4", 
			DefaultDataModeEnum.RDS_CONFIG => "RDS_CONFIG", 
			DefaultDataModeEnum.RX_CONFIG => "RX_CONFIG", 
			DefaultDataModeEnum.RX_TIMERS => "RX_TIMERS", 
			DefaultDataModeEnum.RDS_TX_GROUPS => "RDS_TX_GROUPS", 
			DefaultDataModeEnum.RDS_COUNT_0 => "RDS_COUNT_0", 
			DefaultDataModeEnum.RDS_COUNT_1 => "RDS_COUNT_1", 
			DefaultDataModeEnum.RDS_COUNT_2 => "RDS_COUNT_2", 
			DefaultDataModeEnum.RADIO_CONFIG => "RADIO_CONFIG", 
			_ => enumItem switch
			{
				DefaultDataModeEnum.RX_CONFIG => "RX_CONFIG", 
				DefaultDataModeEnum.RX_TIMERS => "RX_TIMERS", 
				DefaultDataModeEnum.RX_STATIONS_0 => "RX_STATIONS_0", 
				DefaultDataModeEnum.RX_STATIONS_1 => "RX_STATIONS_1", 
				DefaultDataModeEnum.INT_CTRL => "INT_CTRL", 
				DefaultDataModeEnum.ERROR => "ERROR", 
				DefaultDataModeEnum.CHIPID => "CHIPID", 
				DefaultDataModeEnum.CAL_DAT_0 => "CAL_DAT_0", 
				DefaultDataModeEnum.CAL_DAT_1 => "CAL_DAT_1", 
				DefaultDataModeEnum.CAL_DAT_2 => "CAL_DAT_2", 
				DefaultDataModeEnum.CAL_DAT_3 => "CAL_DAT_3", 
				DefaultDataModeEnum.CAL_CFG_0 => "CAL_CFG_0", 
				DefaultDataModeEnum.CAL_CFG_1 => "CAL_CFG_1", 
				DefaultDataModeEnum.DIG_INTF_0 => "DIG_INTF_0", 
				DefaultDataModeEnum.DIG_INTF_1 => "DIG_INTF_1", 
				DefaultDataModeEnum.DIG_AGC_0 => "DIG_AGC_0", 
				DefaultDataModeEnum.DIG_AGC_1 => "DIG_AGC_1", 
				DefaultDataModeEnum.DIG_AGC_2 => "DIG_AGC_2", 
				DefaultDataModeEnum.DIG_AUDIO_0 => "DIG_AUDIO_0", 
				DefaultDataModeEnum.DIG_AUDIO_1 => "DIG_AUDIO_1", 
				DefaultDataModeEnum.DIG_AUDIO_3 => "DIG_AUDIO_3", 
				DefaultDataModeEnum.DIG_RXRDS_0 => "DIG_RXRDS_0", 
				DefaultDataModeEnum.DIG_DCC => "DIG_DCC", 
				DefaultDataModeEnum.DIG_SPUR => "DIG_SPUR", 
				DefaultDataModeEnum.DIG_PILOT => "DIG_PILOT", 
				DefaultDataModeEnum.DIG_RX => "DIG_RX", 
				DefaultDataModeEnum.DIG_INTF_2 => "DIG_INTF_2", 
				DefaultDataModeEnum.DIG_INTF_3 => "DIG_INTF_3", 
				DefaultDataModeEnum.DIG_TX_0 => "DIG_TX_0", 
				DefaultDataModeEnum.DIG_TX_1 => "DIG_TX_1", 
				DefaultDataModeEnum.DIG_RXRDS_1 => "DIG_RXRDS_1", 
				DefaultDataModeEnum.RDS_CUSTOM => "RDS_CUSTOM", 
				DefaultDataModeEnum.CLK_SPUR => "CLK_SPUR", 
				DefaultDataModeEnum.PHY_CONFIG => "PHY_CONFIG", 
				DefaultDataModeEnum.PHY_TXBLOCK => "PHY_TXBLOCK", 
				DefaultDataModeEnum.PHY_TCB => "PHY_TCB", 
				DefaultDataModeEnum.EXT_MODE => "EXT_MODE", 
				DefaultDataModeEnum.LOG => "LOG", 
				_ => "Invalid DefaultDataMode Value", 
			}, 
		};
	}

	public static string DefaultDataModeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = CUSTOM");
		stringBuilder.AppendLine("0x1 = RDS_PS_0");
		stringBuilder.AppendLine("0x2 = RDS_PS_1");
		stringBuilder.AppendLine("0x3 = RDS_PS_2");
		stringBuilder.AppendLine("0x4 = RDS_PS_3");
		stringBuilder.AppendLine("0x5 = RDS_PS_4");
		stringBuilder.AppendLine("0x6 = RDS_PS_5");
		stringBuilder.AppendLine("0x7 = RDS_PS_6");
		stringBuilder.AppendLine("0x8 = RDS_RT_0");
		stringBuilder.AppendLine("0x9 = RDS_RT_1");
		stringBuilder.AppendLine("0xA = RDS_RT_2");
		stringBuilder.AppendLine("0xB = RDS_RT_3");
		stringBuilder.AppendLine("0xC = RDS_RT_4");
		stringBuilder.AppendLine("0xD = RDS_CONFIG");
		stringBuilder.AppendLine("0xE = RX_CONFIG");
		stringBuilder.AppendLine("0xF = RX_TIMERS");
		stringBuilder.AppendLine("0x10 = RDS_TX_GROUPS");
		stringBuilder.AppendLine("0x11 = RDS_COUNT_0");
		stringBuilder.AppendLine("0x12 = RDS_COUNT_1");
		stringBuilder.AppendLine("0x13 = RDS_COUNT_2");
		stringBuilder.AppendLine("0x14 = RADIO_CONFIG");
		stringBuilder.AppendLine("0x15 = RX_CONFIG");
		stringBuilder.AppendLine("0x16 = RX_TIMERS");
		stringBuilder.AppendLine("0x17 = RX_STATIONS_0");
		stringBuilder.AppendLine("0x18 = RX_STATIONS_1");
		stringBuilder.AppendLine("0x19 = INT_CTRL");
		stringBuilder.AppendLine("0x1A = ERROR");
		stringBuilder.AppendLine("0x1B = CHIPID");
		stringBuilder.AppendLine("0x20 = CAL_DAT_0");
		stringBuilder.AppendLine("0x21 = CAL_DAT_1");
		stringBuilder.AppendLine("0x22 = CAL_DAT_2");
		stringBuilder.AppendLine("0x23 = CAL_DAT_3");
		stringBuilder.AppendLine("0x24 = CAL_CFG_0");
		stringBuilder.AppendLine("0x25 = CAL_CFG_1");
		stringBuilder.AppendLine("0x26 = DIG_INTF_0");
		stringBuilder.AppendLine("0x27 = DIG_INTF_1");
		stringBuilder.AppendLine("0x28 = DIG_AGC_0");
		stringBuilder.AppendLine("0x29 = DIG_AGC_1");
		stringBuilder.AppendLine("0x2A = DIG_AGC_2");
		stringBuilder.AppendLine("0x2B = DIG_AUDIO_0");
		stringBuilder.AppendLine("0x2C = DIG_AUDIO_1");
		stringBuilder.AppendLine("0x2E = DIG_AUDIO_3");
		stringBuilder.AppendLine("0x30 = DIG_RXRDS_0");
		stringBuilder.AppendLine("0x31 = DIG_DCC");
		stringBuilder.AppendLine("0x32 = DIG_SPUR");
		stringBuilder.AppendLine("0x33 = DIG_PILOT");
		stringBuilder.AppendLine("0x34 = DIG_RX");
		stringBuilder.AppendLine("0x35 = DIG_INTF_2");
		stringBuilder.AppendLine("0x36 = DIG_INTF_3");
		stringBuilder.AppendLine("0x37 = DIG_TX_0");
		stringBuilder.AppendLine("0x38 = DIG_TX_1");
		stringBuilder.AppendLine("0x39 = DIG_RXRDS_1");
		stringBuilder.AppendLine("0x3A = RDS_CUSTOM");
		stringBuilder.AppendLine("0x3B = CLK_SPUR");
		stringBuilder.AppendLine("0x3C = PHY_CONFIG");
		stringBuilder.AppendLine("0x3D = PHY_TXBLOCK");
		stringBuilder.AppendLine("0x3E = PHY_TCB");
		stringBuilder.AppendLine("0x3F = EXT_MODE");
		stringBuilder.AppendLine("0x40 = LOG");
		return stringBuilder.ToString();
	}
}
