private bool LoadDisplay()
        {
            RemoteEventArgs arg = null;

            if (RecieveQ.Count > 0)
            {
                lock (RecieveQ)
                {
                    while (RecieveQ.Count > 0)
                    {
                        arg = RecieveQ.Dequeue();
                        NetRemoting.Recieve(this, arg);
                        //Program.form1.
                        //Console.WriteLine(arg);
                    }
                }
                return(false);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        private void timer_Check_Tick(object sender, EventArgs e)
        {
            DataSet ds;
            string  TAG_ID = "";
            string  V_Mode = "";

            try
            {
                if ((EquipInfo._Frm != "" && EquipInfo._BFrm != "") && (EquipInfo._Frm != EquipInfo._BFrm))
                {
                    slog = DateTime.Now + "[mdiMain 폼 닫기] :      " + EquipInfo._BFrm;
                    Global.EquipInfo.fhLog.TextFileWriteAppend(slog);
                    _frmLoad.Close();
                    FormLoad();
                }

                if (EquipInfo.Date_Time.Day != DateTime.Now.Day)
                {
                    EquipInfo.fhLog = new Filehandle("./LOG/" + DateTime.Now.Year + "_" + DateTime.Now.Month + "/LOG" + DateTime.Now.Year + "_" + DateTime.Now.Month + "_" + DateTime.Now.Day + ".TXT");
                    //EquipInfo.fh_Err_Log = new Filehandle("./Err_LOG/" + DateTime.Now.Year + "_" + DateTime.Now.Month + "/Err_LOG" + DateTime.Now.Year + "_" + DateTime.Now.Month + "_" + DateTime.Now.Day + ".TXT");

                    EquipInfo.Date_Time = DateTime.Now;
                }

                if (EquipInfo.WORKCENTER.Substring(0, 3) == "CPM" || EquipInfo.WORKCENTER.Substring(0, 3) == "FEM")
                {
                    OKNG    = NetRemoting.TagGet(EquipInfo.WORKCENTER + "_" + EquipInfo.ROUTE_NO + "_OKNG");
                    PLC_END = NetRemoting.TagGet(EquipInfo.WORKCENTER + "_" + EquipInfo.ROUTE_NO + "_PLC_END");
                    END     = NetRemoting.TagGet(EquipInfo.WORKCENTER + "_" + EquipInfo.ROUTE_NO + "_END");

                    if (OKNG == "0000")
                    {
                        lbl_PLC_Ok.BackColor = Color.GreenYellow;
                    }
                    else
                    {
                        lbl_PLC_Ok.BackColor = Color.Red;
                    }

                    if (PLC_END == "0001")
                    {
                        lbl_PLC_End.BackColor = Color.GreenYellow;
                    }
                    else
                    {
                        lbl_PLC_End.BackColor = Color.Red;
                    }

                    if (END == "0001")
                    {
                        lbl_End.BackColor = Color.GreenYellow;
                        // 작업표준서 추가 - 유민호
                        if (!open && EquipInfo.Msg_Off == true && EquipInfo.BoardFlag == false && EquipInfo.Auto_Flag == true)
                        {
                            open = true;
                            EquipInfo.BoardFlag = false;

                            btn_workboard_Click(null, null);
                        }
                    }
                    else
                    {
                        lbl_End.BackColor = Color.Red;

                        // 작업표준서 추가 - 유민호
                        if (open)
                        {
                            open = false;
                            frmWorkBoadrClose();
                            EquipInfo.BoardFlag = false;
                        }
                    }
                }

                /*
                 * else if (EquipInfo.WORKCENTER.Substring(0, 3) != "CPM" || EquipInfo.WORKCENTER.Substring(0, 3) != "FEM")
                 * {
                 *  END = NetRemoting.TagGet(EquipInfo.WORKCENTER + "_" + EquipInfo.ROUTE_NO + "_END");
                 *
                 *  if (END == "0001")
                 *  {
                 *      lbl_End.BackColor = Color.GreenYellow;
                 *      // 작업표준서 추가 - 유민호
                 *      if (!open && EquipInfo.Msg_Off == true)
                 *      {
                 *          open = true;
                 *          btn_workboard_Click(null, null);
                 *      }
                 *  }
                 *  else
                 *  {
                 *      lbl_End.BackColor = Color.Red;
                 *      if (open && EquipInfo.SubFalg == false)
                 *      {
                 *          open = false;
                 *          EquipInfo.SubFalg = false;
                 *          frmWorkBoadrClose();
                 *      }
                 *  }
                 * }
                 * */
                lbl_Day.Text  = DateTime.Now.ToString("yyyy-MM-dd");
                lbl_Time.Text = DateTime.Now.ToString("HH:mm:ss");

                if (NetRemoting.State() == true)
                {
                    lbl_TagServer.BackColor = Color.GreenYellow;
                }
                else
                {
                    lbl_TagServer.BackColor = Color.Red;
                }

                if (ivizConn.DatabaseConnect() == true)
                {
                    if (EquipInfo.WORKCENTER.Substring(0, 3) == "CPM" || EquipInfo.WORKCENTER.Substring(0, 3) == "FEM")
                    {
                        ds = new DataSet();
                        Procedure.PPC_VW_LINETRK(EquipInfo.WORKCENTER, EquipInfo.ROUTE_NO, ref ds);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            TAG_ID = ds.Tables[0].Rows[0]["TAG_ID"].ToString();

                            if (TAG_ID != "")
                            {
                                lbl_Skid.Text      = "스키드 ON";
                                lbl_Skid.ForeColor = Color.YellowGreen;
                            }
                            else
                            {
                                lbl_Skid.Text      = "스키드 OFF";
                                lbl_Skid.ForeColor = Color.Red;
                            }
                        }
                        ds.Dispose();
                    }

                    lbl_DB.BackColor = Color.GreenYellow;

                    if (EquipInfo.WORKCENTER.Substring(0, 3) == "CPM" || EquipInfo.WORKCENTER.Substring(0, 3) == "FEM")
                    {
                        ds = new DataSet();
                        Procedure.PPC_ASSY_WAIT_CNT(EquipInfo.WORKCENTER, ref ds);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            lbl_Wait_Cnt.Text = ds.Tables[0].Rows[0]["ASSY_WAIT_CNT"].ToString();
                        }
                        else
                        {
                            lbl_Wait_Cnt.Text = "0";
                        }
                    }
                }
                else
                {
                    lbl_DB.BackColor = Color.Red;
                    //ivizConn.DatabaseConnect();
                }
                //가상서열 모드 체크
                ds = new DataSet();
                Procedure.PPC_LINE_INFO(EquipInfo.WORKCENTER, EquipInfo.ROUTE_NO, ref ds);
                V_Mode = ds.Tables[0].Rows[0]["V_MODE"].ToString().Trim();

                if (EquipInfo._Frm == "frmWork_Start_CPM" || EquipInfo._Frm == "frmWork" || EquipInfo._Frm == "frmWork_Start_FEM")
                {
                    if (V_Mode == "Y")
                    {
                        EquipInfo.Virtual = true;
                    }
                    else
                    {
                        EquipInfo.Virtual = false;
                    }
                }
                ds.Dispose();
            }
            catch (Exception ex)
            {
                slog = DateTime.Now + "[mdiMain] :      " + ex;
                Global.EquipInfo.fh_Err_Log.TextFileWriteAppend(slog);
            }
        }