123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using System.Drawing;
- using System.Data;
- namespace FPER
- {
-
- public class _FIRE_LIST
- {
- public string FIRE_TIME;
- public bool FIRE_TYPE;
- public string FIRE_TEXT;
- public string FIRE_RECEIVERNAME;
- public string FIRE_RECEIVERIP;
- }
- public class _Popup
- {
-
- MDIParent mdi = null;
- LogFileCreate LFC = new LogFileCreate();
-
-
-
-
- private Form_Popup CommonPopup = new Form_Popup();
-
- public delegate void CreateFormCallback(Form Target);
- public delegate void CreateEtcFirePopupCallback(string MyReceiver_ID, string FireReceiver_ID, MDIParent Target);
-
- public Hashtable HASH_EtcReceiverFireAlarmPopup = new Hashtable();
-
-
-
-
- public Form_Popup_CutInfo Form_Popup_CutInfo_Main = null;
-
- public ArrayList Form_Popup_CutInfo_List = new ArrayList();
-
- public bool Form_Popup_CutInfo_Enable = false;
- public MDIParent MdiParent { get; private set; }
-
- public _Popup(MDIParent mdiparent)
- {
- mdi = mdiparent;
- }
-
- ~_Popup()
- {
- }
-
-
-
-
- public void CommonPopupShow(Form Target)
- {
- if (Target.InvokeRequired)
- {
- CreateFormCallback d = new CreateFormCallback(CommonPopupShow);
- Target.Invoke(d, new object[] { });
- }
- else
- {
-
- if (CommonPopup != null) CommonPopup.Close();
-
- CommonPopup = new Form_Popup();
-
- Target.FormClosing += new FormClosingEventHandler(Target_FormClosing);
- Target.VisibleChanged += new EventHandler(Target_VisibleChanged);
-
- CommonPopup.Show(Target);
-
- CommonPopup.StartPosition = FormStartPosition.CenterParent;
-
- CommonPopup.Update();
- }
- }
- public void Target_VisibleChanged(object sender, EventArgs e)
- {
- Form frm = (Form)sender;
- if (frm.Visible == false)
- CommonPopupClose(frm);
- }
-
- public void CommonPopupClose(Form Target)
- {
- if (Target.InvokeRequired)
- {
- CreateFormCallback d = new CreateFormCallback(CommonPopupClose);
- Target.Invoke(d, new object[] { });
- }
- else
- {
-
- if (CommonPopup != null)
- {
- CommonPopup.Hide();
- CommonPopup.Close();
- }
-
- Target.VisibleChanged -= new EventHandler(Target_VisibleChanged);
- Target.FormClosing -= new FormClosingEventHandler(Target_FormClosing);
- }
- }
-
- public void Target_FormClosing(object sender, FormClosingEventArgs e)
- {
-
- if (CommonPopup != null)
- {
- CommonPopup.Hide();
- CommonPopup.Close();
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public void EtcReceiverFirePopupShow(string MyReceiver_ID, string FireReceiver_ID, MDIParent Target)
- {
-
-
- LFC.Log("EtcReceiverFirePopupShow(MyReceiver_ID: " + MyReceiver_ID + ", FireReceiver_ID: " + FireReceiver_ID + ", Target: " + Target);
- if (MyReceiver_ID != FireReceiver_ID && HASH_EtcReceiverFireAlarmPopup.Count != 0)
- {
- LFC.Log("EtcReceiverFireAlarmPopup.Contains: " + HASH_EtcReceiverFireAlarmPopup.Contains(FireReceiver_ID));
- if (HASH_EtcReceiverFireAlarmPopup.Contains(FireReceiver_ID) == true)
- {
- LFC.Log("EtcReceiverFireAlarmPopup.Visible " + ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).Visible);
- if (((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).Visible == false)
- {
- if (Target.InvokeRequired)
- {
- CreateEtcFirePopupCallback d = new CreateEtcFirePopupCallback(EtcReceiverFirePopupShow);
- Target.Invoke(d, new object[] { MyReceiver_ID, MyReceiver_ID, Target });
- }
- else
- {
- int FireReceiver_ID_NUM = int.Parse(MyReceiver_ID);
-
- LFC.Log("EtcReceiverFireAlarmPopup.Show()");
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).Show();
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).StartPosition = FormStartPosition.Manual;
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2 - ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).Width / 2) + (FireReceiver_ID_NUM - 1) * 30, (Screen.PrimaryScreen.Bounds.Height / 2 - ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).Size.Height / 4) + (FireReceiver_ID_NUM - 1) * 30);
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).Update();
- }
- }
- LFC.Log("==================================================================================================================");
-
-
-
-
-
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public void EtcReceiverFirePopupProcess(string MyReceiver_ID, string FireReceiver_ID, bool FireType, string FireDisplayText, string FireTime)
- {
-
-
- LFC.Log("EtcReceiverFirePopupProcess(MyReceiver_ID: "+ MyReceiver_ID + ", FireReceiver_ID: "+ FireReceiver_ID + ", FireType: " + FireType + ", FireDisplayText: " + FireDisplayText + ", FireTime: " + FireTime);
- if (MyReceiver_ID != FireReceiver_ID && HASH_EtcReceiverFireAlarmPopup.Count != 0)
- {
- LFC.Log("EtcReceiverFireAlarmPopup.Contains: " + HASH_EtcReceiverFireAlarmPopup.Contains(FireReceiver_ID));
- if (HASH_EtcReceiverFireAlarmPopup.Contains(FireReceiver_ID) == true)
- {
- LFC.Log("EtcReceiverFireAlarm_LIST_FIRE_INFO.Count: " + ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).LIST_FIRE_INFO.Count);
-
- if (((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).LIST_FIRE_INFO.Count > 21)
- {
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).LIST_FIRE_INFO.RemoveAt(0);
- }
-
- _FIRE_LIST FIRE_LIST = new _FIRE_LIST();
- FIRE_LIST.FIRE_TEXT = FireDisplayText;
- FIRE_LIST.FIRE_TYPE = FireType;
- FIRE_LIST.FIRE_RECEIVERNAME = ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).POPUP_RECEIVER_NAME;
- FIRE_LIST.FIRE_RECEIVERIP = ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[FireReceiver_ID]).POPUP_RECEIVER_IP;
- FIRE_LIST.FIRE_TIME = FireTime;
- LFC.Log("EtcReceiverFireAlarm_FIRE_TEXT: " + FIRE_LIST.FIRE_TEXT + ", FIRE_TYPE: "+ FIRE_LIST.FIRE_TYPE + ", FIRE_RECEIVERNAME: " + FIRE_LIST.FIRE_RECEIVERNAME + ", FIRE_RECEIVERIP: " + FIRE_LIST.FIRE_RECEIVERIP + ", FIRE_TIME: " + FIRE_LIST.FIRE_TIME);
- LFC.Log(" ");
-
- ((Form_Popup_OtherFireAlarm)HASH_EtcReceiverFireAlarmPopup[MyReceiver_ID]).LIST_FIRE_INFO.Add(FIRE_LIST);
- }
- }
- }
- }
- }
|