Exemplo n.º 1
0
        /// <summary>
        /// Log 생성
        /// </summary>
        public void subInitialLog()
        {
            try
            {
                if (pInfo.All.LogUseThread == true)
                {
                    pThreadDateCheck              = new Thread(new ThreadStart(ThreadLogDateCheck));
                    pThreadDateCheck.Name         = string.Format("ThreadLogDateCheck");
                    pThreadDateCheck.IsBackground = true;
                    pThreadDateCheck.Start();
                }
                else
                {
                    ptmrDateCheck          = new System.Windows.Forms.Timer();
                    ptmrDateCheck.Tick    += new EventHandler(DateCheck_Tick);
                    ptmrDateCheck.Interval = 10000;
                    ptmrDateCheck.Enabled  = true;
                }

                pstrLogFilesPath = pInfo.All.LogFilePath;

                plogPLC = new clsNLogGroup(pstrLogFilesPath, "PLC", clsInfo.LogType.PLC);
                plogCIM = new clsNLogGroup(pstrLogFilesPath, "CIM", clsInfo.LogType.CIM);

                plogAlarmGlassInfo = new clsNLogGeneral(pstrLogFilesPath, "AlarmGLSInfo", clsInfo.LogType.AlarmGLSInfo);
                plogOPCallMsg      = new clsNLogGeneral(pstrLogFilesPath, "OPCallMSG", clsInfo.LogType.OPCallMSG);
                plogPLCError       = new clsNLogGroup(pstrLogFilesPath, "PLCError", clsInfo.LogType.PLCError);
                plogScrap          = new clsNLogGeneral(pstrLogFilesPath, "Scrap", clsInfo.LogType.ScrapUnScrapAbort);
                plogGlassInOut     = new clsNLogGeneral(pstrLogFilesPath, "GLSInOut", clsInfo.LogType.GLSInOut);
                plogGlassAPD       = new clsNLogGeneral(pstrLogFilesPath, "GLSPDC", clsInfo.LogType.GLSPDC);
                plogLotAPD         = new clsNLogGeneral(pstrLogFilesPath, "LOTPDC", clsInfo.LogType.LOTPDC);
                plogAlarm          = new clsNLogGeneral(pstrLogFilesPath, "Alarm", clsInfo.LogType.Alarm);
                plogParameter      = new clsNLogGeneral(pstrLogFilesPath, "Parameter", clsInfo.LogType.Parameter);
                plogSEM            = new clsNLogGeneral(pstrLogFilesPath, "SEM", clsInfo.LogType.SEM);
                this.pfrmLogView   = new frmLogView();

                //if (this.pInfo.EQP("Main").DummyPLC)
                //{
                //this.pfrmDataView = new frmDataView();
                //this.pfrmDataView.subFormLoad();
                //}
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 초기화시 "PLCLOG" 폴더가 없으면 생성하고 로그 출력 Timer 생성
        /// </summary>
        /// <remarks>
        /// 최초 프로그램 로딩시 한번만 수행됨
        /// 2006/10/25  김효주  [L 00]
        /// </remarks>
        public void subInitialLog()
        {
            string dstrIPAddress  = "192.169.1.1";
            string dstrPortNumber = "21";

            try
            {
                DirectoryInfo dir = new DirectoryInfo(pstrLogFilesPath);     //PLCLOG 폴더가 없으면 생성한다.
                dir.Create();

                this.pfrmLogView       = new frmLogView();
                this.pfrmLogView.PInfo = this.PInfo;

                this.pfrmDataView       = new frmDataView();
                this.pfrmDataView.PInfo = this.PInfo;
                this.pfrmDataView.subFormLoad();



                // hashtable 준비

                subInitLogFileInfoHash();


                //FTP 객체 생성     //추가 : 20101001 이상호
                pFTP       = new InfoAct.clsFTP_Client(dstrIPAddress + ":" + dstrPortNumber, "", "");
                pFTP.PInfo = this.PInfo;

                //PLC Log Tick Timer 설정
                this.ptmrLogWrite          = new System.Windows.Forms.Timer();
                this.ptmrLogWrite.Tick    += new EventHandler(LogWrite_Tick);
                this.ptmrLogWrite.Interval = 500;      //500ms
                this.ptmrLogWrite.Enabled  = true;
                GC.KeepAlive(this.ptmrLogWrite);

                //MMC Log Tick Timer 설정
                this.ptmrMCCLogUpdate          = new System.Windows.Forms.Timer();
                this.ptmrMCCLogUpdate.Tick    += new EventHandler(MCCLogUpdate_Tick);
                this.ptmrMCCLogUpdate.Interval = 1000;      //500ms
                this.ptmrMCCLogUpdate.Enabled  = true;
                GC.KeepAlive(this.ptmrMCCLogUpdate);
            }
            catch (Exception ex)
            {
                this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }