using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class SetGetResetAgcInfo : PacketInfoBase
{
	public override string Name => "Set Get Reset Agc";

	public override string DisplayGroup => "Diagnostic";

	public SetGetResetAgcInfo(SetGetResetAgc packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		SetGetResetAgc setGetResetAgc = (SetGetResetAgc)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("ucCtrl", SetGetResetAgc.UserFieldsWrapper.UcctrlInfo.UcctrlToDescription(), 8, FormatValue(setGetResetAgc.UserFields.Ucctrl, 8), SetGetResetAgc.UserFieldsWrapper.UcctrlInfo.UcctrlToString(SetGetResetAgc.UserFieldsWrapper.UcctrlInfo.ValueToUcctrl(setGetResetAgc.UserFields.Ucctrl)), "", "2", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("ucGainState", SetGetResetAgc.UserFieldsWrapper.UcgainstateInfo.UcgainstateToDescription(), 8, FormatValue(setGetResetAgc.UserFields.Ucgainstate, 8), SetGetResetAgc.UserFieldsWrapper.UcgainstateInfo.UcgainstateToString(SetGetResetAgc.UserFieldsWrapper.UcgainstateInfo.ValueToUcgainstate(setGetResetAgc.UserFields.Ucgainstate)), "", "5", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		SetGetResetAgc setGetResetAgc = (SetGetResetAgc)packet;
		int num = -1;
		if (index == ++num)
		{
			setGetResetAgc.UserFields.Ucctrl = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setGetResetAgc.UserFields.Ucgainstate = Convert.ToUInt32(value, 16);
		}
	}
}
