123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- namespace FPER
- {
- // cyim 2013.9.26 중계기차단 보완 : 화면에 정리된 리스트를 출력하기 위하여 전역으로 저장함
- // 차단의 경우 결국 속도가 오래걸린다. 또한 여기에서 정보가 다시 재저장되므로 이 정보를 이용하여 MDIParent.cs 에서 차단을 클릭하면 새로운 폼에서
- // 리스트의 정보를 출력하도록 유도한다
- // 표시될 정보는 예시는 아래와 같다
- // 날짜 - 통신보드[1] LOOP0 중계기[11] 회로[1] 타입[I] 차단
- // 날짜 - 통신보드[3] LOOP0 중계기[12] 차단
- public partial class Form_Popup_CutInfo : Form
- {
- // 크로스 스레드 처리
- public delegate void SetList_Callback(ArrayList Data);
- public delegate void SetForm_Callback(Form Data);
- // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- MDIParent mdi = null;
- // 생성자
- public Form_Popup_CutInfo(MDIParent mdiparent)
- {
- InitializeComponent();
- // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- mdi = mdiparent;
- // 폼로드 이벤트 핸들러 등록
- this.Load += new EventHandler(Form_Popup_OtherFireAlarm_Load);
- // 폼닫기 이벤트 핸들러 등록
- this.FormClosing += new FormClosingEventHandler(Form_Popup_OtherFireAlarm_FormClosing);
- // 팝업창 갱신 이벤트 핸들러
- mdi.Event.CutInfoPopup_Update_Inform_Event += new _Event.CutInfoPopup_Update_Handler(_Event_CutInfoPopup_Update_Inform_Event); // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- }
- // 폼로드
- public void Form_Popup_OtherFireAlarm_Load(object sender, EventArgs e)
- {
- // 활성화
- mdi.Popup.Form_Popup_CutInfo_Enable = true; // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- // 갱신
- _Event_CutInfoPopup_Update_Inform_Event();
- }
- // 폼닫기
- public void Form_Popup_OtherFireAlarm_FormClosing(object sender, FormClosingEventArgs e)
- {
- // 숨김
- this.Hide();
- // 비활성화
- mdi.Popup.Form_Popup_CutInfo_Enable = false; // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- // 이벤트 핸들러 해제
- mdi.Event.CutInfoPopup_Update_Inform_Event -= new _Event.CutInfoPopup_Update_Handler(_Event_CutInfoPopup_Update_Inform_Event); // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- }
- // 팝업창 갱신 이벤트 핸들러
- public void _Event_CutInfoPopup_Update_Inform_Event()
- {
- // 리스트 갱신
- Listview_Fire_Display(mdi.Popup.Form_Popup_CutInfo_List); // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- // 화면 업데이트
- Form_Update(this);
- }
- // ListView : 차단 리스트
- public void Listview_Fire_Display(ArrayList Data)
- {
- if (this.listView_CutList.InvokeRequired)
- {
- SetList_Callback d = new SetList_Callback(Listview_Fire_Display);
- this.listView_CutList.Invoke(d, new object[] { Data });
- }
- else
- {
- this.listView_CutList.Items.Clear();
- if (Data != null)
- {
- // 인덱스가 작은것이 제일 오래된 데이타이므로 역순으로 출력시킨다
- for (int i = 1; i <= Data.Count; i++)
- {
- Listview_AddItem(i, (EventLogInfo)Data[i - 1]);
- }
- }
- }
- }
- // 화재리스트 항목 추가
- public void Listview_AddItem(int order, EventLogInfo Data)
- {
- // No, 항목 (Data.Message)
- string[] data = { " " + order.ToString(), /*Data.EventTime.ToString("yyyy-MM-dd HH:mm:ss"),*/ Data.Message };
- ListViewItem item = new ListViewItem(data);
- item.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold);
- listView_CutList.Items.Add(item);
- }
- // 폼업데이트
- public void Form_Update(Form Data)
- {
- if (this.InvokeRequired)
- {
- SetForm_Callback d = new SetForm_Callback(Form_Update);
- this.Invoke(d, new object[] { Data });
- }
- else
- {
- this.Update();
- }
- }
- }
- }
|