using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Pms.EventLibrary.TaskEvent;
using Pms.EventLibrary.TaskEventArgs;
using System.Windows.Forms;

namespace Pms.UserEvent.OrderEvent
{
    public partial class COrderEvent:BaseOrderEvent
    {
        public COrderEvent():base()
        {}

        /// <summary>
        /// 任务创建前触发此事件
        /// 设置 e.IsSuccessed = false 则任务不再执行 即任务异常
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderBeginCreate(object sender, P_OrderEventArgs e)
        {
        }

        /// <summary>
        /// 任务下发AGVS后触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderStarted(object sender, P_OrderEventArgs e)
        {
        }

        /// <summary>
        /// AGVS回调 小车给AGV后触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderAssignedCarrier(object sender, P_OrderEventArgs e)
        {
        }

        // 当前版本不会触发
        protected override void OrderExecuting(object sender, P_OrderEventArgs e)
        {
        }

        /// <summary>
        /// 任务异常不能执行时，会触发此事件
        /// 此处添加可以 自动处理的异常 的处理代码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderException(object sender, P_OrderEventArgs e)
        {
        }

        /// <summary>
        /// 调用取消接口后触发此事件
        /// 任务取消成功与否 都会触发此事件
        /// e.IsCancelSuccess = True ： 取消成功
        /// e.IsCancelSuccess = false： 取消失败
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderCanceled(object sender, P_OrderEventArgs e)
        {
        }
        // 当前版本不会触发
        protected override void OrderChanged(object sender, P_OrderEventArgs e)
        {
        }
        /// <summary>
        /// 任务执行完成会触发此事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderFinished(object sender, P_OrderEventArgs e)
        {
        }
        /// <summary>
        /// 如果配置了步骤行为60035 则需要处理此事件
        /// 用来决定任务AGV小车是否可以 释放事件  
        /// e.IsSuccessed = true; 则 系统认为可以释放小车
        /// e.IsSuccessed = false; 则 系统认为不可以 释放小车
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderCarrierNeedRelease(object sender, P_OrderEventArgs e)
        {
            
        }
        /// <summary>
        /// 任务模板 选择时触发此事件
        /// e.OrderData.BookTemplateID_RW = 值
        /// 设置 e.IsSuccessed = false 则任务不再执行 即任务异常
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OrderTemplateSelecting(object sender, P_OrderEventArgs e)
        {
        }
    }
}
