Esempio n. 1
0
        public Form1()
        {
            L4Logger l4Logger = new L4Logger("common.log");

            l4Logger.Add("App Started!");
            l4Logger.Close();

            InitializeComponent();

            // 프로그램 실행시 fwjournal.ini의 첫 주소를 선택한 걸로 셋팅
            InitializeToolBar();

            // 현재주소 메뉴
            InitializeContextMenuStripAddress();

            // 수집옵션 메뉴
            InitializeContextMenuStripCrawlOption();

            InitializeDIManager();
            // RunCrawlAndCheck();
            aTimer           = new System.Timers.Timer(60000);
            aTimer.Elapsed  += OnTimedEvent;
            aTimer.AutoReset = true;
            aTimer.Enabled   = true;

            // 로그파일 출력
            loManagerForCommon  = new LogOutputManager("common", textBoxCommonLog);
            loManagerForAddress = new LogOutputManager("f0", textBoxPrivateLog);
        }
Esempio n. 2
0
        // 주소 클릭시 이벤트 함수
        void addressItem_Click(object sender, EventArgs e)
        {
            ToolStripItem clickedItem = sender as ToolStripItem;
            AddressLine   tmpAL       = (AddressLine)clickedItem.Tag;

            currentSelectedIndex = tmpAL.IndexNo;

            // 수집 주소
            labelAddr.Text = tmpAL.Address;

            // 수집 간격 옵션
            labelCrawlTerm.Text = "수집간격 - " + UtilManager.ConvertCrawlTerm(tmpAL.CrawlTerm);

            // 수집 상태
            if ("R" == tmpAL.CrawlStatus)
            {
                labelRunStatus.Text = Fonts.fa.recycle + "  " + UtilManager.ConvertCrawlStatus(tmpAL.CrawlStatus);
            }
            else
            {
                labelRunStatus.Text = Fonts.fa.hand_stop_o + "  " + UtilManager.ConvertCrawlStatus(tmpAL.CrawlStatus);
            }

            currentSelectedRunStatus = tmpAL.CrawlStatus;

            // 로그
            loManagerForAddress.StopOutput();
            loManagerForAddress = new LogOutputManager(tmpAL.IndexNo, textBoxPrivateLog);
        }
Esempio n. 3
0
        private void 삭제ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (currentSelectedIndex.Contains("f"))
            {
                // 기본적으로 fwjournal.ini 는 삭제못하도록 함.

                /*
                 * FwjournalIniManager fiManager = new FwjournalIniManager();
                 * fiManager.DeleteAddressByIndexNo(currentSelectedIndex);
                 */
                MessageBox.Show("영농일지 관련 데이터(fwjournal.ini)는 삭제할 수 없습니다");
            }
            else
            {
                // 해당 작업 멈추고 삭제
                JobKey jobKey = JobKey.Create(currentSelectedIndex);
                cManager.schedulerForAddr.PauseJob(jobKey);
                cManager.schedulerForAddr.DeleteJob(jobKey);

                // address.ini 에서 삭제
                AddressIniManager aiManager = new AddressIniManager();
                aiManager.DeleteAddressByIndexNo(currentSelectedIndex);

                // 공통 로그파일에 삭제로그 남기기
                L4Logger l4Logger = new L4Logger("common.log");
                l4Logger.Add(currentSelectedIndex + " is deleted");
                l4Logger.Close();

                // 삭제할 인덱스 저장
                // string indexForDelete = currentSelectedIndex;

                // 현재 주소 리스트 초기화
                InitializeContextMenuStripAddress();

                // 툴바 초기화
                ResetToolBar();

                // 로그 출력창 설정
                loManagerForAddress.StopOutput();
                loManagerForAddress = new LogOutputManager(currentSelectedIndex, textBoxPrivateLog);

                // 개별 로그파일 삭제
                // UtilManager.DeleteLogFile(indexForDelete + ".log");
            }
        }