123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- 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
- {
-
-
-
-
- public partial class Form_Popup_OtherFireAlarm : Form
- {
-
- MDIParent mdi = null;
-
- public delegate void SetText_Callback(string Data);
- public delegate void SetHash_Callback(Hashtable Data);
- public delegate void SetList_Callback(ArrayList Data);
- public delegate void SetForm_Callback(Form Data);
-
-
- public string POPUP_RECEIVER_ID = null;
- public string POPUP_RECEIVER_IP = null;
- public string POPUP_RECEIVER_NAME = null;
-
- public ArrayList LIST_FIRE_INFO = new ArrayList();
-
- public Form_Popup_OtherFireAlarm(string RECEIVER_ID, MDIParent mdiparent)
- {
- InitializeComponent();
- mdi = mdiparent;
-
-
- this.Load += new EventHandler(Form_Popup_OtherFireAlarm_Load);
-
- this.FormClosing += new FormClosingEventHandler(Form_Popup_OtherFireAlarm_FormClosing);
-
- mdi.Event.EtcFirePopup_Update_Inform_Event += new _Event.EtcFirePopup_Update_Handler(_Event_EtcFirePopup_Update_Inform_Event);
-
- POPUP_RECEIVER_ID = RECEIVER_ID;
- }
-
- public void Form_Popup_OtherFireAlarm_Load(object sender, EventArgs e)
- {
- _Event_EtcFirePopup_Update_Inform_Event(POPUP_RECEIVER_ID);
- }
-
- public void Form_Popup_OtherFireAlarm_FormClosing(object sender, FormClosingEventArgs e)
- {
-
- mdi.Event.EtcFirePopup_Update_Inform_Event -= new _Event.EtcFirePopup_Update_Handler(_Event_EtcFirePopup_Update_Inform_Event);
- }
-
- public void _Event_EtcFirePopup_Update_Inform_Event(string RECEIVER_ID)
- {
- try
- {
-
-
-
-
- Label_Receiver_Display(string.Format("ID [{0}] - [{1} , {2}]", POPUP_RECEIVER_ID, POPUP_RECEIVER_NAME, POPUP_RECEIVER_IP));
-
-
- if (LIST_FIRE_INFO.Count == 0)
- {
-
- Label_Fire_Status_1th_Display("");
-
- Label_Fire_Status_2st_Display("");
-
- Listview_Fire_Display(null);
- }
- else
- {
-
- string Recently_FireText = ((_FIRE_LIST)LIST_FIRE_INFO[LIST_FIRE_INFO.Count - 1]).FIRE_TEXT;
- string Recently_FireTime = ((_FIRE_LIST)LIST_FIRE_INFO[LIST_FIRE_INFO.Count - 1]).FIRE_TIME;
- string Recently_FireType = ((_FIRE_LIST)LIST_FIRE_INFO[LIST_FIRE_INFO.Count - 1]).FIRE_TYPE == true ? "화재" : "복구"; ;
-
- Label_Fire_Status_1th_Display(string.Format("{0} 에 {1} 정보 수신되었습니다", Recently_FireTime, Recently_FireType));
-
- Label_Fire_Status_2st_Display(Recently_FireText);
-
- Listview_Fire_Display(LIST_FIRE_INFO);
- }
-
- Form_Update(this);
-
- }
- catch
- { }
- }
-
- public void Label_Receiver_Display(string Data)
- {
- if (this.label_Receiver.InvokeRequired)
- {
- SetText_Callback d = new SetText_Callback(Label_Receiver_Display);
- this.label_Receiver.Invoke(d, new object[] { Data });
- }
- else
- {
- this.label_Receiver.Text = "수신기 : " + Data;
- }
- }
-
- public void Label_Fire_Status_1th_Display(string Data)
- {
- if (this.label_Fire_Status_1th.InvokeRequired)
- {
- SetText_Callback d = new SetText_Callback(Label_Fire_Status_1th_Display);
- this.label_Fire_Status_1th.Invoke(d, new object[] { Data });
- }
- else
- {
- this.label_Fire_Status_1th.Text = "상 태 : " + Data;
- }
- }
-
- public void Label_Fire_Status_2st_Display(string Data)
- {
- if (this.label_Fire_Status_2st.InvokeRequired)
- {
- SetText_Callback d = new SetText_Callback(Label_Fire_Status_2st_Display);
- this.label_Fire_Status_2st.Invoke(d, new object[] { Data });
- }
- else
- {
- this.label_Fire_Status_2st.Text = Data;
- }
- }
-
- public void Listview_Fire_Display(ArrayList pData)
- {
- if (this.listView_FireList.InvokeRequired)
- {
- SetList_Callback d = new SetList_Callback(Listview_Fire_Display);
- this.listView_FireList.Invoke(d, new object[] { pData });
- }
- else
- {
- this.listView_FireList.Items.Clear();
-
- ArrayList Data = (ArrayList)pData.Clone();
-
- if (Data != null && Data.Count != 0)
- {
- if (Data.Count == 1)
- {
- Listview_AddItem((_FIRE_LIST)Data[0]);
- }
- else
- {
-
- for (int i = Data.Count - 1; i > -1; i--)
- {
- Listview_AddItem((_FIRE_LIST)Data[i]);
- }
- }
- }
- }
- }
-
- public void Listview_AddItem(_FIRE_LIST Data)
- {
-
- string temp_type = Data.FIRE_TYPE == true ? "화재" : "복구";
- string[] data = { Data.FIRE_TIME, Data.FIRE_RECEIVERNAME, Data.FIRE_RECEIVERIP, temp_type, Data.FIRE_TEXT };
- ListViewItem item = new ListViewItem(data);
- item.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold);
- listView_FireList.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();
- }
- }
-
- public void button_FirePopupClose_Click(object sender, EventArgs e)
- {
-
- this.Hide();
- }
- internal void Form_Popup_OtherFireAlarm_FormClosing()
- {
- throw new NotImplementedException();
- }
- }
- }
|