
using System.Threading;

namespace MesServerFunctions
{
    public partial class Functions_BASE_WebSubmit
    {

        //1.工件到位后，PLC给MES传递机型(DBX0.4)(44)，
        //2.MES判断是否扫描完成
        //3.若扫描完成，则MES给出合格放行(DBX2.5)(51)
        /// <summary>
        /// 扫描条码
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="barcode"></param>
        public static void fun_Barcode(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(Barcode, e);
        }


        /// <summary>
        /// 传递机型
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        public static void fun_EngineTypeGetOverPLC(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(EngineTypeGetOver_PLC, e);
        }

        /// <summary>
        /// 合格放行
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        public void fun_ConfirmOkGo(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(ConfirmOkGo, e);
        }

        /// <summary>
        /// 不合格放行
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        public void fun_FalseGo(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(FalseGO, e);
        }
        

        /// <summary>
        /// 保存完成 20
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        public void fun_MesReadOver(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(MesReadOver, e);
        }

        /// <summary>
        /// 保存完成 19
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        public void fun_MesRead(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(MesRead, e);
        }

        /// <summary>
        /// 工件到位离开(清空所有的MES信号)
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        public void fun_WorkStart(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(WorkStart, e);
        }

        /// <summary>
        /// 处理WEB页面发送过来的请求（m_Command + "|" + m_Value;）
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="Content"></param>
        public void fun_WebSubmit(DoWhatPlc.CustomeEvetnArgs e)
        {
            ThreadPool.QueueUserWorkItem(WebSubmit, e);
        }

        public int fun_SubLineLoadPartCountMatch()
        {
            return SubLineLoadPartCountMatch;
        }

    }
}
