Example #1
0
        /// <summary>
        /// 通用数据采集
        /// </summary>
        /// <param name="_session"></param>
        /// <param name="_transData"></param>
        private void ExecuteNDQ(MesSession _session, TransData _transData)
        {
            //1、参数校验---equipmentID---------------------------------
            string equipmentID = string.Empty;

            if (!EmployeeComm.CheckEquipmentID(_session, _transData, out equipmentID, EmployeeName))
            {
                return;
            }

            //2、参数校验---ProcessData > 2项------------------------------
            List <string> lstProcessData = new List <string>();

            if (!EmployeeComm.CheckProcessData(_session, _transData, out lstProcessData, EmployeeName, Comparator.MoreThan, 2))
            {
                return;
            }

            if (!GlobalData.IsDebug)
            {
                if ((lstProcessData[0]) == "02")
                {
                    string nEmployeeName = $"气密性测试数据采集-通用过站";

                    //2.1、参数校验---apiStatus
                    string apiStatus = string.Empty;
                    if (!EmployeeComm.CheckApiStatus(_session, _transData, out apiStatus, nEmployeeName))
                    {
                        return;
                    }

                    //2.2、【气密性测试数据采集】需要提前执行【通过过站】操作 //不需要传制令单号
                    if (!EmployeeComm.CheckRoute(_session, _transData, "", equipmentID, apiStatus, nEmployeeName))
                    {
                        return;
                    }

                    //2.3、队列方式进行报工(如果记录了不良则无需进行第二次报工,因为记录不良时已经进行第一次报工了)
                    if (apiStatus != "FAIL")
                    {
                        GlobalData.queueServerNDQ.EnqueueItem(new TestItemFlex(_session, _transData, equipmentID, nEmployeeName, "103OUT"));
                    }
                }

                //3、采集数据参数校验
                if (!CheckNdqParam(_session, _transData, equipmentID, lstProcessData))
                {
                    return;
                }
            }

            //4、API执行成功  ---------------------------------
            EmployeeComm.SendMsg(_session, _transData, CheckResult.OK);

            //5、队列方式保存采集数据
            GlobalData.queueServerNDQ.EnqueueItem(new TestItemFlex(_transData.SN, _transData.DeviceCode, equipmentID, lstProcessData, _session));
        }
Example #2
0
        /// <summary>
        /// 通用过站
        /// </summary>
        /// <param name="_session"></param>
        /// <param name="_transData"></param>
        private void ExecuteNRC(MesSession _session, TransData _transData)
        {
            //1、参数校验---equipmentID
            string equipmentID = string.Empty;

            if (!EmployeeComm.CheckEquipmentID(_session, _transData, out equipmentID, EmployeeName))
            {
                return;
            }

            //2、参数校验---WorkOrder
            string workOrder = string.Empty;

            if (_transData.DeviceCode == "OP010") //首站需要校验制令单号
            {
                if (!EmployeeComm.CheckWorkOrder(_session, _transData, out workOrder, $"{EmployeeName}-工单获取", DataFrom.SQLite))
                {
                    return;
                }
            }

            //3、参数校验---apiStatus
            string apiStatus = string.Empty;

            if (!EmployeeComm.CheckApiStatus(_session, _transData, out apiStatus, EmployeeName))
            {
                return;
            }

            if (!GlobalData.IsDebug)
            {
                //4、执行过站
                if (!EmployeeComm.CheckRoute(_session, _transData, workOrder, equipmentID, apiStatus, EmployeeName))
                {
                    return;
                }

                //4.1 队列方式进行报工(如果记录了不良则无需进行第二次报工,因为记录不良时已经进行第一次报工了)
                if (apiStatus != "FAIL")
                {
                    GlobalData.queueServerNDQ.EnqueueItem(new TestItemFlex(_session, _transData, equipmentID, EmployeeName, "103OUT"));
                }
            }

            //5、API执行成功 ---------------------------------
            EmployeeComm.SendMsg(_session, _transData, CheckResult.OK);
        }