private void button4_Click(object sender, EventArgs e) { LockUI(true); if (!MainProcess._Mode.Equals("Stop") && !MainProcess._Mode.Equals("")) { AlarmUpdate.UpdateMessage("目前狀態為 " + MainProcess._Mode + " 模式,請先停止動作。"); return; } NodeManagement.InitialNodes(); JobManagement.Initial(); if (PortSetting1Active_ck.Checked) { if (!PortSetting1Aligner_cb.Text.Equals("")) { Node Aligner1 = NodeManagement.Get(PortSetting1Aligner_cb.Text); if (Aligner1 != null) { Aligner1.LockByNode = PortSetting1Name_cb.Text; } } Node P1 = NodeManagement.Get(PortSetting1Name_cb.Text); int SlotMode = 0; if (PortSetting1SlotMode_ck.Checked) { SlotMode = 1; } else { SlotMode = 2; } for (int i = Convert.ToInt16(PortSetting1StartSlot_tb.Text); i <= Convert.ToInt16(PortSetting1EndSlot_tb.Text); i = i + SlotMode) { Job w = new Job(); w.Job_Id = "Wafer" + i.ToString("000"); w.AlignerFlag = true; w.OCRFlag = false; w.Position = P1.Name; w.ProcessFlag = false; w.FromPort = P1.Name; w.Slot = i.ToString(); w.Destination = PortSetting1Dest_cb.Text; w.DestinationSlot = i.ToString();; JobManagement.Add(w.Job_Id, w); P1.JobList.TryAdd(w.Slot, w); } } if (PortSetting2Active_ck.Checked) { if (!PortSetting2Aligner_cb.Text.Equals("")) { Node Aligner2 = NodeManagement.Get(PortSetting2Aligner_cb.Text); if (Aligner2 != null) { Aligner2.LockByNode = PortSetting2Name_cb.Text; } } Node P2 = NodeManagement.Get(PortSetting2Name_cb.Text); int SlotMode = 0; if (PortSetting2SlotMode_ck.Checked) { SlotMode = 1; } else { SlotMode = 2; } if (Convert.ToInt16(PortSetting2StartSlot_tb.Text) != 0 && Convert.ToInt16(PortSetting2EndSlot_tb.Text) != 0) { for (int i = Convert.ToInt16(PortSetting2StartSlot_tb.Text); i <= Convert.ToInt16(PortSetting2EndSlot_tb.Text); i = i + SlotMode) { Job w = new Job(); w.Job_Id = "Wafer" + (i + 25).ToString("000"); w.AlignerFlag = true; w.OCRFlag = false; w.Position = P2.Name; w.ProcessFlag = false; w.FromPort = P2.Name; w.Slot = i.ToString(); w.Destination = PortSetting2Dest_cb.Text; w.DestinationSlot = i.ToString();; JobManagement.Add(w.Job_Id, w); P2.JobList.TryAdd(w.Slot, w); } } } NodeManagement.UpdatePortToUI(); if (AutoIni_ck.Checked) { MainProcess.SetMode("AutoInitial");//initial } else { MainProcess.SetMode("Auto"); } }