private void ExtramanGoto(object sender, EventArgs e)//机械手工位移动 { Button nCon = (Button)sender; string str1 = ""; int i = CMach.iStation / 10; int j = CMach.iStation % 10; switch (nCon.Name) { case "ExtraMove01": if (j == 0) { str1 = "GOTO N " + i.ToString() + " Z UP"; } else { str1 = "GOTO N " + i.ToString() + " R EX Z UP"; } break; case "ExtraMove02": if (j == 0) { str1 = "GOTO N " + i.ToString(); } else { str1 = "GOTO N " + i.ToString() + " R EX"; } break; case "ExtraMove03": str1 = "GOTO N " + i.ToString() + " R EX"; break; case "ExtraMove04": str1 = "RETRACT"; break; case "ExtraMove05": str1 = "HOME ALL"; break; case "ExtraMove06": str1 = "GOTO N 1"; break; case "ExtraMove07": str1 = "GOTO N 2"; break; case "ExtraMove08": str1 = "GOTO N 3"; break; case "ExtraMove09": str1 = "GOTO N 4"; break; } //Mach.RTZ2Angle(); if (str1.Length > 0) { CTran.SendAODO(str1 + "\r\n"); } }
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (ListText[i * 4 + j].ForeColor == Color.Red) { string str1 = "SET STN " + (i + 1).ToString().Trim(); str1 += " ALL " + ListText[i * 4 + 0].Text.Trim(); str1 += " " + ListText[i * 4 + 1].Text.Trim(); str1 += " " + ListText[i * 4 + 2].Text.Trim(); str1 += " " + ListText[i * 4 + 3].Text.Trim(); str1 += " 1 0\r\n"; CTran.SendAODO(str1); CTran.SendHandAODO("RQ STN " + (i + 1).ToString().Trim() + " ARM A ALL\r\n"); break; } } } }