namespace BPA.SingleDevice.Interface
{
    public interface IConveyer
    {
        /// <summary>设备ID</summary>
        public int ID { get; set; }

        /// <summary>位置有容器，这个程序里容器是碗。</summary>
        bool[] HaveVessel { get; set; }

        /// <summary>寸动是否反转，值为1时是反转，为0时则为正转。</summary>
        int IsReverse { get; set; }

        /// <summary>寸动速度。</summary>
        int InchSpeed { get; set; }

        /// <summary>传动带移动速度。</summary>
        int MoveSpeed { get; set; }

        /// <summary>加速时间，一般不改动。</summary>
        int AccTime { get; set; }

        /// <summary>传动带移动一次的长度，单位：脉冲。</summary>
        int MoveLength { get; set; }

        /// <summary>移动结束。</summary>
        bool MoveComplete { get; set; }

        /// <summary>是否连接。</summary>
        bool IsConnected { get; }

        /// <summary>允许移动。</summary>
        bool AllowMove { get; set; }

        /// <summary>设备初始化</summary>
        Task InitialAsync();

        /// <summary>设置通讯参数</summary>
        void SetCommParam(int id, string ip, int port = 502);

        /// <summary>开始寸动【调试状态】</summary>
        void StartInchMove();

        /// <summary>停止寸动。</summary>
        void StopInchMove();

        /// <summary>设置寸动参数</summary>
        /// <param name="isReverse">是否反转</param>
        /// <param name="inchSpeed">寸动速度</param>
        /// <returns>设置是否成功</returns>
        bool SetInchParam(int isReverse, uint inchSpeed);

        /// <summary>设置移动参数</summary>
        /// <param name="moveSpeed">移动速度</param>
        /// <param name="accTime">移动加速时间</param>
        /// <param name="moveLength">移动长度</param>
        /// <returns>设置是否成功</returns>
        bool SetMoveParam(uint moveSpeed, uint accTime, uint moveLength);

        /// <summary>移动一次。</summary>
        bool MoveOnce();

        bool InitalMoveParam();
    }
}