private void frmC机械手_MouseDown(object sender, MouseEventArgs e) { int i = 0; PointF MouseP = new PointF(e.X, e.Y);; if (e.Button == System.Windows.Forms.MouseButtons.Left) { for (i = ListTuYuan.Count - 1; i > -1; i--) { CBase obj = (CBase)ListTuYuan[i]; if (obj.ElementType == LCElementType.Ring) { if (obj.Selected(MouseP)) { CRing nRing = (CRing)obj; string sVar = "AV" + nRing.ShowText.PadLeft(3, '0'); CStation Sta = frmMain.staComm.GetStaByStaName("NJ301"); CProtcolFINS SPLC = (CProtcolFINS)Sta; SPLC.SendAODO(sVar, 0, "DO"); break; } } } } }
private void buttonSend1002(object sender, EventArgs e) { Button nCon = (Button)sender; gBSet.Visible = false; switch (nCon.Name) { case "button013": if (bMsgBoxShowYN("是否执行 生长室真空检漏 程序?", "真空检漏")) { SPLC.SendAODO("1002", 13, "SY"); //13:生长室真空检漏 } break; case "button014": if (bMsgBoxShowYN("是否执行 生长室充气 程序?", "充气")) { SPLC.SendAODO("1002", 14, "SY"); //14:生长室充气 } break; case "button015": if (bMsgBoxShowYN("是否执行 生长室泵吹扫 程序?", "泵吹扫")) { SPLC.SendAODO("1002", 15, "SY"); //15:生长室泵吹扫 gBSet.Visible = true; } break; case "button002": if (bMsgBoxShowYN("是否执行 N2 Idle 程序?", "N2 Idl")) { SPLC.SendAODO("1002", 2, "SY"); //2:N2 Idle } break; } }
private void buttonSend1002(object sender, EventArgs e)//下发程序控制 { Button nCon = (Button)sender; switch (nCon.Name) { case "button074": if (DI074.GetBoolValue()) { if (bMsgBoxShowYN("是否进行生长室门阀关闭程序?", "关闭")) { SPLC.SendAODO("1002", 12, "SY"); //12:生长室门阀关闭 } } else if (DI075.GetBoolValue()) { if (SPLC.System[0] == 7) { return; } if (bMsgBoxShowYN("是否进行生长室门阀开启程序?", "开启")) { SPLC.SendAODO("1002", 11, "SY"); //11:生长室门阀开启 } } break; case "button110": //进样室门阀 if (DI110.GetBoolValue()) { if (bMsgBoxShowYN("是否进行进样室门阀关闭程序?", "关闭")) { if (SPLC.System[0] == 7) { SPLC.SendAODO("1046", 17, "SY"); //17:进样室门阀关闭 } else { SPLC.SendAODO("1002", 17, "SY"); //17:进样室门阀关闭 } } } else if (DI111.GetBoolValue()) { if (bMsgBoxShowYN("是否进行进样室门阀开启程序?", "开启")) { if (SPLC.System[0] == 7) { SPLC.SendAODO("1046", 16, "SY"); //16:进样室门阀开启 } else { SPLC.SendAODO("1002", 16, "SY"); //16:进样室门阀开启 } } } break; case "button018": if (bMsgBoxShowYN("是否进行进样室吹扫程序?", "吹扫")) { SPLC.SendAODO("1002", 18, "SY"); //18:进样室吹扫 } break; case "button147": if (bMsgBoxShowYN("是否打开进样室抽气门阀?", "抽气")) { SPLC.SendAODO("AV147", 0, "DO"); } break; case "button145": if (bMsgBoxShowYN("是否打开进样室充气门阀?", "充气")) { SPLC.SendAODO("AV145", 0, "DO"); } break; case "button141": if (bMsgBoxShowYN("是否关闭水冷套?", "关闭")) { SPLC.SendAODO("AV141", 1, "DO2"); SPLC.SendAODO("AV142", 0, "DO2"); } break; case "button142": if (bMsgBoxShowYN("是否开启水冷套?", "开启")) { SPLC.SendAODO("AV141", 0, "DO2"); SPLC.SendAODO("AV142", 1, "DO2"); } break; } }
private void button4_Click(object sender, EventArgs e)//保存维护 { if (MessageBox.Show("是否保存维护设置的修改?", "保存", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } try { XmlDocument myxmldoc = new XmlDocument(); myxmldoc.Load(sXMLPath); string xpath = "root/Maintenance"; XmlElement childNode = (XmlElement)myxmldoc.SelectSingleNode(xpath); childNode.SetAttribute("num9001", num9001.Value.ToString()); childNode.SetAttribute("num9002", num9002.Value.ToString()); childNode.SetAttribute("num9003", num9003.Value.ToString()); myxmldoc.Save(sXMLPath); if ((int)num1022.Value != SPLC.System[21]) { SPLC.SendAODO("1022", (int)num1022.Value, "SY"); //1022 W 源瓶吹扫次数设定 } if ((int)num1023.Value != SPLC.System[22]) { SPLC.SendAODO("1023", (int)num1023.Value, "SY"); //1023 W 源瓶吹扫时间设定 } if ((int)num1032.Value != SPLC.System[31]) { SPLC.SendAODO("1032", (int)num1032.Value, "SY"); //1032 R 生长室次扫次数 } if ((int)num1033.Value != SPLC.System[32]) { SPLC.SendAODO("1033", (int)num1033.Value, "SY"); //1033 R 生长室次扫时间 } MessageBox.Show("维护配置修改保存成功", "成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } catch (Exception ex) { MessageBox.Show("修改维护:" + ex.Message); } }