예제 #1
0
 private void TxtOPID_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (TxtOPID.Text.Length == 8)
         {
             string sqlop = db.SwapData("", "QueryOPID", "OPID=" + TxtOPID.Text);
             if (sqlop.Contains("SF_CFG_CHK=PASS"))
             {
                 TxtOPID.Enabled  = false;
                 TxtFixID.Enabled = true;
                 TxtFixID.Focus();
                 Information.OPID = TxtOPID.Text;
             }
             else if (sqlop.Contains("SF_CFG_CHK"))
             {
                 MessageBox.Show("工号不存在!");
                 TxtOPID.Clear();
             }
             else
             {
                 MessageBox.Show("无法验证OP!\r\n" + sqlop);
                 TxtOPID.Enabled  = false;
                 TxtFixID.Enabled = true;
                 TxtFixID.Focus();
                 Information.OPID = TxtOPID.Text;
             }
         }
         else
         {
             MessageBox.Show("工号长度错误:" + TxtOPID.Text);
             TxtOPID.Clear();
         }
     }
 }
예제 #2
0
파일: Robot.cs 프로젝트: Lorain-Li/SelTest
 /// <summary>
 /// 设置测试流程其他机种需要修改,默认NU9流程{ ":01", ":02", ":04", ":20", "SYS_AUDIO:23", "SUB_TOUCH:24", "SUB_LED:26", "RF2:19", ":50" }
 /// </summary>
 /// <param name="flow"></param>
 public static Route CheckStation(Shopfloor sf, string SN, string Station, ref string OutStr, string[] flow = null)
 {
     try
     {
         if (flow != null)
         {
             Flow = flow;
         }
         string dbret = sf.SwapData("SWDL", "querydata", "SN=" + SN + ";$;station=QueryData;$;SWDateTime="
                                    + DateTime.Now.ToString("yyyyMMddHHmmss") + ";$;MonitorAgentVer=VW20151102.01;$;").ToUpper();
         OutStr = dbret;
         if (dbret.Contains("STATUS=") && dbret.Contains("SF_CFG_CHK=PASS"))
         {
             string Status = Shopfloor.GetStrInner(dbret, "STATUS=", ";");
             int    fix = 10, dut = -1;
             for (int i = 0; i < Flow.Length; i++)
             {
                 if (Flow[i].Contains(Station))
                 {
                     fix = i - 1;
                 }
                 if (Flow[i].Contains(Status))
                 {
                     dut = i;
                 }
             }
             if (dut == -1)
             {
                 return(Route.Failed);
             }
             if (dut == fix)
             {
                 return(Route.Pass);
             }
             if (dut > fix)
             {
                 return(Route.Tested);
             }
             if (dut < fix)
             {
                 return(Route.Lost);
             }
         }
         return(Route.None);
     }
     catch (Exception) { return(Route.None); }
 }