using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class TxRdsContinuousGroupsCompleteInfo : PacketInfoBase
{
	public override string Name => "Tx Rds Continuous Groups Complete";

	public override string DisplayGroup => "Events";

	public TxRdsContinuousGroupsCompleteInfo(TxRdsContinuousGroupsComplete packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		TxRdsContinuousGroupsComplete txRdsContinuousGroupsComplete = (TxRdsContinuousGroupsComplete)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Groups Available", "The maximum number of RDS/RBDS groups that can be passed to the FM SOC at any a particular instance", 8, FormatValue(txRdsContinuousGroupsComplete.UserFields.GroupsAvailable, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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