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; using System.IO; namespace FPER { public partial class frmWarningBox : Form// °æ°í â Ŭ·¡½º { MDIParent parent; bool chkDetailViewMode = false; // cyim 2015.7.6 ¼Óµµ°³¼±ÀÛ¾÷ Hashtable eventLogInfos; //ArrayList eventLogInfos; delegate void deleFormInit(); public bool faultmode = false; private string strImagePathCommConnect = "°æ°íâ_Åë½Å¿¡·¯_À̹ÌÁö.gif"; //Åë½Å¿¡·¯ private string strImagePathFireOn = "°æ°íâ_È­Àç_À̹ÌÁö.gif"; //È­Àç private string strImagePathWriteOn = "°æ°íâ_¼³ºñ_À̹ÌÁö.gif"; //¼³ºñ°¡µ¿ private string strImagePathFaultOn = "°æ°íâ_FAULT_À̹ÌÁö.gif"; //¿¡·¯ private string strImagePathAccumul = "°æ°íâ_ÃàÀûÈ­Àç_À̹ÌÁö.gif"; //ÃàÀû private string strImagePathPhoneOn = "°æ°íâ_ÀüÈ­_À̹ÌÁö.gif"; //ÀüÈ­ private string strImagePathFireRecover = "°æ°íâ_È­À纹±¸_À̹ÌÁö.gif"; //È­À纹±¸ private string ImagePathCommConnect { get { return Path.Combine(this.ImgBasePath, this.strImagePathCommConnect); } } private void ImageLoadingCommConnect() { Image img = ImgLoad(this.ImagePathCommConnect); if (img != null) { this.picTitle.Image = img; } } private string ImagePathFireOn { get { return Path.Combine(this.ImgBasePath, this.strImagePathFireOn); } } private void ImageLoadingFireOn() { Image img = ImgLoad(this.ImagePathFireOn); if (img != null) { this.picTitle.Image = img; } } private string ImagePathWriteOn { get { return Path.Combine(this.ImgBasePath, this.strImagePathWriteOn); } } private void ImageLoadingWriteOn() { Image img = ImgLoad(this.ImagePathWriteOn); if (img != null) { this.picTitle.Image = img; } } private string ImagePathFaultOn { get { return Path.Combine(this.ImgBasePath, this.strImagePathFaultOn); } } private void ImageLoadingFaultOn() { Image img = ImgLoad(this.ImagePathFaultOn); if (img != null) { this.picTitle.Image = img; } } private string ImagePathAccumul { get { return Path.Combine(this.ImgBasePath, this.strImagePathAccumul); } } private void ImageLoadingAccumul() { Image img = ImgLoad(this.ImagePathAccumul); if (img != null) { this.picTitle.Image = img; } } private string ImagePathPhoneOn { get { return Path.Combine(this.ImgBasePath, this.strImagePathPhoneOn); } } private void ImageLoadingPhoneOn() { Image img = ImgLoad(this.ImagePathPhoneOn); if (img != null) { this.picTitle.Image = img; } } private string ImagePathFireRecover { get { return Path.Combine(this.ImgBasePath, this.strImagePathFireRecover); } } private void ImageLoadingFireRecover() { Image img = ImgLoad(this.ImagePathFireRecover); if (img != null) { this.picTitle.Image = img; } } private string strImgBasePath = "image"; private string ImgBasePath { get { return Path.Combine(Directory.GetCurrentDirectory(), this.strImgBasePath); } } private string strImagePathBackground = "°æ°íâ_Æû¹è°æ.gif"; private string ImagePathBackground { get { return Path.Combine(this.ImgBasePath, this.strImagePathBackground); } } private Image ImgLoad(string path) { Image ret = null; try { ret = Image.FromFile(path); } catch (Exception e) { Util.UErrorMessage(e, 0, 0); } return ret; } private void ImageLoadingBackground() { Image img = ImgLoad(this.ImagePathBackground); if (img != null) { this.BackgroundImage = img; } } /**********************************************/ /* È­¸é °æ°í Ç¥½Ã ¾ÆÀÌÄÜ À̹ÌÁö¸®½ºÆ® */ /**********************************************/ const int cstCommConnectImageIdx = 0; //Åë½Å¿¡·¯ const int cstFireOnImageIdx = 1; //È­Àç const int cstWriteOnImageIdx = 2; //¼³ºñ°¡µ¿ const int cstFaultOnImageIdx = 3; //¿¡·¯ const int cstAccumulImageIdx = 4; //ÃàÀû const int cstPhoneOnImageIdx = 5; //ÀüÈ­ const int cstFireRecoverImageIdx = 6; //È­À纹±¸ /**********************************************/ //È­¸éÀ̵¿À» À§ÇØ--------------- private Boolean WindowsMove = true; private Point mouseOffset; //-------------------------------------------------------- public frmWarningBox() { InitializeComponent(); } public void Form_Init() { try { } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName); } } private void frmWarningBox_Load(object sender, EventArgs e) { try { //dataGridView1.Rows.Clear(); this.ImageLoadingBackground(); this.Size = new Size(583, 234); this.Show(); // cyim 2013.8.5 ÆË¾÷â Á¾·á ¸·À½ : ¾Èº¸À̵µ·Ï ÇÔ this.btnClose.Visible = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //°¢¸Þ¼¼Áöº° ¿ì¼±¼øÀ§¸¦ ÆÇº°ÇÑ´Ù.. public void setMessage(MappingStatus sta, string message, string deviceMessage) { try { MappingStatus dispStatus = sta; string dispMessage = message; string dispDeviceMessage = deviceMessage; //È­¸é Ç¥½Ã ¿ì¼±¼øÀ§¸¦ ÆÇº°ÇÑ´Ù.. EventLogInfo sEventLogMsg = null; //À̺¥Æ® ·Î±× this.eventLogInfos = parent.AryEventLogs; // cyim 2015.7.6 ¼Óµµ°³¼±ÀÛ¾÷ // ÇØ½¬ ¸®½ºÆ® ±¸Çö ¹æ¹ýÀº ¾Æ·¡¿Í °°´Ù // Ű : ReceiverID-CommId-BoardNo-LoopNo-RepeaterNo-DeviceId-InoutType-EventType // µ¥ÀÌŸ : EventLogInfo Ŭ·¡½º if (this.eventLogInfos != null && this.eventLogInfos.Count != 0) { int eventLogCnt = this.eventLogInfos.Count; if (eventLogCnt > 0) { // ÇØ½¬Å×À̺í Ű ÃßÃâ string[] tmp_keys = new string[eventLogInfos.Keys.Count]; this.eventLogInfos.Keys.CopyTo(tmp_keys, 0); sEventLogMsg = (EventLogInfo)this.eventLogInfos[tmp_keys[tmp_keys.Length - 1]]; //sEventLogMsg = (EventLogInfo)this.eventLogInfos[eventLogCnt - 1]; //ÃÖÁ¾ ¸Þ¼¼Áö¸¦ ÀúÀåÇÑ´Ù.. for (int i = tmp_keys.Length - 1; i >= 0; i--) //for (int i = eventLogCnt - 1; i > -1; i--) { EventLogInfo eventLogMsg = (EventLogInfo)this.eventLogInfos[tmp_keys[i]]; //EventLogInfo eventLogMsg = (EventLogInfo)this.eventLogInfos[i]; if (eventLogMsg.LiveMsgFlag) { //µÑ´Ù LiveÇÑ ¸Þ¼¼Áö¶ó¸é EventStatus°¡ ³ôÀº ¸Þ¼¼Áö·Î ¼öÁ¤ if (faultmode == true) { if (eventLogMsg.EventStatus == MappingStatus.FaultOn || eventLogMsg.EventStatus == MappingStatus.FaultOff ) { if (statusLevel(sEventLogMsg.EventStatus) > statusLevel(eventLogMsg.EventStatus)) { sEventLogMsg = eventLogMsg; //ÀÌÀü¸Þ¼¼Áö°¡ Live°¡ ¾Æ´Ï¶ó¸é Ç¥½Ã¸Þ¼¼Áö ¼öÁ¤ if (!sEventLogMsg.LiveMsgFlag && eventLogMsg.LiveMsgFlag) { sEventLogMsg = eventLogMsg; } } } } else { if (statusLevel(sEventLogMsg.EventStatus) > statusLevel(eventLogMsg.EventStatus)) { sEventLogMsg = eventLogMsg; //ÀÌÀü¸Þ¼¼Áö°¡ Live°¡ ¾Æ´Ï¶ó¸é Ç¥½Ã¸Þ¼¼Áö ¼öÁ¤ if (!sEventLogMsg.LiveMsgFlag && eventLogMsg.LiveMsgFlag) { sEventLogMsg = eventLogMsg; } } } } } dispStatus = sEventLogMsg.EventStatus; dispMessage = sEventLogMsg.Message; dispDeviceMessage = sEventLogMsg.DeviceMessage; } } //if (dispDeviceMessage != null) // this.txtWarningMessage.Text = string.Format("{0} À§Ä¡:{1}", dispMessage, dispDeviceMessage); //else if (dispStatus == MappingStatus.FireOn || dispStatus == MappingStatus.FireOff) { this.lblTitle.ForeColor = Color.Red; } else if (dispStatus == MappingStatus.WriteOn || dispStatus == MappingStatus.WriteOff) { this.lblTitle.ForeColor = Color.Blue; } else { this.lblTitle.ForeColor = Color.Black; } this.lblTitle.Text = StaTitleMsg(dispStatus); //this.txtWarningMessage.Text = string.Format("{0} À§Ä¡:{1}", dispMessage, dispDeviceMessage); this.txtWarningMessage.Text = string.Format("{1}", dispMessage, dispDeviceMessage); //this.picTitle.Image = imgLstIcon.Images[StaTitleImageIdx(dispStatus)]; this.SetPicImage(dispStatus); // int ListTotalCnt = 10; if (dataGridView1.Rows.Count > ListTotalCnt) { int listRows = dataGridView1.Rows.Count; for (int i = ListTotalCnt; i < listRows; i++) dataGridView1.Rows.RemoveAt(i); } string msg = message.Replace("\n", " "); dataGridView1.Rows.Add(String.Format("{0:yyyy}-{0:MM}-{0:dd} {0:HH}:{0:mm}:{0:ss}", DateTime.Now), msg, deviceMessage); SetToggleColor();//2010.10.29,k.s.d, alram popup color toggle value set. timer_color_Tick(null, EventArgs.Empty);//2010.10.29,k.s.d, alram popup color toggle timer. timer_color.Enabled = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(ex.Message, Application.ProductName); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.StackTrace), Application.ProductName); } } public void setMessage2(MappingStatus sta, string message, string deviceMessage) { try { MappingStatus dispStatus = sta; string dispMessage = message; string dispDeviceMessage = deviceMessage; this.lblTitle.ForeColor = Color.Black; this.lblTitle.Text = StaTitleMsg(dispStatus); this.txtWarningMessage.Text = string.Format("{1}", dispMessage, dispDeviceMessage); //this.picTitle.Image = imgLstIcon.Images[StaTitleImageIdx(dispStatus)]; this.SetPicImage(dispStatus); string msg = message.Replace("\n", " "); dataGridView1.Rows.Add(String.Format("{0:yyyy}-{0:MM}-{0:dd} {0:HH}:{0:mm}:{0:ss}", DateTime.Now), msg, deviceMessage); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void setMCCMessage(MappingStatus sta, string message, string deviceMessage) { try { ////Util.UDebugMessage("+setMCCMessage",0,0); MappingStatus dispStatus = sta; string dispMessage = message; string dispDeviceMessage = deviceMessage; //È­¸é Ç¥½Ã ¿ì¼±¼øÀ§¸¦ ÆÇº°ÇÑ´Ù.. EventLogInfo sEventLogMsg = null; //À̺¥Æ® ·Î±× this.eventLogInfos = parent.AryEventLogs; // cyim 2015.7.6 ¼Óµµ°³¼±ÀÛ¾÷ // ÇØ½¬ ¸®½ºÆ® ±¸Çö ¹æ¹ýÀº ¾Æ·¡¿Í °°´Ù // Ű : ReceiverID-CommId-BoardNo-LoopNo-RepeaterNo-DeviceId-InoutType-EventType // µ¥ÀÌŸ : EventLogInfo Ŭ·¡½º if (this.eventLogInfos != null && this.eventLogInfos.Count != 0) { int eventLogCnt = this.eventLogInfos.Count; string[] tmp_keys = new string[eventLogInfos.Keys.Count]; this.eventLogInfos.Keys.CopyTo(tmp_keys, 0); sEventLogMsg = (EventLogInfo)this.eventLogInfos[tmp_keys[tmp_keys.Length - 1]]; if (eventLogCnt > 0) { for (int i = tmp_keys.Length - 1; i >= 0; i--) //for (int i = eventLogCnt - 1; i > -1; i--) { EventLogInfo eventLogMsg = (EventLogInfo)this.eventLogInfos[tmp_keys[i]]; //EventLogInfo eventLogMsg = (EventLogInfo)this.eventLogInfos[i]; if (eventLogMsg.ReceiverID == parent.myReceiverID && eventLogMsg.CommId == 1 && eventLogMsg.BoardNo == 1 && eventLogMsg.LoopNo == 0 && eventLogMsg.RepeaterNo == 127 && eventLogMsg.InoutType == "I" && (eventLogMsg.EventType == "OL" || eventLogMsg.EventType == "XL" || eventLogMsg.EventType == "FA" || eventLogMsg.EventType == "FN")) // cyim 2015.7.9 ¾Æ³¯·Î±× °¨Áö±â ´Ü¼± »óŰ¡ ¸®½ºÆ®¿¡ Ç¥½ÃµÇÁö ¾Ê´Â ¹®Á¦ { sEventLogMsg = (EventLogInfo)eventLogMsg; //ÃÖÁ¾ ¸Þ¼¼Áö¸¦ ÀúÀåÇÑ´Ù.. ////Util.UDebugMessage(string.Format("setMCCMessage sEventLogMsg = {0}", sEventLogMsg.RepeaterNo), 0, 0); break; } } if (sEventLogMsg == null) { } else { for (int i = tmp_keys.Length - 1; i >= 0; i--) //for (int i = eventLogCnt - 1; i > -1; i--) { EventLogInfo eventLogMsg = (EventLogInfo)this.eventLogInfos[tmp_keys[i]]; //EventLogInfo eventLogMsg = (EventLogInfo)this.eventLogInfos[i]; if (eventLogMsg.ReceiverID == parent.myReceiverID && eventLogMsg.CommId == 1 && eventLogMsg.BoardNo == 1 && eventLogMsg.LoopNo == 0 && eventLogMsg.RepeaterNo == 127 && eventLogMsg.InoutType == "I" && (eventLogMsg.EventType == "OL" || eventLogMsg.EventType == "XL" || eventLogMsg.EventType == "FA" || eventLogMsg.EventType == "FN") // cyim 2015.7.9 ¾Æ³¯·Î±× °¨Áö±â ´Ü¼± »óŰ¡ ¸®½ºÆ®¿¡ Ç¥½ÃµÇÁö ¾Ê´Â ¹®Á¦ ) { if (eventLogMsg.LiveMsgFlag) { //µÑ´Ù LiveÇÑ ¸Þ¼¼Áö¶ó¸é EventStatus°¡ ³ôÀº ¸Þ¼¼Áö·Î ¼öÁ¤ if (faultmode == true) { if (eventLogMsg.EventStatus == MappingStatus.FaultOn || eventLogMsg.EventStatus == MappingStatus.FaultOff) { if (statusLevel(sEventLogMsg.EventStatus) > statusLevel(eventLogMsg.EventStatus)) { sEventLogMsg = eventLogMsg; if (!sEventLogMsg.LiveMsgFlag && eventLogMsg.LiveMsgFlag) {//ÀÌÀü¸Þ¼¼Áö°¡ Live°¡ ¾Æ´Ï¶ó¸é Ç¥½Ã¸Þ¼¼Áö ¼öÁ¤ sEventLogMsg = eventLogMsg; } } } } else { if (statusLevel(sEventLogMsg.EventStatus) > statusLevel(eventLogMsg.EventStatus)) { sEventLogMsg = eventLogMsg; if (!sEventLogMsg.LiveMsgFlag && eventLogMsg.LiveMsgFlag) {//ÀÌÀü¸Þ¼¼Áö°¡ Live°¡ ¾Æ´Ï¶ó¸é Ç¥½Ã¸Þ¼¼Áö ¼öÁ¤ sEventLogMsg = eventLogMsg; } ////Util.UDebugMessage(string.Format("setMCCMessage sEventLogMsg = {0} :2", sEventLogMsg.RepeaterNo), 0, 0); } } } } } dispStatus = sEventLogMsg.EventStatus; dispMessage = sEventLogMsg.Message; dispDeviceMessage = sEventLogMsg.DeviceMessage; ////Util.UDebugMessage(string.Format("setMCCMessage dispMessage = {0} ", dispMessage), 0, 0); } } } if (dispStatus == MappingStatus.FireOn || dispStatus == MappingStatus.FireOff) { this.lblTitle.ForeColor = Color.Red; } else if (dispStatus == MappingStatus.WriteOn || dispStatus == MappingStatus.WriteOff) { this.lblTitle.ForeColor = Color.Blue; } else { this.lblTitle.ForeColor = Color.Black; } this.lblTitle.Text = StaTitleMsg(dispStatus); this.txtWarningMessage.Text = string.Format("{1}", dispMessage, dispDeviceMessage); //this.picTitle.Image = imgLstIcon.Images[StaTitleImageIdx(dispStatus)]; this.SetPicImage(dispStatus); int ListTotalCnt = 10; if (dataGridView1.Rows.Count > ListTotalCnt) { int listRows = dataGridView1.Rows.Count; for (int i = ListTotalCnt; i < listRows; i++) dataGridView1.Rows.RemoveAt(i); } string msg = message.Replace("\n", " "); dataGridView1.Rows.Add(String.Format("{0:yyyy}-{0:MM}-{0:dd} {0:HH}:{0:mm}:{0:ss}", DateTime.Now), msg, deviceMessage); SetToggleColor();//2010.10.29,k.s.d, alram popup color toggle value set. timer_color_Tick(null, EventArgs.Empty);//2010.10.29,k.s.d, alram popup color toggle timer. timer_color.Enabled = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //°¢°æ°í°ªÀÇ »óŸ¦ ·¹º§·Î ÀüȯÇÑ´Ù.. private int statusLevel(MappingStatus dispStatus) { int lv = 99; try { lv = (int)dispStatus;//2010.10.29,k.s.d, pop up message level chnage. // // switch (dispStatus) // { // case MappingStatus.FireOn: lv = (int)dispStatus; break; // case MappingStatus.FireOff: lv = (int)MappingStatus.FireOn; break; // case MappingStatus.CommConnectError: lv = (int)dispStatus; break; // case MappingStatus.CommConnectNormal: lv = (int)MappingStatus.CommConnectError; break; // case MappingStatus.FaultOff: lv = (int)MappingStatus.FaultOn; break; // case MappingStatus.FaultOn: lv = (int)dispStatus; break; // case MappingStatus.AccumulateOff: lv = (int)MappingStatus.AccumulateOn; break; // case MappingStatus.AccumulateOn: lv = (int)dispStatus; break; // case MappingStatus.FireRecovery: lv = (int)dispStatus; break; // case MappingStatus.Normal: lv = (int)dispStatus; break; // case MappingStatus.PhoneOff: lv = (int)MappingStatus.PhoneOn; break; // case MappingStatus.PhoneOn: lv = (int)dispStatus; break; // case MappingStatus.ProgramEnd: lv = (int)MappingStatus.ProgramStart; break; // case MappingStatus.ProgramStart: lv = (int)dispStatus; break; // case MappingStatus.WriteOff: lv = (int)MappingStatus.WriteOn; break; // case MappingStatus.WriteOn: lv = (int)dispStatus; break; // } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return lv; } private string StaTitleMsg(MappingStatus dispStatus) { string tle = ""; try { switch (dispStatus) { case MappingStatus.FireOn: tle = "È­Àç¹ß»ý"; break; case MappingStatus.FireOff: tle = "È­ÀçÇØÁ¦"; break; case MappingStatus.CommConnectError: tle = "Åë½Å¿¬°á¿¡·¯"; break; case MappingStatus.CommConnectNormal: tle = "Åë½Å¿¬°áÇØÁ¦"; break; case MappingStatus.FaultOff: tle = "FAULTÇØÁ¦"; break; case MappingStatus.FaultOn: tle = "FAULT¹ß»ý"; break; case MappingStatus.AccumulateOff: tle = "ÃàÀûÈ­ÀçÇØÁ¦"; break; case MappingStatus.AccumulateOn: tle = "ÃàÀûÈ­Àç¹ß»ý"; break; case MappingStatus.FireRecovery: tle = "È­À纹±¸"; break; case MappingStatus.Normal: tle = "Á¤»ó"; break; case MappingStatus.PhoneOff: tle = "ÀüÈ­ÇØÁ¦"; break; case MappingStatus.PhoneOn: tle = "ÀüÈ­¿¬°á"; break; case MappingStatus.ProgramEnd: tle = "ÇÁ·Î±×·¥Á¾·á"; break; case MappingStatus.ProgramStart: tle = "ÇÁ·Î±×·¥½ÃÀÛ"; break; case MappingStatus.WriteOff: tle = "¼³ºñÁ¾·á"; break; case MappingStatus.WriteOn: tle = "¼³ºñÀÛµ¿"; break; case MappingStatus.DemonInit: tle = "ÃʱâÈ­ Áß"; break; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return tle; } //private int StaTitleImageIdx(MappingStatus dispStatus) { // int imageIdx = 0; // try { // switch (dispStatus) { // /// // case MappingStatus.FireOn: // case MappingStatus.FireOff: // imageIdx = cstFireOnImageIdx; // break; // case MappingStatus.CommConnectError: // case MappingStatus.CommConnectNormal: // imageIdx = cstCommConnectImageIdx; // break; // case MappingStatus.FaultOff: // case MappingStatus.FaultOn: // imageIdx = cstFaultOnImageIdx; // break; // case MappingStatus.PhoneOff: // case MappingStatus.PhoneOn: // imageIdx = cstPhoneOnImageIdx; // break; // case MappingStatus.AccumulateOff: // case MappingStatus.AccumulateOn: // imageIdx = cstAccumulImageIdx; // break; // case MappingStatus.WriteOff: // case MappingStatus.WriteOn: // imageIdx = cstWriteOnImageIdx; // break; // case MappingStatus.FireRecovery: // imageIdx = cstFireRecoverImageIdx; // break; // case MappingStatus.DemonInit: // imageIdx = cstCommConnectImageIdx; // break; // //case MappingStatus.ProgramEnd: tle = "ÇÁ·Î±×·¥Á¾·á"; break; // //case MappingStatus.ProgramStart: tle = "ÇÁ·Î±×·¥½ÃÀÛ"; break; // //case MappingStatus.Normal: tle = "Á¤»ó"; break; // default: // imageIdx = cstFaultOnImageIdx; // break; // } // } // catch (Exception ex) { // Util.UErrorMessage(ex, 0, 0); // } // return imageIdx; //} private void SetPicImage(MappingStatus dispStatus) { try { switch (dispStatus) { case MappingStatus.FireOn: case MappingStatus.FireOff: this.ImageLoadingFireOn(); break; case MappingStatus.CommConnectError: case MappingStatus.CommConnectNormal: this.ImageLoadingCommConnect(); break; case MappingStatus.FaultOff: case MappingStatus.FaultOn: this.ImageLoadingFaultOn(); break; case MappingStatus.PhoneOff: case MappingStatus.PhoneOn: this.ImageLoadingPhoneOn(); break; case MappingStatus.AccumulateOff: case MappingStatus.AccumulateOn: this.ImageLoadingAccumul(); break; case MappingStatus.WriteOff: case MappingStatus.WriteOn: this.ImageLoadingWriteOn(); break; case MappingStatus.FireRecovery: this.ImageLoadingFireRecover(); break; case MappingStatus.DemonInit: this.ImageLoadingCommConnect(); break; default: this.ImageLoadingFaultOn(); break; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void setParent(MDIParent parent) { try { this.parent = parent; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void frmWarningBox_FormClosed(object sender, FormClosedEventArgs e) { try { if (this.parent != null) { this.parent.CloseMessageForm(); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void frmWarningBox_LostFocus(object sender, EventArgs e) { try { this.Select(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnStatusYes_Click(object sender, EventArgs e) { try { this.Close(); //À̷³»¿ªº¸±â parent.toolStripMenuItem4_Click(null, EventArgs.Empty); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void lblDetailView_Click(object sender, EventArgs e) { try { if (chkDetailViewMode) { chkDetailViewMode = false; this.Size = new Size(583, 234); //lblDetailView.Text = "ÀÚ¼¼È÷º¸±â>>"; dataGridView1.Visible = false; } else { chkDetailViewMode = true; this.Size = new Size(583, 387); //lblDetailView.Text = "ÀÚ¼¼È÷º¸±â´Ý±â<<"; dataGridView1.Visible = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnClose_Click(object sender, EventArgs e) { try { //this.Close(); this.Hide(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnWinClose_Click(object sender, EventArgs e) { try { //this.Close(); this.Hide(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } /********************************************************/ /* È­¸éÀ̵¿ */ /********************************************************/ private void lblWindowsMove_MouseDown(object sender, MouseEventArgs e) { try { if (WindowsMove) { mouseOffset = new Point(-(e.X + parent.Location.X), -(e.Y + 55 + parent.Location.Y)); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void lblWindowsMove_MouseMove(object sender, MouseEventArgs e) { try { if (WindowsMove && (e.Button == MouseButtons.Left)) { Point mousePos = Control.MousePosition; mousePos.Offset(mouseOffset.X, mouseOffset.Y); this.Location = mousePos; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } Color ToggleColor_set = Color.Transparent; Color ToggleColor_reset = Color.Transparent; Color ToggleFontColor_set = Color.Black; Color ToggleFontColor_reset = Color.Black; private void timer_color_Tick(object sender, EventArgs e) { try { if (this.lblTitle.BackColor == this.ToggleColor_reset) { this.lblTitle.BackColor = this.ToggleColor_set; this.lblTitle.ForeColor = this.ToggleFontColor_set; } else { this.lblTitle.BackColor = this.ToggleColor_reset; this.lblTitle.ForeColor = this.ToggleFontColor_reset; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void SetToggleColor() { try { if (this.lblTitle.Text == "È­Àç¹ß»ý") { this.ToggleColor_set = Color.Red; this.ToggleColor_reset = Color.Transparent; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Red; } else if (this.lblTitle.Text == "ÃàÀûÈ­Àç¹ß»ý") { this.ToggleColor_set = Color.Red; this.ToggleColor_reset = Color.Transparent; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Red; } else if (this.lblTitle.Text == "FAULT¹ß»ý") { this.ToggleColor_set = Color.OrangeRed; this.ToggleColor_reset = Color.Transparent; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "Åë½Å¿¬°á¿¡·¯") { this.ToggleColor_set = Color.OrangeRed; this.ToggleColor_reset = Color.Transparent; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "¼³ºñÀÛµ¿") { this.ToggleColor_set = Color.Blue; this.ToggleColor_reset = Color.Transparent; this.ToggleFontColor_set = Color.White; this.ToggleFontColor_reset = Color.Blue; } else if (this.lblTitle.Text == "ÀüÈ­¿¬°á") { this.ToggleColor_set = Color.Blue; this.ToggleColor_reset = Color.Transparent; this.ToggleFontColor_set = Color.White; this.ToggleFontColor_reset = Color.Blue; } else if (this.lblTitle.Text == "È­ÀçÇØÁ¦") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "ÃàÀûÈ­ÀçÇØÁ¦") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "È­À纹±¸") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "FAULTÇØÁ¦") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "Åë½Å¿¬°áÇØÁ¦") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "¼³ºñÁ¾·á") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "ÀüÈ­ÇØÁ¦") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "Á¤»ó") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "ÇÁ·Î±×·¥Á¾·á") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else if (this.lblTitle.Text == "ÇÁ·Î±×·¥½ÃÀÛ") { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } else { this.ToggleColor_set = Color.Transparent; this.ToggleColor_reset = this.ToggleColor_set; this.ToggleFontColor_set = Color.Black; this.ToggleFontColor_reset = Color.Black; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } /********************************************************/ } }