using ProjectManagementSystem.Device.Extenions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectManagementSystem.Device.CommandCallback
{
    public class InfoAgv1062 : InfoAgv
    {
        public override void Deserialize(byte[] data)
        {
            base.Deserialize(data);

            AgvId = data[2];
            Mark = Convert.ToInt16(data[3] | ((data[7] & 0xC0) << 2));
            Route = data[6];

            Status = data[5];
            StatusText = Status.GetAgvStatusText();

            int SpeedGrade = data[7] & 0x3F;
            if (SpeedGrade > 0 && SpeedGrade < 6)
            {
                SpeedLevel = SpeedGrade;
            }

            LastUpdateTime = DateTime.Now;
        }
    }
}
