public static void UpdateNodesJob(string NodeName) { try { Form form = Application.OpenForms["FormWaferMapping"]; TextBox Mode; if (form == null) { return; } Node node = NodeManagement.Get(NodeName); //Mode.Text = node.Mode; //if (node.IsMapping) //{ for (int i = 1; i <= Tools.GetSlotCount(node.Type); i++) { UpdateSlot(node, i.ToString()); } //} } catch { logger.Error("UpdateNodesJob: Update fail."); } }
public static void UpdateLoadPortMode(string PortName, string Mode) { try { Form form = Application.OpenForms["FormWaferMapping"]; Label Port_Mode; if (form == null) { return; } Port_Mode = form.Controls.Find(PortName + "State_lb", true).FirstOrDefault() as Label; if (Port_Mode == null) { return; } if (Port_Mode.InvokeRequired) { UpdatePort ph = new UpdatePort(UpdateLoadPortMode); Port_Mode.BeginInvoke(ph, PortName, Mode); } else { NodeManagement.Get(PortName).Mode = Mode; Port_Mode.Text = PortName + " [" + Mode + "]"; } } catch (Exception e) { logger.Error("UpdateLoadPortMode: Update fail:" + e.StackTrace); } }
private void UpdateCheckBox(object input) { FormMain.HostControl.Events.Load(); MonitoringUpdate.EventUpdate("MAPDT", FormMain.HostControl.Events.MAPDT); MonitoringUpdate.EventUpdate("PORT", FormMain.HostControl.Events.PORT); MonitoringUpdate.EventUpdate("PRS", FormMain.HostControl.Events.PRS); MonitoringUpdate.EventUpdate("SYSTEM", FormMain.HostControl.Events.SYSTEM); MonitoringUpdate.EventUpdate("TRANSREQ", FormMain.HostControl.Events.TRANSREQ); MonitoringUpdate.EventUpdate("FFU", FormMain.HostControl.Events.FFU); MonitoringUpdate.EventUpdate("BF1_BYPASS", FormMain.HostControl.Events.BF1_BYPASS); NodeManagement.Get("BF1").ByPassCheck = FormMain.HostControl.Events.BF1_BYPASS; MonitoringUpdate.EventUpdate("BF2_BYPASS", FormMain.HostControl.Events.BF2_BYPASS); NodeManagement.Get("BF2").ByPassCheck = FormMain.HostControl.Events.BF2_BYPASS; DIOUpdate.UpdateDIOStatus("RED", "False"); DIOUpdate.UpdateDIOStatus("ORANGE", "False"); DIOUpdate.UpdateDIOStatus("GREEN", "False"); DIOUpdate.UpdateDIOStatus("BLUE", "False"); DIOUpdate.UpdateDIOStatus("BUZZER1", "False"); DIOUpdate.UpdateDIOStatus("BUZZER2", "False"); foreach (Node node in NodeManagement.GetList()) { MonitoringUpdate.EventUpdate(node.Name + "_Enable", node.Enable); } }
private void ChangeSpeed() { string sp = RunningSpeed_cb.Text.Replace("%", ""); if (sp.Equals("100")) { sp = "0"; } foreach (Node node in NodeManagement.GetList()) { string Message = ""; if (node.Type.Equals("ROBOT")) { Transaction txn = new Transaction(); txn.Method = Transaction.Command.RobotType.Speed; txn.Value = sp; txn.FormName = "Running"; node.SendCommand(txn, out Message); } else if (node.Type.Equals("ALIGNER")) { Transaction txn = new Transaction(); txn.Method = Transaction.Command.AlignerType.Speed; txn.Value = sp; txn.FormName = "Running"; node.SendCommand(txn, out Message); } } }
public LoadPortState(string name) { Node robot = NodeManagement.Get(name); this.Name = name; this.State = "".PadLeft(20); }
private void CountDown(object obj) { while (true) { while (countDownSecs <= -1) { SpinWait.SpinUntil(() => countDownSecs > -1, 99999999); } CountDownUpdate(countDownSecs.ToString()); countDownSecs--; if (countDownSecs == -1) {//Reconnect all eqp foreach (Node each in NodeManagement.GetList()) { if (each.Enable) { each.GetController().Reconnect(); } } FormShow(false); } if (countDownSecs != -1) { SpinWait.SpinUntil(() => false, 1000); } } }
private void FormWafer_Layout(object sender, LayoutEventArgs e) { WaferList_tv.Nodes.Clear(); Position_cb.Items.Clear(); foreach (Node node in NodeManagement.GetList()) { if (!node.Type.Equals("OCR")) { TreeNode each = new TreeNode(node.Name); Position_cb.Items.Add(node.Name); List <Job> jobList = node.JobList.Values.ToList(); jobList.Sort((x, y) => { return(Convert.ToInt16(x.Slot).CompareTo(Convert.ToInt16(y.Slot))); }); foreach (Job j in jobList) { if (JobManagement.Get(j.Job_Id) != null) { each.Nodes.Add(j.Job_Id, j.Job_Id + "(Slot-" + j.Slot + ")"); } } WaferList_tv.Nodes.Add(each); } } }
private void Node_Disable_Click(object sender, EventArgs e) { string NodeName = (sender as CheckBox).Name.Replace("_disable_ck", ""); Node node = NodeManagement.Get(NodeName); node.SetEnable(!((sender as CheckBox).Checked)); }
/// <summary> /// Helper function to build a NodePool object. /// InitialNodeCount will default to 1. /// MaximumNodesToScaleTo have to be greater than MinimumNodesToScaleTo, which defaults to 1. /// </summary> /// <param name="name">The name of the node pool.</param> /// <param name="config">The config of the node pool.</param> /// <param name="initialNodeCount">The number of nodes created in the pool initially.</param> /// <param name="autoUpgrade">If true, nodes will have auto-upgrade enabled.</param> /// <param name="minimumNodesToScaleTo">The maximum number of nodes to scale to.</param> /// <param name="maximumNodesToScaleTo"> /// The minimum number of nodes to scale to. Defaults to 1. /// </param> /// <returns></returns> protected NodePool BuildNodePool(string name, NodeConfig config, int?initialNodeCount, bool autoUpgrade, int?minimumNodesToScaleTo, int?maximumNodesToScaleTo) { var nodePool = new NodePool() { Name = name, InitialNodeCount = initialNodeCount ?? 1, Config = config }; if (maximumNodesToScaleTo != null) { nodePool.Autoscaling = BuildAutoscaling(maximumNodesToScaleTo, minimumNodesToScaleTo); } if (autoUpgrade) { var nodeManagement = new NodeManagement() { AutoUpgrade = true }; nodePool.Management = nodeManagement; } return(nodePool); }
public static void UpdateNodesJob(string NodeName) { try { Form form = Application.OpenForms["FormMonitoring"]; if (form == null) { return; } Node node = NodeManagement.Get(NodeName); for (int i = 1; i <= Tools.GetSlotCount(node.Type); i++) { UpdateSlot(node, i.ToString()); } } catch { logger.Error("UpdateNodesJob: Update fail."); } }
private void Slot_Click(object sender, EventArgs e) { string[] ary = (sender as Label).Name.Split('_'); if (ary.Length == 3) { string Port = ary[0]; string Slot = ary[2]; Node p = NodeManagement.Get(Port); if (p != null) { Job j; if (p.JobList.TryGetValue(Slot, out j)) { if (j.OCRImgPath.Equals("") && j.OCR_M12_ImgPath.Equals("") && j.OCR_T7_ImgPath.Equals("")) { MessageBox.Show("未找到OCR紀錄"); } else { OCRResult form2 = new OCRResult(j); form2.ShowDialog(); //// open image in default viewer //System.Diagnostics.Process.Start(j.OCRImgPath); } } else { MessageBox.Show("未找到Wafer"); } } } }
public static void UpdateJobMove(string JobId) { try { Form form = Application.OpenForms["FormRunningScreen"]; CheckBox tb; if (form == null) { return; } tb = form.Controls.Find("use_loadport01_ck", true).FirstOrDefault() as CheckBox; if (tb == null) { return; } if (tb.InvokeRequired) { UpdatePresent ph = new UpdatePresent(UpdateJobMove); tb.BeginInvoke(ph, JobId); } else { Job Job = JobManagement.Get(JobId); if (Job != null) { Node LastNode = NodeManagement.Get(Job.LastNode); Node CurrentNode = NodeManagement.Get(Job.Position); if (LastNode != null) { Label present = form.Controls.Find(Job.LastNode + "_Slot_" + Job.LastSlot, true).FirstOrDefault() as Label; if (present != null) { present.Text = "No wafer"; present.BackColor = Color.DimGray; present.ForeColor = Color.White; } } if (CurrentNode != null) { Label present = form.Controls.Find(Job.Position + "_Slot_" + Job.Slot, true).FirstOrDefault() as Label; if (present != null) { present.Text = Job.Host_Job_Id; present.BackColor = Color.Green; present.ForeColor = Color.White; } } } } } catch { logger.Error("UpdateJobMove: Update fail."); } }
private void ResetAll_bt_Click(object sender, EventArgs e) { Transaction Txn; foreach (AlarmInfo eachA in AlarmManagement.GetAll()) { if (!eachA.NeedReset) { AlarmManagement.Remove(eachA); } } //foreach (Node node in NodeManagement.GetList()) //{ // node.State = node.LastState; //} var NodeList = AlarmManagement.GetAll().GroupBy(t => t.NodeName); foreach (var group in NodeList) { string Message = ""; Txn = new Transaction(); Txn.Method = Transaction.Command.RobotType.Reset; Txn.TaskId = ""; //NodeManagement.Get(group.First().NodeName).State = "Alarm"; NodeManagement.Get(group.First().NodeName).SendCommand(Txn, out Message); AlarmManagement.Remove(group.First().NodeName); } //NodeStatusUpdate.UpdateCurrentState("Idle"); AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); }
private static void ReAssign() { try { Form form = Application.OpenForms["FormOCR"]; TabControl tabControl1; if (form == null) { return; } tabControl1 = form.Controls.Find("tabControl1", true).FirstOrDefault() as TabControl; if (tabControl1 == null) { return; } if (tabControl1.InvokeRequired) { ReAssignUI ph = new ReAssignUI(ReAssign); tabControl1.BeginInvoke(ph); } else { tabControl1.TabPages.Clear(); var ocrs = from ocr in NodeManagement.GetList() where ocr.Type.Equals("OCR") select ocr; bool IsCognexInit = false; System.Threading.Thread.Sleep(2000); foreach (Node ocr in ocrs) { switch (ocr.Brand) { case "HST": pCnt++; Process p1 = Process.Start(new ProcessStartInfo("C:/Program Files (x86)/HST Vision/e-Reader8000/VB9BReaderForm.exe", ocr.AdrNo)); //ThreadPool.QueueUserWorkItem(new WaitCallback(LoadHST), ocr); break; case "COGNEX": if (!IsCognexInit) { pCnt++; IsCognexInit = true; Process p2 = Process.Start(new ProcessStartInfo("C:/Program Files (x86)/Cognex/In-Sight/In-Sight Explorer Wafer 4.5.0/WaferID.exe")); //ThreadPool.QueueUserWorkItem(new WaitCallback(LoadCOGNEX), ocr); } //ControllerManagement.Get(ocr.Controller).Connect(); break; } } } } catch (Exception e) { logger.Error(e.StackTrace); } }
public void On_Node_Connection_Changed(string NodeName, string Status) { ConnectionStatusUpdate.UpdateControllerStatus(NodeName, Status); Node node = NodeManagement.Get(NodeName); logger.Debug("On_Node_Connection_Changed"); }
private void ResetAll_bt_Click(object sender, EventArgs e) { var NodeList = ((List <AlarmInfo>)AlarmList_gv.DataSource).ToList().GroupBy(t => t.NodeName); foreach (var group in NodeList) { NodeManagement.Get(group.First().NodeName).SendCommand(new Transaction(new List <Job>(), "", "", Transaction.Command.RobotType.Reset, "", 300000)); } }
private void OCR02ReadT7_Tb_MouseDoubleClick(object sender, MouseEventArgs e) { string Message = ""; Transaction t = new Transaction(); Node ocr2 = NodeManagement.Get("OCR02"); t.Method = Transaction.Command.OCRType.ReadConfig; t.Value = "1"; ocr2.SendCommand(t, out Message); }
private void Ocr1_lb_MouseDoubleClick(object sender, MouseEventArgs e) { string Message = ""; Transaction t = new Transaction(); Node ocr1 = NodeManagement.Get("OCR01"); t.Method = Transaction.Command.OCRType.Read; ocr1.SendCommand(t, out Message); }
private void ChangeNodeConnectionStatus(string status) { var Nodes = from each in NodeManagement.GetList() where each.Controller.Equals(this.Name) select each; foreach (Node eachNode in Nodes) { eachNode.ConnectionStatus = status; } }
public void getStatus() { StateUtil.Init(); foreach (Node each in NodeManagement.GetList()) { string Message = ""; try { IController Ctrl = ControllerManagement.Get(each.Controller); //string ctrl_status = ControllerManagement.Get(each.Controller).Status; string ctrl_status = ControllerManagement.Get(each.Controller) != null?ControllerManagement.Get(each.Controller).GetStatus() : ""; if (ctrl_status.Equals("Connected") && each.ByPass == false) { string seq = ""; Transaction txn = new Transaction(); if (each.Brand.ToUpper().Equals("KAWASAKI")) { seq = Ctrl.GetNextSeq(); } else { seq = ""; } switch (each.Type) { case "ROBOT": txn.Method = Transaction.Command.RobotType.GetStatus; break; case "ALIGNER": txn.Method = Transaction.Command.AlignerType.GetStatus; break; case "LOADPORT": txn.Method = Transaction.Command.LoadPortType.ReadStatus; break; } txn.FormName = "FormStatus"; txn.AdrNo = each.AdrNo; txn.Seq = seq; if (!txn.Method.Equals("")) { each.SendCommand(txn, out Message); } } } catch (Exception e) { logger.Error(e.StackTrace); } } }
private void use_loadport_ck_CheckedChanged(object sender, EventArgs e) { string LoadportName = ((CheckBox)sender).Name.Replace("use_", "").Replace("_ck", "").ToUpper(); Node port = NodeManagement.Get(LoadportName); if (((CheckBox)sender).Checked) { SelectLoadports.Add(port); if (SelectLoadports.Count >= 2) { if (!use_loadport01_ck.Checked) { use_loadport01_ck.Enabled = false; } if (!use_loadport02_ck.Checked) { use_loadport02_ck.Enabled = false; } if (!use_loadport03_ck.Checked) { use_loadport03_ck.Enabled = false; } if (!use_loadport04_ck.Checked) { use_loadport04_ck.Enabled = false; } } } else { SelectLoadports.Remove(port); if (SelectLoadports.Count < 2) { if (!use_loadport01_ck.Checked) { use_loadport01_ck.Enabled = true; } if (!use_loadport02_ck.Checked) { use_loadport02_ck.Enabled = true; } if (!use_loadport03_ck.Checked) { use_loadport03_ck.Enabled = true; } if (!use_loadport04_ck.Checked) { use_loadport04_ck.Enabled = true; } } } }
private void RefreshMap() { fromPort = ""; fromSlot = ""; toPort = ""; toSlot = ""; Form form = this; foreach (Node p in NodeManagement.GetLoadPortList())//更新所有目的地slot被選的狀態 { if (p.Enable && p.IsMapping) { foreach (Job eachSlot in p.JobList.Values) { if (!eachSlot.MapFlag && !eachSlot.ErrPosition)//找到空slot { Label present = form.Controls.Find(p.Name + "_Slot_" + eachSlot.Slot, true).FirstOrDefault() as Label; if (present != null) { if (eachSlot.ReservePort.Equals("") && eachSlot.ReserveSlot.Equals("")) {//沒被選 present.BackColor = Color.DimGray; present.ForeColor = Color.White; } else {//已被選 present.BackColor = Color.Brown; present.ForeColor = Color.White; } } } if (eachSlot.MapFlag && !eachSlot.ErrPosition)//找到wafer { Label present = form.Controls.Find(p.Name + "_Slot_" + eachSlot.Slot, true).FirstOrDefault() as Label; if (present != null) { if (!eachSlot.Destination.Equals("") && !eachSlot.DestinationSlot.Equals("") /*&& (!eachSlot.Destination.Equals(eachSlot.Position) && !eachSlot.DestinationSlot.Equals(eachSlot.Slot))*/) {//已被選 present.BackColor = Color.Brown; present.ForeColor = Color.White; } else {//沒被選 present.BackColor = Color.Green; present.ForeColor = Color.White; } } } } } } }
public void Excute(object input) { TaskFlowManagement.CurrentProcessTask TaskJob = (TaskFlowManagement.CurrentProcessTask)input; if (TaskJob.TaskName != TaskFlowManagement.Command.CCLINK_GET_IO && TaskJob.TaskName != TaskFlowManagement.Command.CCLINK_SET_IO) { logger.Debug("ITaskFlow:" + TaskJob.TaskName.ToString() + " Index:" + TaskJob.CurrentIndex.ToString()); } if (TaskJob.CurrentIndex == 0 && TaskJob.TaskName.ToString().IndexOf("CCLINK") == -1) { _TaskReport.On_Message_Log("CMD", TaskJob.TaskName.ToString() + " " + (TaskJob.Params.ContainsKey("@Target") ? TaskJob.Params["@Target"] : "") + " Executing"); } string Message = ""; Node Target = null; Node Position = null; string tmp = ""; string Value = ""; if (TaskJob.Params != null) { foreach (KeyValuePair <string, string> item in TaskJob.Params) { switch (item.Key) { case "@Target": Target = NodeManagement.Get(item.Value); break; case "@Position": Position = NodeManagement.Get(item.Value); break; case "@Value": Value = item.Value; break; } } } try { switch (TaskJob.TaskName) { } } catch (Exception e) { logger.Error("Excute fail Task Name:" + TaskJob.TaskName.ToString() + " " + (TaskJob.Params.ContainsKey("@Target") ? TaskJob.Params["@Target"] : "") + " exception: " + e.StackTrace); AbortTask(TaskJob, NodeManagement.Get("SYSTEM"), e.StackTrace); return; } return; }
public AlignerState(string name) { Node aligner = NodeManagement.Get(name); this.Name = name; this.Status = aligner != null ? aligner.State : "N/A"; this.State = "".PadLeft(32); this.Present = ""; this.Vacuum = ""; this.Speed = ""; this.Mode = ""; this.Error = ""; }
private void Unload_btn(object sender, EventArgs e) { string PortName = ((Button)sender).Name.Substring(0, ((Button)sender).Name.IndexOf("_")); Node port = NodeManagement.Get(PortName); if (port == null) { MessageBox.Show(PortName + " not found"); } if (port.Enable) { FoupInfo foup = FoupInfo.Get(port.Name); if (foup != null) { foup.SetAllUnloadTime(DateTime.Now); } else { foup = new Adam.FoupInfo(SystemConfig.Get().CurrentRecipe, Global.currentUser, port.FoupID); foreach (Job j in port.JobList.Values) { if (j.MapFlag && !j.ErrPosition) { int slot = Convert.ToInt16(j.Slot); foup.record[slot - 1] = new Adam.waferInfo(port.Name, port.FoupID, j.Slot, j.FromPort, j.FromFoupID, j.FromPortSlot, j.ToPort, j.ToFoupID, j.ToPortSlot); foup.record[slot - 1].SetStartTime(j.StartTime); foup.record[slot - 1].setM12(j.OCR_M12_Result); foup.record[slot - 1].setT7(j.OCR_T7_Result); foup.record[slot - 1].SetEndTime(j.EndTime); foup.record[slot - 1].SetLoadTime(port.LoadTime); foup.record[slot - 1].SetUnloadTime(DateTime.Now); foup.record[slot - 1].setM12Score(j.OCR_M12_Score); foup.record[slot - 1].setT7Score(j.OCR_T7_Score); } } } foup.Save(); ((Button)sender).Enabled = false; string TaskName = "LOADPORT_CLOSE_NOMAP"; string Message = ""; Dictionary <string, string> param1 = new Dictionary <string, string>(); param1.Add("@Target", port.Name); TaskJobManagment.CurrentProceedTask tmpTask; RouteControl.Instance.TaskJob.Excute(Guid.NewGuid().ToString() + "Unload_btn", out Message, out tmpTask, TaskName, param1); } else { MessageBox.Show(PortName + " is disabled"); } }
private void UnAssignPort(object sender, EventArgs e) { if ((CurrentSelected as DataGridView).SelectedRows.Count == 0) { MessageBox.Show("請選擇來源Slot"); } else if ((CurrentSelected as DataGridView).SelectedRows.Count == 1) { string waferId = (CurrentSelected as DataGridView).SelectedRows[0].Cells["Job_Id"].Value.ToString(); string OrgDest = (CurrentSelected as DataGridView).SelectedRows[0].Cells["Destination"].Value.ToString(); string OrgDestSlot = (CurrentSelected as DataGridView).SelectedRows[0].Cells["DestinationSlot"].Value.ToString(); Job wafer = JobManagement.Get(waferId); if (wafer != null) { wafer.UnAssignPort(); wafer.NeedProcess = false; //wafer.Position = PortName; if (!OrgDest.Equals("")) { NodeManagement.Get(OrgDest).RemoveReserve(OrgDestSlot); } (CurrentSelected as DataGridView).Refresh(); } else { MessageBox.Show("找不到此Wafer資料:" + wafer.Job_Id); } } else if ((CurrentSelected as DataGridView).SelectedRows.Count > 1) { foreach (DataGridViewRow each in (CurrentSelected as DataGridView).SelectedRows) { string waferId = each.Cells["Job_Id"].Value.ToString(); string OrgDest = each.Cells["Destination"].Value.ToString(); string OrgDestSlot = each.Cells["DestinationSlot"].Value.ToString(); Job wafer = JobManagement.Get(waferId); if (wafer != null) { wafer.UnAssignPort(); wafer.NeedProcess = false; if (!OrgDest.Equals("")) { NodeManagement.Get(OrgDest).RemoveReserve(OrgDestSlot); } } } (CurrentSelected as DataGridView).Refresh(); MonitoringUpdate.UpdateNodesJob((CurrentSelected as DataGridView).Name.Replace("Assign_Gv", "")); } }
private Node SearchLoadport() { Node result = null; var AvailableWafers = from job in JobManagement.GetJobList() where job.NeedProcess orderby job.AssignTime select job; if (AvailableWafers.Count() != 0) { result = NodeManagement.Get(AvailableWafers.First().Position); } return(result); }
private void LoadPort_FoupID_TextChanged(object sender, EventArgs e) { string PortName = (sender as TextBox).Name.Replace("_FoupID", ""); Node port = NodeManagement.Get(PortName); if (port != null) { port.FoupID = (sender as TextBox).Text; } else { MessageBox.Show("Port " + PortName + " not found."); } }
private void toolStripMenuItem5_Click(object sender, EventArgs e) { string strMsg = "Move to Home position. OK?"; if (MessageBox.Show(strMsg, "Org.Back", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.OK) { string Message = ""; Transaction txn = new Transaction(); txn.Method = Transaction.Command.RobotType.Home; NodeManagement.Get("Robot01").SendCommand(txn, out Message); txn = new Transaction(); txn.Method = Transaction.Command.RobotType.Home; NodeManagement.Get("Robot02").SendCommand(txn, out Message); } }
public void SetReport(ICommandReport ReportTarget) { _ReportTarget = ReportTarget; _Decoder = new CommandConvert.CommandDecoder(Vendor); Encoder = new CommandEncoder(Vendor); this.Name = DeviceName; this.Status = ""; ThreadPool.QueueUserWorkItem(new WaitCallback(Start), NodeManagement.Get("CSTROBOT")); }