using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class LowPassFilterControlInfo : PacketInfoBase
{
	public override string Name => "Low Pass Filter Control";

	public override string DisplayGroup => "Receiver Control";

	public LowPassFilterControlInfo(LowPassFilterControl packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LowPassFilterControl lowPassFilterControl = (LowPassFilterControl)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("LPF Control", LowPassFilterControl.UserFieldsWrapper.LpfControlInfo.LpfControlToDescription(), 8, FormatValue(lowPassFilterControl.UserFields.LpfControl, 8), LowPassFilterControl.UserFieldsWrapper.LpfControlInfo.LpfControlToString(LowPassFilterControl.UserFieldsWrapper.LpfControlInfo.ValueToLpfControl(lowPassFilterControl.UserFields.LpfControl)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		LowPassFilterControl lowPassFilterControl = (LowPassFilterControl)packet;
		int num = -1;
		if (index == ++num)
		{
			lowPassFilterControl.UserFields.LpfControl = Convert.ToUInt32(value, 16);
		}
	}
}
