Beispiel #1
0
        public static void UpdateJobMove(string JobId)
        {
            try
            {
                Form    form = Application.OpenForms["FormWaferMapping"];
                TextBox tb;

                if (form == null)
                {
                    return;
                }

                tb = form.Controls.Find("LoadPort01_FID", true).FirstOrDefault() as TextBox;

                if (tb == null)
                {
                    return;
                }

                if (tb.InvokeRequired)
                {
                    UpdatePortMapping ph = new UpdatePortMapping(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.");
            }
        }
Beispiel #2
0
        public static void RefreshMapping(string PortName)
        {
            try
            {
                Form         form = Application.OpenForms["FormWaferMapping"];
                DataGridView Port_gv;
                if (form == null)
                {
                    return;
                }

                Port_gv = form.Controls.Find(PortName + "Assign_Gv", true).FirstOrDefault() as DataGridView;
                if (Port_gv == null)
                {
                    return;
                }

                if (Port_gv.InvokeRequired)
                {
                    UpdatePortMapping ph = new UpdatePortMapping(RefreshMapping);
                    Port_gv.BeginInvoke(ph, PortName);
                }
                else
                {
                    Node port = NodeManagement.Get(PortName);

                    foreach (Job each in port.JobList.Values.ToList())
                    {
                        each.RecipeID = "300MM";
                    }

                    List <Job> tmp = port.JobList.Values.ToList();
                    tmp.Sort((x, y) => { return(-Convert.ToInt16(x.Slot).CompareTo(Convert.ToInt16(y.Slot))); });
                    Port_gv.DataSource                          = tmp;
                    Port_gv.Columns["Slot"].Width               = 25;
                    Port_gv.Columns["Slot"].HeaderText          = "S";
                    Port_gv.Columns["Host_Job_Id"].Width        = 75;
                    Port_gv.Columns["DisplayDestination"].Width = 55;
                    Port_gv.Columns["DestinationSlot"].Width    = 30;
                    Port_gv.Columns["Offset"].Visible           = false;
                    Port_gv.Columns["Angle"].Visible            = false;
                    Port_gv.Columns["Job_Id"].Visible           = false;
                    Port_gv.Columns["Destination"].Visible      = false;
                    Port_gv.Columns["ProcessFlag"].Visible      = false;
                    //Port_gv.Columns["Piority"].Visible = false;
                    Port_gv.Columns["AlignerFlag"].Visible     = false;
                    Port_gv.Columns["OCRFlag"].Visible         = false;
                    Port_gv.Columns["AlignerFinished"].Visible = false;
                    Port_gv.Columns["OCRFinished"].Visible     = false;
                    Port_gv.Columns["Position"].Visible        = false;
                    Port_gv.Columns["FromPort"].Visible        = false;
                    Port_gv.Columns["LastNode"].Visible        = false;
                    Port_gv.Columns["CurrentState"].Visible    = false;
                    Port_gv.Columns["WaitToDo"].Visible        = false;
                    //Port_gv.Columns["FetchRobot"].Visible = false;
                    Port_gv.Columns["ProcessNode"].Visible           = false;
                    Port_gv.Columns["MapFlag"].Visible               = false;
                    Port_gv.Columns["DisplayDestination"].HeaderText = "Dest";
                    Port_gv.Columns["DestinationSlot"].HeaderText    = "DS";
                    Port_gv.Columns["Host_Job_Id"].HeaderText        = "ID";
                    Port_gv.ColumnHeadersDefaultCellStyle.Font       = new Font("Arial", 10);
                    Port_gv.Columns["NeedProcess"].Visible           = false;
                    Port_gv.Columns["OCRImgPath"].Visible            = false;
                    Port_gv.Columns["OCRScore"].Visible              = false;
                    Port_gv.Columns["LastSlot"].Visible              = false;
                    Port_gv.Columns["FromPortSlot"].Visible          = false;
                    Port_gv.Columns["AssignTime"].Visible            = false;
                    Port_gv.Columns["DefaultOCR"].Visible            = false;
                    Port_gv.Columns["RecipeID"].Visible              = false;
                    Port_gv.Columns["ErrPosition"].Visible           = false;
                    Port_gv.Columns["InProcess"].Visible             = false;
                    Port_gv.Columns["Host_Lot_Id"].Visible           = false;
                    //MonitoringUpdate.UpdateNodesJob(PortName);
                }
            }
            catch (Exception e)
            {
                logger.Error("UpdateLoadPortMapping: Update fail:" + e.StackTrace);
            }
        }