Exemplo n.º 1
0
        /// <summary>
        /// the message is about TM test states, like pass,fail, abort, error,idle and running
        /// </summary>
        /// <param name="msg"></param>
        public void AH_Status(Message msg)
        {
            if (msg.Info == "P")
            {
                stationList[int.Parse(msg.stationId) - 1].DUTTestConsecutiveFailedTimes = 0;
                UpdateStation(msg.stationId, ClientStatusType.Pass);
                ControlPLCMoveDUTAwayStation(msg);

                //record test result for test yield statistics
                TestStationData.RecordTesterYieldData(msg.stationId, ClientStatusType.Pass);

                //record dut test result to system log
                LogerHelper2.RecordDutTestResultToSystemLog(msg.stationId, msg.DutID.Split('|')[0], ClientStatusType.Pass);
            }
            else if (msg.Info == "F" || msg.Info == "A")
            {
                string[] strmsg = msg.DutID.Split('|');
                string   DutId  = strmsg[0];
                if (strmsg.Length > 1)  //print the fail infromation in windows
                {
                    stationList[int.Parse(msg.stationId) - 1].errorInfo = strmsg[1];
                    ClientGUFStatus.UpdateStationsData(int.Parse(msg.stationId), 4, ClientStatusType.Fail);
                }
                stationList[int.Parse(msg.stationId) - 1].currentDUTtestedCount++;
                UpdateStation(msg.stationId, msg.Info == "F" ? ClientStatusType.Fail : ClientStatusType.Abort);
                if (DUTReTest.isNeedReTest(int.Parse(msg.stationId), DutId) && isKill[int.Parse(msg.stationId) - 1] == false)                  // check whether need retest
                {
                    server.SendMsg(new Message(msg.stationId, 1, MsgType.NewDut, DutId), stationList[int.Parse(msg.stationId) - 1].ahaddress); //dutid
                }
                else
                {
                    if (isKill[int.Parse(msg.stationId) - 1] == true)
                    {
                        isKill[int.Parse(msg.stationId) - 1] = false;
                    }
                    else
                    {
                        stationList[int.Parse(msg.stationId) - 1].DUTTestConsecutiveFailedTimes++;
                    }
                    ControlPLCMoveDUTAwayStation(msg);

                    //record test result for test yield statistics
                    TestStationData.RecordTesterYieldData(msg.stationId, ClientStatusType.Fail);
                    //record dut test result to system log
                    LogerHelper2.RecordDutTestResultToSystemLog(msg.stationId, DutId, ClientStatusType.Fail);

                    if (stationList[int.Parse(msg.stationId) - 1].DUTTestConsecutiveFailedTimes >= DUTReTest.alarmWhenDUTTestFailTimes)
                    {
                        stationList[int.Parse(msg.stationId) - 1].isAvaliable = false;
                        stationList[int.Parse(msg.stationId) - 1].errorInfo   = "DUT test consecutive failures";
                        UpdateStation(msg.stationId, ClientStatusType.Error);
                    }
                }

                //   ControlPLCMoveDUTAwayStation(msg);
            }
            else if (msg.Info == "I")
            {
                UpdateStation(msg.stationId, ClientStatusType.Idle);
            }
            else if (msg.Info == "R")
            {
                UpdateStation(msg.stationId, ClientStatusType.Run);
            }
            else if (msg.Info == "E")
            {
                //stationList[int.Parse(msg.stationId) - 1].isAvaliable = false;
                stationList[int.Parse(msg.stationId) - 1].errorInfo = msg.ErrorInfo;
                UpdateStation(msg.stationId, ClientStatusType.Error);
            }
            else
            {
                LogerHelper2.ToLog("Client " + msg.stationId + "sends strange status", 4);
            }
        }