using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Collections; using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; namespace FPER { public partial class frmModeConfig : Form { //[DllImport("kernel32.dll")] //private extern static void GetSystemTime(ref SYSTEMTIME lpSystemTime); [DllImport("kernel32.dll")] private extern static uint SetSystemTime(ref SYSTEMTIME lpSystemTime); private struct SYSTEMTIME { public ushort wYear; public ushort wMonth; public ushort wDayOfWeek; public ushort wDay; public ushort wHour; public ushort wMinute; public ushort wSecond; public ushort wMilliseconds; } //private SYSTEMTIME GetTime() //{ // // Call the native GetSystemTime method // // with the defined structure. // SYSTEMTIME stime = new SYSTEMTIME(); // GetSystemTime(ref stime); // return stime; // //// Show the current time. // //MessageBox.Show("Current Time: " + // // stime.wHour.ToString() + ":" // // + stime.wMinute.ToString()); //} //private void SetTime(SYSTEMTIME systime) //{ // // Call the native GetSystemTime method // // with the defined structure. // //SYSTEMTIME systime = new SYSTEMTIME(); // //GetSystemTime(ref systime); // //// Set the system clock ahead one hour. // //systime.wHour = (ushort)(systime.wHour + 1 % 24); // SetSystemTime(ref systime); // //MessageBox.Show("New time: " + systime.wHour.ToString() + ":" // // + systime.wMinute.ToString()); //} MDIParent mdi; //ÃÖÃÊ ½Ã°£¼³Á¤À» À§ÇØ bool TimeTicker_Start = false; DateTime sSystemDateTime; delegate void deleFormInit(); string temppw; ReceiverConfigVo configVO; public frmModeConfig() { InitializeComponent(); // cyim 2013.7.29 ½Ã¿îÀü¸ðµå ¼Ó¼º º¯°æ this.checkBox_TestRunFlag.Visible = false; } public void Form_Init() { try { if (this.InvokeRequired) { deleFormInit d = new deleFormInit(Form_Init); this.Invoke(d, new object[] { }); } else { this.configVO.Fire_accumulation_mode = mdi.MyConfigVO.Fire_accumulation_mode; this.configVO.Fire_accumulation_time = mdi.MyConfigVO.Fire_accumulation_time; this.configVO.Fire_process_mode = mdi.MyConfigVO.Fire_process_mode; this.configVO.Master_user_id = mdi.MyConfigVO.Master_user_id; this.configVO.Master_password = mdi.MyConfigVO.Master_password; this.configVO.Building_name = mdi.MyConfigVO.Building_name; this.configVO.Background_image = mdi.MyConfigVO.Background_image; getData(); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName); } } private void frmModeConfig_Load(object sender, EventArgs e) { // cyim 2013.8.1 : ´õºí¹öÆÛ¸µ Àû¿ë SetStyle(ControlStyles.UserPaint, true); //this.UpdateStyles(); SetStyle(ControlStyles.AllPaintingInWmPaint, true); //this.UpdateStyles(); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.UpdateStyles(); try { mdi = (MDIParent)this.MdiParent; // // cyim 2016.04.06 : °¨Áö±âÀÇ ³·½Ã°£´ë ¼³Á¤ // DacReceiverConfig TB_DayTime = new DacReceiverConfig(mdi.MyReceiverID); if (TB_DayTime.TB_DAYTIME_Exist() != null && TB_DayTime.TB_DAYTIME_Exist().Count != 0) // óÀ½ Á¢±ÙÇÒ ´ç½Ã¿¡ ÇØ´ç Å×À̺íÀÌ ÀÖ´Ù¸é UI °¡ »õ·Î »ý±ä´Ù { // ¼³Á¤µÈ °ªÀÌ Á¸ÀçÇÑ´Ù¸é DataRowCollection drc = TB_DayTime.TB_DAYTIME_Get(); if (drc.Count == 0) { this.textBox_Start_Hour.Text = "0"; this.textBox_Start_Minute.Text = "0"; this.textBox_End_Hour.Text = "0"; this.textBox_End_Minute.Text = "0"; } else { string START_HOUR = ((drc[0]["START_HOUR"]) == null) ? "00" : (drc[0]["START_HOUR"]).ToString(); string START_MIN = ((drc[0]["START_MIN"]) == null) ? "00" : (drc[0]["START_MIN"]).ToString(); string END_HOUR = ((drc[0]["END_HOUR"]) == null) ? "00" : (drc[0]["END_HOUR"]).ToString(); string END_MIN = ((drc[0]["END_MIN"]) == null) ? "00" : (drc[0]["END_MIN"]).ToString(); groupBox_TBDayTime.Visible = true; this.textBox_Start_Hour.Text = START_HOUR; this.textBox_Start_Minute.Text = START_MIN; this.textBox_End_Hour.Text = END_HOUR; this.textBox_End_Minute.Text = END_MIN; } } else groupBox_TBDayTime.Visible = false; // cyim 2016.12.14 : IFC2000, IFC1000 Àº ¾Æ³¯·Î±× °¨Áö±â ½Ã°£´ë ¼³Á¤È­¸éÀÌ Ãâ·ÂµÇÁö ¾Ê´Â´Ù if (mdi.ReceiverModel == "IFC2000" || mdi.ReceiverModel == "IFC1000") groupBox_TBDayTime.Visible = false; txtThisReceiverID.Text = string.Format("{0:00}", mdi.myReceiverID); this.configVO = new ReceiverConfigVo(mdi.myReceiverID); this.configVO.Fire_accumulation_mode = mdi.MyConfigVO.Fire_accumulation_mode; this.configVO.Fire_accumulation_time = mdi.MyConfigVO.Fire_accumulation_time; this.configVO.Fire_process_mode = mdi.MyConfigVO.Fire_process_mode; this.configVO.Master_user_id = mdi.MyConfigVO.Master_user_id; this.configVO.Master_password = mdi.MyConfigVO.Master_password; this.configVO.Building_name = mdi.MyConfigVO.Building_name; this.configVO.Background_image = mdi.MyConfigVO.Background_image; // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ this.configVO.Jump_field_flag = mdi.MyConfigVO.Jump_field_flag; // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã this.configVO.Test_run_flag = mdi.MyConfigVO.Test_run_flag; //ÃàÀû(30ÃÊ, 40ÃÊ, 50ÃÊ, 60ÃÊ ¼±ÅÃ) , ºñÃàÀû ArrayList ary = new ArrayList(); ary.Add(new cboitem("30", "30ÃÊ")); ary.Add(new cboitem("40", "40ÃÊ")); ary.Add(new cboitem("50", "50ÃÊ")); ary.Add(new cboitem("60", "60ÃÊ")); //ary.Add(new cboitem("0", "ºñÃàÀû")); Util.ComboSetting(cboFireAccumulationTime, ary, null); // cyim 2016.12.09 : ¼ö½Å±â ¸ðµ¨À» Ç¥½Ã (¿îÀü¸ðµå ¼³Á¤È­¸é) label_ReceiverModel.Text = mdi.ReceiverModel; getData(); timer1.Enabled = true; } catch (Exception ex) { // cyim 2016.04.06 : °¨Áö±âÀÇ ³·½Ã°£´ë ¼³Á¤ groupBox_TBDayTime.Visible = false; Util.UErrorMessage(ex, 0, 0); } } private void frmModeConfig_Activated(object sender, EventArgs e) { try { this.mdi.SelectMenuIndex = 2; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void frmModeConfig_Disposed(object sender, EventArgs e) { try { this.mdi.SelectMenuIndex = 0; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void getData() { try { if (this.InvokeRequired) { deleFormInit d = new deleFormInit(getData); this.Invoke(d, new object[] { }); } else { //ÃàÀû¸ðµå chkFireAccumulationMode.Checked = this.configVO.Fire_accumulation_mode; if (!chkFireAccumulationMode.Checked) chkFireAccumulationMode_CheckedChanged(chkFireAccumulationMode, EventArgs.Empty); //È­Àç¸ðµå chkFireProcessMode.Checked = this.configVO.Fire_process_mode; if (!chkFireProcessMode.Checked) chkFireProcessMode_CheckedChanged(chkFireProcessMode, EventArgs.Empty); //°ü¸®ÀÚID txtMasterUserId.Text = this.configVO.Master_user_id; //°ü¸®ÀÚ¾ÏÈ£ txtMasterPassword.Text = this.configVO.Master_password; temppw = txtMasterPassword.Text; //°ü¸®ÀÚ¾ÏÈ£ÀçÀÔ·Â txtMasterPasswordRe.Text = this.configVO.Master_password; //°Ç¹°¸í txtBuildingName.Text = this.configVO.Building_name; //¹è°æÀ̹ÌÁö //txtBackgroundImagePath.Text = this.configVO.Background_image; txtBackgroundImagePath.Text = ""; //È­Àç½ÃÈ­¸éÀüȯ // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ if (this.configVO.Jump_field_flag == "N") checkBox_JumpField.Checked = false; else checkBox_JumpField.Checked = true; //½Ã¿îÀü¸ðµå // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã if (this.configVO.Test_run_flag == "N") checkBox_TestRunFlag.Checked = false; else checkBox_TestRunFlag.Checked = 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); } } private void chkFireAccumulationMode_CheckedChanged(object sender, EventArgs e) { try { if (chkFireAccumulationMode.Checked) { chkFireAccumulationMode.Text = "È­ÀçÃàÀû»ç¿ë"; this.cboFireAccumulationTime.Visible = true; if (this.configVO.Fire_accumulation_time > 0) cboFireAccumulationTime.SelectedValue = this.configVO.Fire_accumulation_time.ToString(); else cboFireAccumulationTime.SelectedIndex = 0; } else { chkFireAccumulationMode.Text = "È­ÀçÃàÀûºñ»ç¿ë"; cboFireAccumulationTime.SelectedValue = "0"; this.cboFireAccumulationTime.Visible = false; } // cyim 2013.7.12 µðÀÚÀΰ³¼±ÀÛ¾÷ : ¿îÀü¼³Á¤ if (chkFireAccumulationMode.Checked) this.chkFireAccumulationMode.BackgroundImage = (Image)Properties.Resources.ÀϹݹöư_´ë_ÁÖȲ_215_58; else this.chkFireAccumulationMode.BackgroundImage = (Image)Properties.Resources.ÀϹݹöư_´ë_ȸ»ö_215_58; this.panel_Main.Focus(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void chkFireProcessMode_CheckedChanged(object sender, EventArgs e) { try { if (chkFireProcessMode.Checked) { chkFireProcessMode.Text = "È­ÀçÁö¼Ó"; mdi.CommandLog(MappingStatus.Log, string.Format("º¹±¸¸ðµå º¯°æ(È­ÀçÁö¼Ó)")); } else { chkFireProcessMode.Text = "ÀÚµ¿º¹±¸"; mdi.CommandLog(MappingStatus.Log, string.Format("º¹±¸¸ðµå º¯°æ(ÀÚµ¿º¹±¸)")); } // cyim 2013.7.12 µðÀÚÀΰ³¼±ÀÛ¾÷ : ¿îÀü¼³Á¤ if (chkFireProcessMode.Checked) this.chkFireProcessMode.BackgroundImage = (Image)Properties.Resources.ÀϹݹöư_´ë_ȸ»ö_215_58; else this.chkFireProcessMode.BackgroundImage = (Image)Properties.Resources.ÀϹݹöư_´ë_ÁÖȲ_215_58; this.panel_Main.Focus(); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void timer1_Tick(object sender, EventArgs e) { try { int nowHour = Util.StrToInt(string.Format("{0:HH}", DateTime.Now), 0); int sysHour = Util.StrToInt(string.Format("{0:HH}", sSystemDateTime), 0); if (!TimeTicker_Start) { dateTimePicker1.Value = DateTime.Now; numericUpDown1.Value = nowHour; numericUpDown2.Value = DateTime.Now.Minute; sSystemDateTime = DateTime.Now; TimeTicker_Start = true; } else { if (DateTime.Now.Minute != sSystemDateTime.Minute) numericUpDown2.Value = DateTime.Now.Minute; if (sysHour != nowHour) numericUpDown1.Value = nowHour; //if (DateTime.Now.Date != sSystemDateTime.Date) dateTimePicker1.Value = DateTime.Now; sSystemDateTime = DateTime.Now; } txtSystemSecond.Text = string.Format("{0}", DateTime.Now.Second); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } private void btnTimeApply_Click(object sender, EventArgs e) { try { DateTime sDateTimeValue = dateTimePicker1.Value; //string myDateTimeValue = string.Format("2/16/1992 12:15:12"); string myDateTimeValue = string.Format("{0:MM}/{0:dd}/{0:yyyy} {1:00}:{2:00}:{3:00}", sDateTimeValue , numericUpDown1.Value, numericUpDown2.Value, Util.StrToInt(txtSystemSecond.Text, 0)); DateTime myDateTime = DateTime.Parse(myDateTimeValue); // cyim 2015.10.1 ½Ã°£ µ¿±âÈ­¸¦ À§ÇØ ½Ã°£Á¤º¸¸¦ ¼ÂÆÃÇѰÍÀ» ¸ÞÀο¡°Ô ¾Ë¸®´Â À̺¥Æ® DateTime TempDateTime = myDateTime; SYSTEMTIME systime = new SYSTEMTIME(); //GetSystemTime(ref systime); myDateTime = myDateTime.AddHours(-9); int nowHour = Util.StrToInt(string.Format("{0:HH}", myDateTime), 0); systime.wYear = (ushort)myDateTime.Year; systime.wMonth = (ushort)myDateTime.Month; systime.wDay = (ushort)myDateTime.Day; systime.wHour = (ushort)(nowHour); systime.wMinute = (ushort)myDateTime.Minute; systime.wSecond = (ushort)myDateTime.Second; SetSystemTime(ref systime); //½Ã°£¼³Á¤ // cyim 2015.10.1 ½Ã°£ µ¿±âÈ­¸¦ À§ÇØ ½Ã°£Á¤º¸¸¦ ¼ÂÆÃÇѰÍÀ» ¸ÞÀο¡°Ô ¾Ë¸®´Â À̺¥Æ® (¶óº§Àº Àû¿ë¹öư ´©¸£¸é º¸ÀÓ) mdi.Event.TimeSync_Setup_SendMessage_Write(TempDateTime.ToString("yyyy-MM-dd HH:mm:ss")); this.label_Inform.Visible = 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); } } //ºñ¹Ð¹øÈ£ ±ÔÄ¢ ¼³Á¤ //6~20ÀÚ¸® ¹®ÀÚ¿­ ¼ýÀÚ¿Í ¹®ÀÚ¿Í °°ÀÌ ÀÖ¾î¾ß ÇÔ public static bool IsRegexMatch(int type, string plainText) { Regex rx; switch (type) { case 1: //¼ýÀÚ rx = new Regex(@"^[0-9]$", RegexOptions.None); break; case 2: //¿µ¹®ÀÚ rx = new Regex(@"^[a-zA-Z]$", RegexOptions.None); break; case 3: //ÇÑ±Û rx = new Regex(@"^[°¡-ÆR]$", RegexOptions.None); break; case 4: //ÇѱÛ+¿µ¹®ÀÚ rx = new Regex(@"^[a-zA-Z]$", RegexOptions.None); break; case 5: //¼ýÀÚ+¿µ¹®ÀÚ+ÇÑ±Û rx = new Regex(@"^[a-zA-Z0-9°¡-ÆR]$", RegexOptions.None); break; case 6: //¼ýÀÚ+¿µ¹®ÀÚ+ÇÑ±Û + °³¼ö rx = new Regex(@"^[a-zA-Z0-9°¡-ÆR]{4,16}$", RegexOptions.None); break; default: return false; } return (string.IsNullOrEmpty(plainText)) ? false : rx.IsMatch(plainText); } //¹®ÀÚ¿­Áß Çϳª¶óµµ ¼ýÀÚ°¡ Á¸ÀçÇÏ´ÂÁö üũ public bool IsNumeric(string value) { bool result = false; foreach (char cData in value) { if (false == Char.IsNumber(cData)) { result = false; } else { result = true; break; } } if (result) { return true; } else { return false; } } //¹®ÀÚ¿­Áß Çϳª¶óµµ ¹®ÀÚ°¡ Á¸ÀçÇÏ´ÂÁö üũ public bool IsLetter(string value) { bool result = false; foreach (char cData in value) { if (false == Char.IsLetter(cData)) { result = false; } else { result = true; break; } } if (result) { return true; } else { return false; } } private void btnRepeaterSave_Click(object sender, EventArgs e) { try { // cyim 2013.7.12 µðÀÚÀΰ³¼±ÀÛ¾÷ : ¿îÀü¼³Á¤ this.panel_Main.Focus(); // cyim 2015.10.1 ½Ã°£ µ¿±âÈ­ : ¶óº§Àº Àû¿ë¹öư ´©¸£¸é º¸ÀÌÁö¸¸, ÀüüÀû¿ë¹öư ´©¸£¸é »ç¶óÁü this.label_Inform.Visible = false; bool chkConfigVoChange = false; //µ¥¸ó¿¡ ³Ñ±æ µ¥ÀÌÅÍ º¯°æ¿©ºÎ bool chkConfigVoChangeAll = false; //Àüüµ¥ÀÌÅÍ º¯°æ¿©ºÎ Util.ChkTxtBox(txtMasterUserId, "°ü¸®ÀÚID"); string ID = txtMasterUserId.Text.Trim().ToLower(); string passwd = txtMasterPassword.Text.Trim().ToLower(); string passwdre = txtMasterPasswordRe.Text.Trim().ToLower(); if (!((temppw == passwd) && (temppw == passwdre))) { if (!passwd.Equals(passwdre)) { MessageBox.Show("¾ÏÈ£¿Í ÀçÀÔ·Â ¾ÏÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.", Application.ProductName); return; } if (ID.Equals(passwd)) { MessageBox.Show("ID¿Í ºñ¹Ð¹øÈ£°¡ µ¿ÀÏÇÏ¸é ¾ÈµË´Ï´Ù.", Application.ProductName); return; } if (!IsRegexMatch(6, passwd)) // °³¼ö { MessageBox.Show("ºñ¹Ð¹øÈ£´Â ¼ýÀÚ¿Í ¹®ÀÚÀÇ Á¶ÇÕÀ¸·Î ±¸¼ºµÇ¾î¾ßÇÕ´Ï´Ù(4~16ÀÚ)", Application.ProductName); return; } if (!IsNumeric(passwd)) //¼ýÀÚ { MessageBox.Show("ºñ¹Ð¹øÈ£´Â ¼ýÀÚ¿Í ¹®ÀÚÀÇ Á¶ÇÕÀ¸·Î ±¸¼ºµÇ¾î¾ßÇÕ´Ï´Ù(4~16ÀÚ, ¼ýÀÚ ÇÊ¿ä)", Application.ProductName); return; } if (!IsLetter(passwd)) //¹®ÀÚ { MessageBox.Show("ºñ¹Ð¹øÈ£´Â ¼ýÀÚ¿Í ¹®ÀÚÀÇ Á¶ÇÕÀ¸·Î ±¸¼ºµÇ¾î¾ßÇÕ´Ï´Ù(4~16ÀÚ, ¹®ÀÚ ÇÊ¿ä)", Application.ProductName); return; } } Util.ChkTxtBox(txtBuildingName, "°Ç¹°Ç¥½Ã¸í"); this.Cursor = Cursors.WaitCursor; this.configVO.Fire_accumulation_mode = chkFireAccumulationMode.Checked; this.configVO.Fire_accumulation_time = Util.StrToInt(cboFireAccumulationTime.SelectedValue, 0); this.configVO.Fire_process_mode = chkFireProcessMode.Checked; this.configVO.Master_user_id = txtMasterUserId.Text.Trim(); if (!passwd.Equals("1234567890")) { this.configVO.Master_password = passwd; } this.configVO.Building_name = txtBuildingName.Text.Trim(); //byte[] imgbytes = null; if (txtBackgroundImagePath.Text.Length > 0) { //imgbytes = fileByte(txtBackgroundImagePath.Text.Trim()); this.configVO.Background_image = txtBackgroundImagePath.Text.Trim(); //imgbytes; } // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ if (checkBox_JumpField.Checked == true) this.configVO.Jump_field_flag = "Y"; else this.configVO.Jump_field_flag = "N"; // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã if (checkBox_TestRunFlag.Checked == true) this.configVO.Test_run_flag = "Y"; else this.configVO.Test_run_flag = "N"; //ÃàÀû¸ðµå,ÃàÀû½Ã°£,È­Àç¸ðµå¸¸ º¯°æ¿©ºÎ¸¦ üũÇÏ¿© ¾´´Ù. if (mdi.MyConfigVO.Fire_accumulation_mode != this.configVO.Fire_accumulation_mode) chkConfigVoChange = true; if (mdi.MyConfigVO.Fire_accumulation_time != this.configVO.Fire_accumulation_time) chkConfigVoChange = true; if (mdi.MyConfigVO.Fire_process_mode != this.configVO.Fire_process_mode) chkConfigVoChange = true; // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ if (mdi.MyConfigVO.Jump_field_flag != this.configVO.Jump_field_flag) chkConfigVoChange = true; // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã if (mdi.MyConfigVO.Test_run_flag != this.configVO.Test_run_flag) chkConfigVoChange = true; //Àüüº¯°æ¿©ºÎ üũ chkConfigVoChangeAll = chkConfigVoChange; if (!mdi.MyConfigVO.Master_user_id.Equals(this.configVO.Master_user_id)) chkConfigVoChangeAll = true; if (!mdi.MyConfigVO.Master_password.Equals(this.configVO.Master_password)) chkConfigVoChangeAll = true; if (!mdi.MyConfigVO.Building_name.Equals(this.configVO.Building_name)) chkConfigVoChangeAll = true; if (!mdi.MyConfigVO.Background_image.Equals(this.configVO.Background_image)) chkConfigVoChangeAll = true; if (chkConfigVoChangeAll) { DacReceiverConfig dacReceiverConfig = new DacReceiverConfig(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ dacReceiverConfig.Config_Update(QUERYMode.InsertAndUpdate, mdi.myReceiverID , this.configVO.Fire_accumulation_mode ? "Y" : "N" , this.configVO.Fire_accumulation_time, this.configVO.Fire_process_mode ? "Y" : "N" , this.configVO.Sound_process_mode ? "Y" : "N" , this.configVO.Master_user_id, this.configVO.Master_password , this.configVO.Building_name, this.configVO.Background_image // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã , this.configVO.Test_run_flag // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã , this.configVO.Jump_field_flag); } //µ¥¸óÅë½Å if (chkConfigVoChange) { /***************************************************************/ /* ȯ°æ¼³Á¤º¯°æ¸í·É Progress Ç¥½Ã */ /***************************************************************/ frmProgress frm = new frmProgress(mdi); // cyim 2016.12.07 : ¼ö½Å±â ¸ðµ¨º° ³»ºÎ ·ÎÁ÷ º¯°æ //Áß°è±â ¼³Á¤ µ¥ÀÌÅ͸¦ CmdInfo¿¡ ³Ö¾îÁØ´Ù.. CmdInfo cmd = new CmdInfo(prt_cmd_define.read_command_status, mdi.myReceiverID, 1, 0, 0, null); cmd.CommandType = "CS"; cmd.ApplyRange = "A"; //Â÷´Ü·¹º§(ȸ·ÎŸÀÔÂ÷´Ü¿ë) A-All,C-Comm,B-Board,L-Loop,R-Áß°è±â,D-ȸ·Î,I-ÀÔ·Âȸ·Î,O-Ãâ·Âȸ·Î cmd.CommandData = this.configVO; //º¯°æµ¥ÀÌÅÍ-¸í·É frm.Commandinfo = cmd; frm.ConfigVoMy = this.mdi.MyConfigVO; //¿øº»µ¥ÀÌÅÍ-ºñ±³¸¦ À§ÇØ frm.ui = this.mdi.ui; frm.ShowDialog(); /**************************************************************/ } // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ DacFieldConfig dacfieldconfig = new DacFieldConfig(mdi.myReceiverID);// cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ if (this.checkBox_JumpField.Checked == true) mdi.MyConfigVO.Jump_field_flag = "Y"; else mdi.MyConfigVO.Jump_field_flag = "N"; dacfieldconfig.UpdateJumpField(mdi.myReceiverID, this.checkBox_JumpField.Checked); //ÀÚ½ÅÀÇ È¯°æÁ¤º¸µµ º¯°æÇÑ´Ù.. mdi.MyConfigVO = this.configVO; this.Cursor = Cursors.Default; //MessageBox.Show("ÀúÀå Àû¿ë µÇ¾ú½À´Ï´Ù.", Application.ProductName); // // cyim 2016.04.06 : °¨Áö±âÀÇ ³·½Ã°£´ë ¼³Á¤ // if (this.groupBox_TBDayTime.Visible == true) { DacReceiverConfig TB_DayTime = new DacReceiverConfig(mdi.MyReceiverID); if (TB_DayTime.TB_DAYTIME_Exist() != null && TB_DayTime.TB_DAYTIME_Exist().Count != 0) // óÀ½ Á¢±ÙÇÒ ´ç½Ã¿¡ ÇØ´ç Å×À̺íÀÌ ÀÖ´Ù¸é UI °¡ »õ·Î »ý±ä´Ù { TB_DayTime.TB_DAYTIME_Init(); TB_DayTime.TB_DAYTIME_Set( this.textBox_Start_Hour.Text, this.textBox_Start_Minute.Text, this.textBox_End_Hour.Text, this.textBox_End_Minute.Text); } } // cyim 2015.2.10 ¿îÀü¼³Á¤ Àû¿ëÇϱ⠽ÇÇà mdi.CommandLog(MappingStatus.Log, string.Format("¿îÀü¼³Á¤ Àû¿ë [ÃàÀû:{0}, ¸ðµå:{1}]", chkFireAccumulationMode.Text, chkFireProcessMode.Text)); MessageBox.Show("Àû¿ëµÇ¾ú½À´Ï´Ù.", Application.ProductName); } catch (Exception ex) { MessageBox.Show("½ÇÆÐÇÏ¿´½À´Ï´Ù.", Application.ProductName); 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); } } private byte[] fileByte(string path) { byte[] buffer = null; try { string fileName = path; if (fileName.Length > 0) { FileInfo file = new FileInfo(path); if (file.Exists) { FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); buffer = br.ReadBytes((int)fs.Length); br.Close(); fs.Close(); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } return buffer; } private void btnBackgroundImageSearch_Click(object sender, EventArgs e) { //'µð·ºÅ丮 Á¤º¸¸¦ °¡Á®¿À´Â ´ÙÀ̾î±×·¥À» ¿¬´Ù. try { string init_path = Application.StartupPath; FindImageFileDialog.InitialDirectory = init_path; FindImageFileDialog.Filter = "GIF À̹ÌÁö(*.gif)|*.gif|JPEG À̹ÌÁö(*.jpg,*.jpeg,*.jpe)|*.jpg,*.jpeg,*.jpe|BMP À̹ÌÁö(*.bmp)|*.bmp|¸ðµçÆÄÀÏ|*.*"; if (FindImageFileDialog.ShowDialog() == DialogResult.OK) { txtBackgroundImagePath.Text = FindImageFileDialog.FileName; } } 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); } } private void btnWinClose_Click(object sender, EventArgs e) { this.Close(); } // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã private void checkBox_TestRunFlag_CheckedChanged(object sender, EventArgs e) { if (this.checkBox_TestRunFlag.Checked == true) this.label_TestRunFlag.Visible = true; else this.label_TestRunFlag.Visible = false; } // // Hidden Key ¸¦ ÀÔ·Â // // cyim 2017.01.23 : Explorer ÇÁ·Î¼¼½º Á¦¾î ·çƾ Ãß°¡ private void label_ExplorerDisable_Click(object sender, EventArgs e) { if (_Data.FireDeskMode == false) _Diagnostics.taskkill_explorer(); } private void label_ExplorerEnable_Click(object sender, EventArgs e) { if (_Data.FireDeskMode == false) _Diagnostics.start_explorer(); } } }