using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class DoCalibrationInfo : PacketInfoBase
{
	public override string Name => "Do Calibration";

	public override string DisplayGroup => "Common Control";

	public DoCalibrationInfo(DoCalibration packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		DoCalibration doCalibration = (DoCalibration)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Mode", DoCalibration.UserFieldsWrapper.ModeInfo.ModeToDescription(), 8, FormatValue(doCalibration.UserFields.Mode, 8), DoCalibration.UserFieldsWrapper.ModeInfo.ModeToString(DoCalibration.UserFieldsWrapper.ModeInfo.ValueToMode(doCalibration.UserFields.Mode)), "", "3", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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