using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class CommandCompleteForGetStationsInternalDebugParametersInfo : PacketInfoBase
{
	public override string Name => "Command Complete For Get Stations Internal Debug Parameters";

	public override string DisplayGroup => "Diagnostic";

	public CommandCompleteForGetStationsInternalDebugParametersInfo(CommandCompleteForGetStationsInternalDebugParameters packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		CommandCompleteForGetStationsInternalDebugParameters commandCompleteForGetStationsInternalDebugParameters = (CommandCompleteForGetStationsInternalDebugParameters)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Num HCI Command Packets", "", 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.NumHciCommandPackets, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Command OpCode", CommandOpcodeInfo.CommandOpcodeToDescription(), 16, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.CommandOpcode, 16), CommandOpcodeInfo.CommandOpcodeToString(CommandOpcodeInfo.ValueToCommandOpcode(commandCompleteForGetStationsInternalDebugParameters.UserFields.CommandOpcode)), "", "", settable: false, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Status", ErrorCodeInfo.ErrorCodeToDescription(), 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.Status, 8), ErrorCodeInfo.ErrorCodeToString(ErrorCodeInfo.ValueToErrorCode(commandCompleteForGetStationsInternalDebugParameters.UserFields.Status)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Blend", CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.BlendInfo.BlendToDescription(), 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.Blend, 8), CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.BlendInfo.BlendToString(CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.BlendInfo.ValueToBlend(commandCompleteForGetStationsInternalDebugParameters.UserFields.Blend)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Soft Mute", CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.SoftMuteInfo.SoftMuteToDescription(), 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.SoftMute, 8), CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.SoftMuteInfo.SoftMuteToString(CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.SoftMuteInfo.ValueToSoftMute(commandCompleteForGetStationsInternalDebugParameters.UserFields.SoftMute)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Interference Blend", CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.InterferenceBlendInfo.InterferenceBlendToDescription(), 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceBlend, 8), CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.InterferenceBlendInfo.InterferenceBlendToString(CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.InterferenceBlendInfo.ValueToInterferenceBlend(commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceBlend)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Interference Soft Mute", CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.InterferenceSoftMuteInfo.InterferenceSoftMuteToDescription(), 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceSoftMute, 8), CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.InterferenceSoftMuteInfo.InterferenceSoftMuteToString(CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.InterferenceSoftMuteInfo.ValueToInterferenceSoftMute(commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceSoftMute)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Pilot PLL", CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.PilotPllInfo.PilotPllToDescription(), 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.PilotPll, 8), CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.PilotPllInfo.PilotPllToString(CommandCompleteForGetStationsInternalDebugParameters.UserFieldsWrapper.PilotPllInfo.ValueToPilotPll(commandCompleteForGetStationsInternalDebugParameters.UserFields.PilotPll)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Interference To Carrier Ratio", "Estimated interference to carrier ratio; two's complement value in dB", 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceToCarrierRatio, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Interference Detector Out", "Zero crossing result", 8, FormatValue(commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceDetectorOut, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		CommandCompleteForGetStationsInternalDebugParameters commandCompleteForGetStationsInternalDebugParameters = (CommandCompleteForGetStationsInternalDebugParameters)packet;
		int num = -1;
		if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.NumHciCommandPackets = Convert.ToUInt32(value, 16);
			return;
		}
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field CommandOpcode");
		}
		if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.Status = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.Blend = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.SoftMute = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceBlend = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceSoftMute = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.PilotPll = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceToCarrierRatio = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForGetStationsInternalDebugParameters.UserFields.InterferenceDetectorOut = Convert.ToUInt32(value, 16);
		}
	}
}
