using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class CommandCompleteForDoProcessCalibrationInfo : PacketInfoBase
{
	public override string Name => "Command Complete For Do Process Calibration";

	public override string DisplayGroup => "Common Control";

	public CommandCompleteForDoProcessCalibrationInfo(CommandCompleteForDoProcessCalibration packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		CommandCompleteForDoProcessCalibration commandCompleteForDoProcessCalibration = (CommandCompleteForDoProcessCalibration)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Num HCI Command Packets", "", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.NumHciCommandPackets, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Command OpCode", CommandOpcodeInfo.CommandOpcodeToDescription(), 16, FormatValue(commandCompleteForDoProcessCalibration.UserFields.CommandOpcode, 16), CommandOpcodeInfo.CommandOpcodeToString(CommandOpcodeInfo.ValueToCommandOpcode(commandCompleteForDoProcessCalibration.UserFields.CommandOpcode)), "", "", settable: false, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Status", ErrorCodeInfo.ErrorCodeToDescription(), 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.Status, 8), ErrorCodeInfo.ErrorCodeToString(ErrorCodeInfo.ValueToErrorCode(commandCompleteForDoProcessCalibration.UserFields.Status)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Mode", "", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.Mode, 8), "", "", "", settable: false, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("RC MOM 1", "Measured RC constant for RTMOM M1-M5 capacitor type", 16, FormatValue(commandCompleteForDoProcessCalibration.UserFields.RcMom1, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("RC MOM 2", "Measured RC constant for RTMOM M2-M4 capacitor type", 16, FormatValue(commandCompleteForDoProcessCalibration.UserFields.RcMom2, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("RC MOS VAR", "Measured RC constant for MOSVAR capacitor type", 16, FormatValue(commandCompleteForDoProcessCalibration.UserFields.RcMosVar, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("RC MOS CAP", "Measured RC constant for MOSCAP capacitor type", 16, FormatValue(commandCompleteForDoProcessCalibration.UserFields.RcMosCap, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("BBF C TUNE G0", "Base Band Filter (BBF) C-tuning code for gain state G0", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG0, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("BBF C TUNE G1", "Base Band Filter (BBF) C-tuning code for gain state G1", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG1, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("BBF C TUNE G2", "Base Band Filter (BBF) C-tuning code for gain state G2", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG2, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("BBF C TUNE G3", "Base Band Filter (BBF) C-tuning code for gain state G3", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG3, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("ADC C TUNE", "ADC C-tuning code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.AdcCTune, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("NOTCH R", "Notch Filter R-tuning code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.NotchR, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("NOTCH C", "Notch Filter C-tuning code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.NotchC, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL C1 RX", "PLL C-tuning C1 Rx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllC1Rx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL C1 TX", "PLL C-tuning C1 Tx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllC1Tx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL C2 RX", "PLL C-tuning C2 Rx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllC2Rx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL C2 TX", "PLL C-tuning C2 Tx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllC2Tx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL C3 RX", "PLL C-tuning C3 Rx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllC3Rx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL C3 TX", "PLL C-tuning C3 Tx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllC3Tx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL R1 RX", "PLL C-tuning R1 Rx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllR1Rx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("PLL R1 TX", "PLL C-tuning R1 Tx code", 8, FormatValue(commandCompleteForDoProcessCalibration.UserFields.PllR1Tx, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		CommandCompleteForDoProcessCalibration commandCompleteForDoProcessCalibration = (CommandCompleteForDoProcessCalibration)packet;
		int num = -1;
		if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.NumHciCommandPackets = Convert.ToUInt32(value, 16);
			return;
		}
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field CommandOpcode");
		}
		if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.Status = Convert.ToUInt32(value, 16);
			return;
		}
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field Mode");
		}
		if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.RcMom1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.RcMom2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.RcMosVar = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.RcMosCap = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.BbfCTuneG3 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.AdcCTune = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.NotchR = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.NotchC = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllC1Rx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllC1Tx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllC2Rx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllC2Tx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllC3Rx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllC3Tx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllR1Rx = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForDoProcessCalibration.UserFields.PllR1Tx = Convert.ToUInt32(value, 16);
		}
	}
}
