using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; using System.Diagnostics; namespace FPER { // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ //ÀÔ·Âȸ·Î»óŰª Ãʱâ»óÅÂ(-1),°¨Áö(0),Á¤»ó(1),´Ü¼±(3),PreFire(4) public enum InputDeviceStatus { Init = -1, Use = 0, Normal = 1, Blocking = 3, PreFire = 4 } //Ãâ·Âȸ·Î»óŰª Ãʱâ»óÅÂ(-1),Ãâ·Â¾øÀ½(0),Ãâ·ÂÀÖÀ½(1),Â÷´Ü(3) public enum OutputDeviceStatus { Init = -1, NotWrite = 0, Write = 1, Blocking = 3 } //ÀÔ·ÂÃâ·Âȸ·Î »óÅ textÇ¥½Ã----------------------------------------------------½ÃÀÛ static public class DeviceStatusText { static public String InputText(InputDeviceStatus ins, bool cutFlag) { String toText = ""; try { if (cutFlag) { toText = "Â÷´Ü"; } else { switch (ins) { case InputDeviceStatus.Init: toText = " - "; break; case InputDeviceStatus.Use: toText = "°¨Áö"; break; case InputDeviceStatus.Normal: toText = "Á¤»ó"; break; case InputDeviceStatus.Blocking: toText = "´Ü¼±"; break; case InputDeviceStatus.PreFire: toText = "PreFire"; break; // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return toText; } static public String InputText(InputDeviceStatus ins, DeviceTypeInfo dev) {//sdkim, 2011.11.22, don't use device => ' - ' String toText = " - "; try { if (dev == null || !dev.UseFlag) { toText = " - "; } else if (dev.CutFlag) { toText = "Â÷´Ü"; } else { switch (ins) { case InputDeviceStatus.Init: toText = " - "; break; case InputDeviceStatus.Use: toText = "°¨Áö"; break; case InputDeviceStatus.Normal: toText = "Á¤»ó"; break; case InputDeviceStatus.Blocking: toText = "´Ü¼±"; break; case InputDeviceStatus.PreFire: // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ toText = "PreFire"; break; } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return toText; } static public String OutputText(OutputDeviceStatus outs, bool cutFlag) { String outText = ""; try { if (cutFlag) { outText = "Â÷´Ü"; } else { switch (outs) { case OutputDeviceStatus.NotWrite: outText = "Á¤»ó"; break; case OutputDeviceStatus.Write: outText = "Ãâ·Â"; break; case OutputDeviceStatus.Blocking: outText = "Â÷´Ü"; break; } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return outText; } static public String OutputText(OutputDeviceStatus outs, DeviceTypeInfo dev) {//sdkim, 2011.11.22, don't use device => ' - ' , ¾øÀ½ => ²¨Áü, Ãâ·Â => µ¿ÀÛ String outText = " - "; try { if (dev == null || !dev.UseFlag) { outText = " - "; } else if (dev.CutFlag) { outText = "Â÷´Ü"; } else { switch (outs) { case OutputDeviceStatus.NotWrite: outText = "²¨Áü"; break; case OutputDeviceStatus.Write: outText = "µ¿ÀÛ"; break; case OutputDeviceStatus.Blocking: outText = "Â÷´Ü"; break; } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return outText; } } //ÀÔ·ÂÃâ·Âȸ·Î »óÅ textÇ¥½Ã----------------------------------------------------³¡ /************************************************************************************************************************/ /* DataGridView¿¡ Áß°è±â Ç¥½Ã class -frmRepeaterGroup [½ÃÀÛ] */ /************************************************************************************************************************/ public class GridRepeater { DataGridViewCell repCell; //int repNo = -1; ImageList backmg; bool loopCutFlag = false; //Áß°è±âȸ·Î ¼³Á¤°ª RepeaterDeviceTypeInfo dev; //Áß°è±âȸ·Îµ¥ÀÌÅͰª RepeaterPointUnit unit = null; public RepeaterPointUnit Unit { get { return this.unit; } } //Áß°è±â »óŸ޼¼Áö String infoMessage = ""; public GridRepeater(DataGridViewCell repCell, ImageList backmg, int repNo) { try { this.repCell = repCell; this.backmg = backmg; //if (repNo <= 127) //{ this.repCell.Value = this.backmg.Images[0]; //Á¤»ó //} //else //{ // this.repCell.Value = this.backmg.Images[3]; //¾øÀ½ //} } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } // cyim 2015.7.2 Áß°è±â ¹× ȸ·Î ¼³Á¤°ª Áߺ¹·çƾ Á¦°Å, ÇÏ´ÜÄÚµå´Â dev º¯¼ö 󸮿Ü, Set_DeviceUnit ¿Í µ¿ÀÏÇϹǷΠ»èÁ¦Çعö¸² //Áß°è±â¹×ȸ·Î ¼³Á¤°ª ³Ö±â public void Set_DeviceInfo(RepeaterDeviceTypeInfo dev) { try { this.dev = dev; //if (this.dev == null) //{ // if (this.loopCutFlag) repCell.Value = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö // return; //} //if (this.dev.UseFlag) //{ // //Áß°è±âŸÀÔº° Ç¥½Ã // if (this.dev.RepeaterType.Equals("A")) repCell.Value = A_typeImage(); // else if (this.dev.RepeaterType.Equals("B")) repCell.Value = B_typeImage(); //} } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //Áß°è±â¹×ȸ·Î ÀÔ·Â,Ãâ·Â°ª ³Ö±â public void Set_DeviceUnit(RepeaterPointUnit unit) { try { this.unit = unit; this.reset = true; if (this.dev == null) { if (this.loopCutFlag) repCell.Value = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö return; } if (this.dev.UseFlag) { if (unit != null) { //Áß°è±âŸÀÔº° Ç¥½Ã if (this.dev.RepeaterType.Equals("A")) repCell.Value = A_typeImage(); else if (this.dev.RepeaterType.Equals("B")) repCell.Value = B_typeImage(); // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (this.dev.RepeaterType.Equals("C")) repCell.Value = C_typeImage(unit.AnalogDetecterValue_Input); else if (this.dev.RepeaterType.Equals("D")) repCell.Value = C_typeImage(unit.AnalogDetecterValue_Input); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //Debug.WriteLine("GridRepeater.Set_DeviceUnit()" + ex.Message); } } bool reset = true; //Áß°è±â¹×ȸ·Î ÀÔ·Â,Ãâ·Â°ª ³Ö±â public bool UpdateDeviceUnit(RepeaterData data) { bool ret = false; try { if (this.unit.UpdateData(data) || this.reset) { ret = true; this.reset = false; if (this.dev == null) { if (this.loopCutFlag) { //repCell.Value = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö repCell.Value = this.backmg.Images[1]; //Â÷´ÜÀ̹ÌÁö } return ret; } if (this.dev.UseFlag) { //Áß°è±âŸÀÔº° Ç¥½Ã if (this.dev.RepeaterType.Equals("A")) repCell.Value = this.A_typeImage(); else if (this.dev.RepeaterType.Equals("B")) repCell.Value = this.B_typeImage(); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //Debug.WriteLine("GridRepeater.Set_DeviceUnit()" + ex.Message); } return ret; } // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ // ¾Æ³¯·Î±× °¨Áö±â °ªÀ» ±âÁ¸ Áß°è±â ÀÔ·Â »óÅÂ¿Í ¸ÂÃâ¼ö°¡ ¾ø¾î¼­ °á±¹ UpdateData ÇÔ¼ö¸¦ º¯ÇüÇÔ. // UpdateData ´Â ÇÔ¼ö¿À¹ö·ÎµùµÇ¾îÀ־ ¾Æ³¯·Î±× ŸÀÔÀÎ °æ¿ì¿Í ±¸ºÐµÇµµ·Ï ·çƾÀ» º¯°æÇÑ´Ù //Áß°è±â¹×ȸ·Î ÀÔ·Â,Ãâ·Â°ª ³Ö±â public bool UpdateDeviceUnit(RepeaterData data, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { bool ret = false; try { if (this.unit.UpdateData(data, analogLevel, mdi) || this.reset) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { ret = true; this.reset = false; if (this.dev == null) { if (this.loopCutFlag) { //repCell.Value = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö repCell.Value = this.backmg.Images[1]; //Â÷´ÜÀ̹ÌÁö } return ret; } if (this.dev.UseFlag) { //Áß°è±âŸÀÔº° Ç¥½Ã if (this.dev.RepeaterType.Equals("A")) repCell.Value = this.A_typeImage(); else if (this.dev.RepeaterType.Equals("B")) repCell.Value = this.B_typeImage(); // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (this.dev.RepeaterType.Equals("C") || this.dev.RepeaterType.Equals("D")) repCell.Value = this.C_typeImage(data.AnalogDetecterValue_Input); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //Debug.WriteLine("GridRepeater.Set_DeviceUnit()" + ex.Message); } return ret; } public RepeaterDeviceTypeInfo DeviceInfo { get { return this.dev; } } public RepeaterPointUnit DeviceUnit { get { return this.unit; } } public String InfoMessage { get { return this.infoMessage; } } public bool LoopCutFlag { get { return this.loopCutFlag; } set { this.loopCutFlag = value; } } //Áß°è±â À̹ÌÁö Ç¥½Ã»ý¼º -- 2ȸ·Î private Image A_typeImage() { Point posIn1 = new Point(13, 8); Point posIn2 = new Point(13, 23); Point posOut1 = new Point(49, 8); Point posOut2 = new Point(49, 23); System.Drawing.Color StColor_in1 = System.Drawing.Color.Silver; System.Drawing.Color StColor_in2 = System.Drawing.Color.Silver; System.Drawing.Color StColor_out1 = System.Drawing.Color.Silver; System.Drawing.Color StColor_out2 = System.Drawing.Color.Silver; //Áß°è±â ÀÔÃâ·Â µ¥ÀÌÅÍ º° »ö»ó°ª if (this.unit != null) { StColor_in1 = InputValue(this.unit.Repeater_Input1, this.dev.getDeviceTypeInfo(1, "I")); StColor_in2 = InputValue(this.unit.Repeater_Input2, this.dev.getDeviceTypeInfo(2, "I")); StColor_out1 = OutputValue(this.unit.Repeater_Output1, this.dev.getDeviceTypeInfo(1, "O")); StColor_out2 = OutputValue(this.unit.Repeater_Output2, this.dev.getDeviceTypeInfo(2, "O")); } Bitmap bmp; //Áß°è±âÂ÷´Ü¿©ºÎ¿¡ µû¸¥ À̹ÌÁö if (this.dev.CutFlag || this.loopCutFlag) { bmp = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö this.infoMessage = "Â÷´ÜµÈ Áß°è±â"; // cyim 2015.2.16 Â÷´ÜµÈ Áß°è±â ¹®±¸·Î Á¶Á¤ } else { bmp = new Bitmap(this.backmg.Images[0]); //Á¤»óÀ̹ÌÁö if (this.unit != null) { if (this.unit.RepeaterNon == true) { bmp = new Bitmap(this.backmg.Images[3]); this.infoMessage = "Á¸ÀçÇÏÁö ¾Ê´Â Áß°è±â"; } else if (this.unit.RepeaterErr == true) { bmp = new Bitmap(this.backmg.Images[2]); //¿¡·¯À̹ÌÁö //2010.4.13_moon >0 -> == true this.infoMessage = "Áß°è±â Åë½Å ¿¡·¯"; } else if (this.unit.RepeaterR0 == true) { bmp = new Bitmap(this.backmg.Images[2]); //¿¡·¯À̹ÌÁö //2010.4.13_moon >0 -> == true this.infoMessage = "Áß°è±â Àü¿ø ÀÌ»ó"; } else { this.infoMessage = ""; } } } try { int Width = 12, Height = 12; // cyim 2015.6.19 ¼Óµµ°³¼±ÀÛ¾÷ : ÀÔ·Â1,2 Ãâ·Â1,2 FillRectangle(bmp, posIn1.X, posIn1.Y, Width, Height, StColor_in1); FillRectangle(bmp, posIn2.X, posIn2.Y, Width, Height, StColor_in2); FillRectangle(bmp, posOut1.X, posOut1.Y, Width, Height, StColor_out1); FillRectangle(bmp, posOut2.X, posOut2.Y, Width, Height, StColor_out2); ////ÀÔ·Â1 //for (int Xcount = posIn1.X; Xcount < posIn1.X + Width; Xcount++) // for (int Ycount = posIn1.Y; Ycount < posIn1.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_in1); ////ÀÔ·Â2 //for (int Xcount = posIn2.X; Xcount < posIn2.X + Width; Xcount++) // for (int Ycount = posIn2.Y; Ycount < posIn2.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_in2); ////Ãâ·Â1 //for (int Xcount = posOut1.X; Xcount < posOut1.X + Width; Xcount++) // for (int Ycount = posOut1.Y; Ycount < posOut1.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_out1); ////Ãâ·Â2 //for (int Xcount = posOut2.X; Xcount < posOut2.X + Width; Xcount++) // for (int Ycount = posOut2.Y; Ycount < posOut2.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_out2); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return bmp; } //Áß°è±â À̹ÌÁö Ç¥½Ã»ý¼º --4ȸ·Î private Image B_typeImage() { Point posIn1 = new Point(6, 9); Point posIn2 = new Point(20, 9); Point posIn3 = new Point(6, 23); Point posIn4 = new Point(20, 23); Point posOut1 = new Point(43, 9); Point posOut2 = new Point(57, 9); Point posOut3 = new Point(43, 23); Point posOut4 = new Point(57, 23); System.Drawing.Color StColor_in1 = System.Drawing.Color.Silver; System.Drawing.Color StColor_in2 = System.Drawing.Color.Silver; System.Drawing.Color StColor_in3 = System.Drawing.Color.Silver; System.Drawing.Color StColor_in4 = System.Drawing.Color.Silver; System.Drawing.Color StColor_out1 = System.Drawing.Color.Silver; System.Drawing.Color StColor_out2 = System.Drawing.Color.Silver; System.Drawing.Color StColor_out3 = System.Drawing.Color.Silver; System.Drawing.Color StColor_out4 = System.Drawing.Color.Silver; //Áß°è±â ÀÔÃâ·Â µ¥ÀÌÅÍ º° »ö»ó°ª if (this.unit != null) { StColor_in1 = InputValue(this.unit.Repeater_Input1, this.dev.getDeviceTypeInfo(1, "I")); StColor_in2 = InputValue(this.unit.Repeater_Input2, this.dev.getDeviceTypeInfo(2, "I")); StColor_in3 = InputValue(this.unit.Repeater_Input3, this.dev.getDeviceTypeInfo(3, "I")); StColor_in4 = InputValue(this.unit.Repeater_Input4, this.dev.getDeviceTypeInfo(4, "I")); StColor_out1 = OutputValue(this.unit.Repeater_Output1, this.dev.getDeviceTypeInfo(1, "O")); StColor_out2 = OutputValue(this.unit.Repeater_Output2, this.dev.getDeviceTypeInfo(2, "O")); StColor_out3 = OutputValue(this.unit.Repeater_Output3, this.dev.getDeviceTypeInfo(3, "O")); StColor_out4 = OutputValue(this.unit.Repeater_Output4, this.dev.getDeviceTypeInfo(4, "O")); } Bitmap bmp; //Áß°è±âÂ÷´Ü¿©ºÎ¿¡ µû¸¥ À̹ÌÁö if (this.dev.CutFlag || this.loopCutFlag) { bmp = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö this.infoMessage = "Â÷´ÜµÈ Áß°è±â"; // cyim 2015.2.16 Â÷´ÜµÈ Áß°è±â ¹®±¸·Î Á¶Á¤ } else { bmp = new Bitmap(this.backmg.Images[0]); //Á¤»óÀ̹ÌÁö if (this.unit != null) { if (this.unit.RepeaterNon == true) { bmp = new Bitmap(this.backmg.Images[3]); this.infoMessage = "Á¸ÀçÇÏÁö ¾Ê´Â Áß°è±â"; } else if (this.unit.RepeaterErr == true) { bmp = new Bitmap(this.backmg.Images[2]); //¿¡·¯À̹ÌÁö //2010.4.13_moon >0 -> == true this.infoMessage = "Áß°è±â Åë½Å ¿¡·¯"; } else if (this.unit.RepeaterR0 == true) { bmp = new Bitmap(this.backmg.Images[2]); //¿¡·¯À̹ÌÁö //2010.4.13_moon >0 -> == true this.infoMessage = "Áß°è±â Àü¿ø ÀÌ»ó"; } else { this.infoMessage = ""; } } } try { int Width = 12, Height = 12; // cyim 2015.6.19 ¼Óµµ°³¼±ÀÛ¾÷ : //ÀÔ·Â1,2,3,4 Ãâ·Â1,2,3,4 FillRectangle(bmp, posIn1.X, posIn1.Y, Width, Height, StColor_in1); FillRectangle(bmp, posIn2.X, posIn2.Y, Width, Height, StColor_in2); FillRectangle(bmp, posIn3.X, posIn3.Y, Width, Height, StColor_in3); FillRectangle(bmp, posIn4.X, posIn4.Y, Width, Height, StColor_in4); FillRectangle(bmp, posOut1.X, posOut1.Y, Width, Height, StColor_out1); FillRectangle(bmp, posOut2.X, posOut2.Y, Width, Height, StColor_out2); FillRectangle(bmp, posOut3.X, posOut3.Y, Width, Height, StColor_out3); FillRectangle(bmp, posOut4.X, posOut4.Y, Width, Height, StColor_out4); ////ÀÔ·Â1--»ö»óÇ¥½Ã //for (int Xcount = posIn1.X; Xcount < posIn1.X + Width; Xcount++) // for (int Ycount = posIn1.Y; Ycount < posIn1.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_in1); ////ÀÔ·Â2--»ö»óÇ¥½Ã //for (int Xcount = posIn2.X; Xcount < posIn2.X + Width; Xcount++) // for (int Ycount = posIn2.Y; Ycount < posIn2.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_in2); ////ÀÔ·Â3--»ö»óÇ¥½Ã //for (int Xcount = posIn3.X; Xcount < posIn3.X + Width; Xcount++) // for (int Ycount = posIn3.Y; Ycount < posIn3.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_in3); ////ÀÔ·Â4--»ö»óÇ¥½Ã //for (int Xcount = posIn4.X; Xcount < posIn4.X + Width; Xcount++) // for (int Ycount = posIn4.Y; Ycount < posIn4.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_in4); ////Ãâ·Â1--»ö»óÇ¥½Ã //for (int Xcount = posOut1.X; Xcount < posOut1.X + Width; Xcount++) // for (int Ycount = posOut1.Y; Ycount < posOut1.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_out1); ////Ãâ·Â2--»ö»óÇ¥½Ã //for (int Xcount = posOut2.X; Xcount < posOut2.X + Width; Xcount++) // for (int Ycount = posOut2.Y; Ycount < posOut2.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_out2); ////Ãâ·Â3--»ö»óÇ¥½Ã //for (int Xcount = posOut3.X; Xcount < posOut3.X + Width; Xcount++) // for (int Ycount = posOut3.Y; Ycount < posOut3.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_out3); ////Ãâ·Â4--»ö»óÇ¥½Ã //for (int Xcount = posOut4.X; Xcount < posOut4.X + Width; Xcount++) // for (int Ycount = posOut4.Y; Ycount < posOut4.Y + Height; Ycount++) // bmp.SetPixel(Xcount, Ycount, StColor_out4); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return bmp; } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ // '1' = A : 2X2 // '2' = B : 4X4 // '4' = C : ¾Æ³¯·Î±×¿¬°¨Áö±â // '5' = D : ¾Æ³¯·Î±×¿­°¨Áö±â private Image C_typeImage(int AnalogDetecterValue_Input) { //Point posIn1 = new Point(3,3); Point posIn1 = new Point(6, 9); System.Drawing.Color StColor_in1 = System.Drawing.Color.Silver; //Áß°è±â ÀÔÃâ·Â µ¥ÀÌÅÍ º° »ö»ó°ª if (this.unit != null) { StColor_in1 = AnalogInputValue(this.unit.Repeater_Input1, this.dev.getDeviceTypeInfo(1, "I")); } Bitmap bmp; //Áß°è±âÂ÷´Ü¿©ºÎ¿¡ µû¸¥ À̹ÌÁö if (this.dev.CutFlag || this.loopCutFlag) { bmp = new Bitmap(this.backmg.Images[1]); //Â÷´ÜÀ̹ÌÁö this.infoMessage = "Â÷´ÜµÈ °¨Áö±â"; // cyim 2015.2.16 Â÷´ÜµÈ Áß°è±â ¹®±¸·Î Á¶Á¤ // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â ¹®±¸·Î ¼öÁ¤ } else { bmp = new Bitmap(this.backmg.Images[0]); //Á¤»óÀ̹ÌÁö if (this.unit != null) { if (this.unit.RepeaterNon == true) { bmp = new Bitmap(this.backmg.Images[3]); this.infoMessage = "Á¸ÀçÇÏÁö ¾Ê´Â °¨Áö±â"; // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â ¹®±¸·Î ¼öÁ¤ StColor_in1 = System.Drawing.Color.Silver; // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â Åë½ÅÀÌ»ó, Á¸ÀçÇÏÁö¾ÊÀ½, Àü¿øÀÌ»ó ȸ»öÇ¥½Ã ÇÏ°í ±ÛÀÚ Ç¥½Ã¾ÈÇÔ } else if (this.unit.RepeaterErr == true) { bmp = new Bitmap(this.backmg.Images[2]); //¿¡·¯À̹ÌÁö //2010.4.13_moon >0 -> == true this.infoMessage = "°¨Áö±â Åë½Å ¿¡·¯"; // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â ¹®±¸·Î ¼öÁ¤ StColor_in1 = System.Drawing.Color.Silver; // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â Åë½ÅÀÌ»ó, Á¸ÀçÇÏÁö¾ÊÀ½, Àü¿øÀÌ»ó ȸ»öÇ¥½Ã ÇÏ°í ±ÛÀÚ Ç¥½Ã¾ÈÇÔ } else if (this.unit.RepeaterR0 == true) { bmp = new Bitmap(this.backmg.Images[2]); //¿¡·¯À̹ÌÁö //2010.4.13_moon >0 -> == true this.infoMessage = "°¨Áö±â Àü¿ø ÀÌ»ó"; // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â ¹®±¸·Î ¼öÁ¤ StColor_in1 = System.Drawing.Color.Silver; // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â Åë½ÅÀÌ»ó, Á¸ÀçÇÏÁö¾ÊÀ½, Àü¿øÀÌ»ó ȸ»öÇ¥½Ã ÇÏ°í ±ÛÀÚ Ç¥½Ã¾ÈÇÔ } else { this.infoMessage = ""; } } } try { //int Width = 68 , Height = 37; int Width = 62, Height = 25; //ÀÔ·Â1 FillRectangle(bmp, posIn1.X, posIn1.Y, Width, Height, StColor_in1, AnalogDetecterValue_Input); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return bmp; } // cyim 2015.6.19 ¼Óµµ°³¼±ÀÛ¾÷ // ±âÁ¸ ÄÚµå´Â Çȼ¿·Î Á¡À» Âï´Â ÄÚµå·Î ±¸¼ºµÇ¾î ÀÖ´Ù. // ¼Óµµ °³¼±À» À§ÇØ ¿µ¿ªÀ¸·Î »ö»óÀ» Ä¥Çϵµ·Ï ¼öÁ¤ÇÑ´Ù private void FillRectangle(Bitmap bmp, int x, int y, int w, int h, Color color) { Graphics gBuffer = Graphics.FromImage(bmp); SolidBrush cbrush = new SolidBrush(color); Rectangle rect = new Rectangle(x, y, w, h); gBuffer.FillRectangle(cbrush, rect); } // cyim 2015.7.2 ¾Æ³¯·Î±×°¨Áö±â °ª Ç¥½Ã (³»ºÎ ÅØ½ºÆ®) private void FillRectangle(Bitmap bmp, int x, int y, int w, int h, Color color, int AnalogDetecterValue) { Graphics gBuffer = Graphics.FromImage(bmp); SolidBrush cbrush = new SolidBrush(color); Rectangle rect = new Rectangle(x, y, w, h); gBuffer.FillRectangle(cbrush, rect); // ¾Æ³¯·Î±× °¨Áö±âÀÇ °æ¿ì »ö»óÀ» Ä¥ÇÏ°í º°µµ·Î ÇöÀç°ªÀ» Ç¥½ÃÇØ¾ß ÇÑ´Ù. À̶§ ±ÛÀÚ´Â °ËÁ¤ÀÌÁö¸¸, ´Ü¼±ÀÇ °æ¿ì Èò»öÀ¸·Î Ç¥½ÃÇϵµ·Ï ÇÑ´Ù if (color == Color.Black) cbrush = new SolidBrush(Color.White); // cyim 2016.01.07 ¾Æ³¯·Î±× °¨Áö±â Åë½ÅÀÌ»ó, Á¸ÀçÇÏÁö¾ÊÀ½, Àü¿øÀÌ»ó ȸ»öÇ¥½Ã ÇÏ°í ±ÛÀÚ Ç¥½Ã¾ÈÇÔ else if (color == Color.Silver) cbrush = new SolidBrush(Color.Silver); else cbrush = new SolidBrush(Color.Black); gBuffer.DrawString( string.Format("{0:000}", AnalogDetecterValue), new System.Drawing.Font("±¼¸²", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point), cbrush, new PointF(22, 13)); } //ÀԷ°ªº° »óÅ»ö»ó //private Color InputValue(InputDeviceStatus inputValue) //{ // System.Drawing.Color StColor_in = System.Drawing.Color.Silver; // try // { // //if (inputValue != null) // //{ // switch (inputValue) // { // case InputDeviceStatus.Init: StColor_in = System.Drawing.Color.Silver; break; //Ãʱâ // case InputDeviceStatus.Blocking: StColor_in = System.Drawing.Color.Black; break; //Â÷´Ü // case InputDeviceStatus.Normal: StColor_in = System.Drawing.Color.Lime; break; //Á¤»ó // case InputDeviceStatus.Use: StColor_in = System.Drawing.Color.Red; break; //°¨Áö // } // //} // } // catch (Exception ex) // { // Util.UErrorMessage(ex, 0, 0); // } // return StColor_in; //} //ÀԷ°ªº° »óÅ»ö»ó private Color InputValue(InputDeviceStatus inputValue, DeviceTypeInfo d) { System.Drawing.Color StColor_in = System.Drawing.Color.Silver; try { if (d == null) { StColor_in = System.Drawing.Color.Silver; } else { switch (inputValue) { case InputDeviceStatus.Init: StColor_in = System.Drawing.Color.Silver; break; //Ãʱâ case InputDeviceStatus.Blocking: StColor_in = System.Drawing.Color.Black; break; //Â÷´Ü case InputDeviceStatus.Normal: StColor_in = System.Drawing.Color.Lime; break; //Á¤»ó case InputDeviceStatus.Use: // ¼³ºñ¿Í È­Àç´Â »ö»óÀÌ Æ²¸®´Ù if (d.DeviceType == "IC") { StColor_in = System.Drawing.Color.Blue; //ÀÛµ¿ } else { StColor_in = System.Drawing.Color.Red; //°¨Áö } break; } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return StColor_in; } // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ private Color AnalogInputValue(InputDeviceStatus inputValue, DeviceTypeInfo d) { System.Drawing.Color StColor_in = System.Drawing.Color.Silver; try { if (d == null) { StColor_in = System.Drawing.Color.Silver; } else { switch (inputValue) { //Ãʱâ case InputDeviceStatus.Init: StColor_in = System.Drawing.Color.Silver; break; // ´Ü¼± (falut) case InputDeviceStatus.Blocking: StColor_in = System.Drawing.Color.Black; break; //Á¤»ó case InputDeviceStatus.Normal: StColor_in = System.Drawing.Color.Lime; break; //È­Àç case InputDeviceStatus.Use: StColor_in = System.Drawing.Color.Red; break; // PreFire case InputDeviceStatus.PreFire: StColor_in = System.Drawing.Color.HotPink; break; } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return StColor_in; } //Ãâ·Â°ªº° »óÅ»ö»ó //private Color OutputValue(OutputDeviceStatus outputValue) //{ // System.Drawing.Color StColor_out = System.Drawing.Color.Silver; // try // { // //if (outputValue != null) // //{ // switch (outputValue) // { // case OutputDeviceStatus.Init: StColor_out = System.Drawing.Color.Silver; break; //Ãʱâ // case OutputDeviceStatus.Blocking: StColor_out = System.Drawing.Color.Black; break; //Â÷´Ü // case OutputDeviceStatus.NotWrite: StColor_out = System.Drawing.Color.Green; break; //Ãâ·Â¾øÀ½ // case OutputDeviceStatus.Write: StColor_out = System.Drawing.Color.Firebrick; break; //Ãâ·ÂÀÖÀ½ // } // //} // } // catch (Exception ex) // { // Util.UErrorMessage(ex, 0, 0); // } // return StColor_out; //} //Ãâ·Â°ªº° »óÅ»ö»ó private Color OutputValue(OutputDeviceStatus outputValue, DeviceTypeInfo d) { System.Drawing.Color StColor_out = System.Drawing.Color.Silver; try { //if (outputValue != null) //{ if (d == null) // ¼³Á¤ ¾øÀ½. { StColor_out = System.Drawing.Color.Silver; } else { switch (outputValue) { case OutputDeviceStatus.Init: // Ãʱâ StColor_out = System.Drawing.Color.Silver; break; case OutputDeviceStatus.Blocking: // Â÷´Ü StColor_out = System.Drawing.Color.Black; break; case OutputDeviceStatus.NotWrite: // Ãâ·Â¾øÀ½ StColor_out = System.Drawing.Color.Green; break; case OutputDeviceStatus.Write: // Ãâ·Â StColor_out = System.Drawing.Color.Firebrick; break; } } //} } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return StColor_out; } } /************************************************************************************************************************/ /* DataGridView¿¡ Áß°è±â Ç¥½Ã class -frmRepeaterGroup [³¡] */ /************************************************************************************************************************/ /***************************************************************************************************************** /* ¼ö½Å±â¼³Á¤°ª [½ÃÀÛ]*/ /*****************************************************************************************************************/ public class ReceiverTypeInfo { private int receiverNo = -1; //¼ö½Å±âID private Boolean frontLoop_UseFlag = true; //frontLoop »ç¿ë¿©ºÎ private Boolean backLoop_UseFlag = true; //backLoop »ç¿ë¿©ºÎ private Boolean io_UseFlag = true; //ioº¸µå »ç¿ë¿©ºÎ private Boolean keypad_UseFlag = true; //keypad »ç¿ë¿©ºÎ // cyim 2017.01.12 : IFC3300 Àº Åë½Åº¸µå 0¹øÀÌ Á¸ÀçÇÑ´Ù // cyim 2016.11.03 : Åë½Åº¸µå(Áß°è¹Ý)´Â ÃÖ´ë 64 private BoardTypeInfo[] myBoardType = new BoardTypeInfo[65]; //Åë½Åº¸µå¼³Á¤°ª public ReceiverTypeInfo(int receiverNo) { try { this.receiverNo = receiverNo; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public int ReceiverNo { get { return this.receiverNo; } } public Boolean FrontLoop_UseFlag { get { return this.frontLoop_UseFlag; } set { this.frontLoop_UseFlag = value; } } public Boolean BackLoop_UseFlag { get { return this.backLoop_UseFlag; } set { this.backLoop_UseFlag = value; } } public Boolean Io_UseFlag { get { return this.io_UseFlag; } set { this.io_UseFlag = value; } } public Boolean Keypad_UseFlag { get { return this.keypad_UseFlag; } set { this.keypad_UseFlag = value; } } public BoardTypeInfo[] MyBoardType { get { return this.myBoardType; } set { this.myBoardType = value; } } //Åë½Åº¸µå¼³Á¤°ª //°³º°Åë½Åº¸µå ¼³Á¤°ª ³Ö±â public void Set_RepeaterType(BoardTypeInfo info) { try { this.myBoardType[info.BoardNo - 1] = info; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //°³º°Åë½Åº¸µå ¼³Á¤°ª Àбâ public BoardTypeInfo Get_RepeaterType(int boardNo) { BoardTypeInfo info = null; try { info = this.myBoardType[boardNo - 1]; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return info; } } /*****************************************************************************************************************/ /* ¼ö½Å±â¼³Á¤°ª [³¡] */ /*****************************************************************************************************************/ // cyim 2016.10.31 : ´ë¿ë·® ¼ö½Å±â¿ë UI º¯°æ /************************************************************************************************************************/ /* Åë½Åº¸µå¼³Á¤°ª [½ÃÀÛ] */ /************************************************************************************************************************/ public class BoardTypeInfo { private int boardNo = -1; //Åë½Åº¸µåNo private Boolean loop0UseFlag = false; //loop 0 »ç¿ë¿©ºÎ private Boolean loop1UseFlag = false; //loop 1 »ç¿ë¿©ºÎ private Boolean loop2UseFlag = false; //loop 0 »ç¿ë¿©ºÎ private Boolean loop3UseFlag = false; //loop 1 »ç¿ë¿©ºÎ private Boolean useFlag = false; //Åë½Åº¸µå »ç¿ë¿©ºÎ private Boolean loop0CutFlag = false; //loop 0 Â÷´Ü¿©ºÎ private Boolean loop1CutFlag = false; //loop 1 Â÷´Ü¿©ºÎ private Boolean loop2CutFlag = false; //loop 0 Â÷´Ü¿©ºÎ private Boolean loop3CutFlag = false; //loop 1 Â÷´Ü¿©ºÎ private Boolean loop0CutFlag_change = false; //loop 0 Â÷´Ü¿©ºÎ º¯°æ¿©ºÎ private Boolean loop1CutFlag_change = false; //loop 1 Â÷´Ü¿©ºÎ º¯°æ¿©ºÎ private Boolean loop2CutFlag_change = false; //loop 2 Â÷´Ü¿©ºÎ º¯°æ¿©ºÎ private Boolean loop3CutFlag_change = false; //loop 3 Â÷´Ü¿©ºÎ º¯°æ¿©ºÎ private RepeaterDeviceTypeInfo[] loop0_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 0 ÀÇ 127°³ Áß°è±â¹×ȸ·Î ¼³Á¤Á¤º¸ private RepeaterDeviceTypeInfo[] loop1_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 1 ÀÇ 127°³ Áß°è±â¹×ȸ·Î ¼³Á¤Á¤º¸ private RepeaterDeviceTypeInfo[] loop2_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 2 ÀÇ 127°³ Áß°è±â¹×ȸ·Î ¼³Á¤Á¤º¸ private RepeaterDeviceTypeInfo[] loop3_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 3 ÀÇ 127°³ Áß°è±â¹×ȸ·Î ¼³Á¤Á¤º¸ private RepeaterPointUnit[] loop0_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 0 ÀÇ 127°³ Áß°è±â¹×ȸ·Î µ¥ÀÌÅͰª private RepeaterPointUnit[] loop1_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 1 ÀÇ 127°³ Áß°è±â¹×ȸ·Î µ¥ÀÌÅͰª private RepeaterPointUnit[] loop2_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 2 ÀÇ 127°³ Áß°è±â¹×ȸ·Î µ¥ÀÌÅͰª private RepeaterPointUnit[] loop3_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 3 ÀÇ 127°³ Áß°è±â¹×ȸ·Î µ¥ÀÌÅͰª public BoardTypeInfo(int boardNo) { try { this.boardNo = boardNo; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public BoardTypeInfo(int boardNo, Boolean useFlag, Boolean loop0UseFlag, Boolean loop1UseFlag, Boolean loop2UseFlag, Boolean loop3UseFlag) { try { this.boardNo = boardNo; this.useFlag = useFlag; this.loop0UseFlag = loop0UseFlag; this.loop1UseFlag = loop1UseFlag; this.loop2UseFlag = loop2UseFlag; this.loop3UseFlag = loop3UseFlag; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public int BoardNo { get { return this.boardNo; } } public Boolean UseFlag { get { return this.useFlag; } set { this.useFlag = value; } } public Boolean Loop0UseFlag { get { return this.loop0UseFlag; } set { this.loop0UseFlag = value; } } public Boolean Loop1UseFlag { get { return this.loop1UseFlag; } set { this.loop1UseFlag = value; } } public Boolean Loop2UseFlag { get { return this.loop2UseFlag; } set { this.loop2UseFlag = value; } } public Boolean Loop3UseFlag { get { return this.loop3UseFlag; } set { this.loop3UseFlag = value; } } public Boolean Loop0CutFlag { get { return this.loop0CutFlag; } set { this.loop0CutFlag = value; } } public Boolean Loop1CutFlag { get { return this.loop1CutFlag; } set { this.loop1CutFlag = value; } } public Boolean Loop2CutFlag { get { return this.loop2CutFlag; } set { this.loop2CutFlag = value; } } public Boolean Loop3CutFlag { get { return this.loop3CutFlag; } set { this.loop3CutFlag = value; } } public RepeaterDeviceTypeInfo[] Loop0_RepeaterType { get { return this.loop0_RepeaterType; } set { this.loop0_RepeaterType = value; } } public RepeaterDeviceTypeInfo[] Loop1_RepeaterType { get { return this.loop1_RepeaterType; } set { this.loop1_RepeaterType = value; } } public RepeaterDeviceTypeInfo[] Loop2_RepeaterType { get { return this.loop2_RepeaterType; } set { this.loop2_RepeaterType = value; } } public RepeaterDeviceTypeInfo[] Loop3_RepeaterType { get { return this.loop3_RepeaterType; } set { this.loop3_RepeaterType = value; } } public RepeaterPointUnit[] Loop0_RepeaterUnit_Data { get { return this.loop0_RepeaterUnit_Data; } set { this.loop0_RepeaterUnit_Data = value; } } public RepeaterPointUnit[] Loop1_RepeaterUnit_Data { get { return this.loop1_RepeaterUnit_Data; } set { this.loop1_RepeaterUnit_Data = value; } } public RepeaterPointUnit[] Loop2_RepeaterUnit_Data { get { return this.loop2_RepeaterUnit_Data; } set { this.loop2_RepeaterUnit_Data = value; } } public RepeaterPointUnit[] Loop3_RepeaterUnit_Data { get { return this.loop3_RepeaterUnit_Data; } set { this.loop3_RepeaterUnit_Data = value; } } public void Loop0CutFlagChangeReset() { try { loop0CutFlag_change = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void Loop1CutFlagChangeReset() { try { loop1CutFlag_change = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void Loop2CutFlagChangeReset() { try { loop2CutFlag_change = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void Loop3CutFlagChangeReset() { try { loop3CutFlag_change = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public Boolean Loop0CutFlagChange { get { return this.loop0CutFlag_change; } set { bool cutFlag = value; //Â÷´Ü¼³Á¤µ¥ÀÌÅÍ º¯°æ¿©ºÎ¸¦ ÀúÀåÇÑ´Ù. if (this.loop0CutFlag != cutFlag) loop0CutFlag_change = true; this.loop0CutFlag = value; } } public Boolean Loop1CutFlagChange { get { return this.loop1CutFlag_change; } set { bool cutFlag = value; //Â÷´Ü¼³Á¤µ¥ÀÌÅÍ º¯°æ¿©ºÎ¸¦ ÀúÀåÇÑ´Ù. if (this.loop1CutFlag != cutFlag) loop1CutFlag_change = true; this.loop1CutFlag = value; } } public Boolean Loop2CutFlagChange { get { return this.loop2CutFlag_change; } set { bool cutFlag = value; //Â÷´Ü¼³Á¤µ¥ÀÌÅÍ º¯°æ¿©ºÎ¸¦ ÀúÀåÇÑ´Ù. if (this.loop2CutFlag != cutFlag) loop2CutFlag_change = true; this.loop2CutFlag = value; } } public Boolean Loop3CutFlagChange { get { return this.loop3CutFlag_change; } set { bool cutFlag = value; //Â÷´Ü¼³Á¤µ¥ÀÌÅÍ º¯°æ¿©ºÎ¸¦ ÀúÀåÇÑ´Ù. if (this.loop3CutFlag != cutFlag) loop3CutFlag_change = true; this.loop3CutFlag = value; } } } /************************************************************************************************************************/ /* Åë½Åº¸µå¼³Á¤°ª [³¡] */ /************************************************************************************************************************/ /************************************************************************************************************************/ /* Áß°è±âȸ·Î¼³Á¤°ª -frmReceiverConfig [½ÃÀÛ] */ /************************************************************************************************************************/ public class RepeaterDeviceTypeInfo { int repeaterNo = -1; DeviceTypeInfo[] inDeviceTypeInfo; DeviceTypeInfo[] outDeviceTypeInfo; //String[] intype = new String[4]; //ȸ·ÎŸÀÔ [TB_DEVICE_TYPE , SYMBOL_TYPE = "I"Àΰæ¿ì] //String[] intypeName = new String[4]; //ȸ·Î ¼³¸í(ÀÔ·Â) //Boolean[] inCutFlag = new Boolean[4]; //ȸ·ÎÂ÷´Ü ¼³Á¤(ÀÔ·Â) //String[] outtype = new String[4]; //ȸ·ÎŸÀÔ [TB_DEVICE_TYPE , SYMBOL_TYPE = "O"Àΰæ¿ì] //String[] outtypeName = new String[4]; //ȸ·ÎŸÀÔ ¼³¸í(Ãâ·Â) //Boolean[] outCutFlag = new Boolean[4]; //ȸ·ÎÂ÷´Ü ¼³Á¤(Ãâ·Â) // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ // '1' = A : 2X2 // '2' = B : 4X4 // '4' = C : ¾Æ³¯·Î±×¿¬°¨Áö±â // '5' = D : ¾Æ³¯·Î±×¿­°¨Áö±â String repeaterType = ""; Boolean cutFlag = false; //Áß°è±â Â÷´Ü¿©ºÎ Boolean useFlag = false; //Áß°è±â »ç¿ë¿©ºÎ Boolean cutFlag_change = false; //Áß°è±â Â÷´Ü¿©ºÎ ¼³Á¤ º¯°æ ¿©ºÎ Boolean fireResetFlag = false; //ºñÈ­À纸ȣ±â´É public void CutFlagChangeReset() { try { cutFlag_change = false; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public Boolean CutFlagChange { get { return this.cutFlag_change; } set { bool cutFlag = value; //Â÷´Ü¼³Á¤µ¥ÀÌÅÍ º¯°æ¿©ºÎ¸¦ ÀúÀåÇÑ´Ù. if (this.cutFlag != cutFlag) cutFlag_change = true; this.cutFlag = value; } } public RepeaterDeviceTypeInfo(int repeaterNo) { try { this.repeaterNo = repeaterNo; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public RepeaterDeviceTypeInfo(int repeaterNo, String repeaterType) { try { this.repeaterNo = repeaterNo; this.repeaterType = repeaterType; this.useFlag = true; if (repeaterType.Equals("A")) { this.inDeviceTypeInfo = new DeviceTypeInfo[2]; this.outDeviceTypeInfo = new DeviceTypeInfo[2]; } else if (repeaterType.Equals("B")) { this.inDeviceTypeInfo = new DeviceTypeInfo[4]; this.outDeviceTypeInfo = new DeviceTypeInfo[4]; } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (repeaterType.Equals("C") || repeaterType.Equals("D")) { this.inDeviceTypeInfo = new DeviceTypeInfo[1]; this.outDeviceTypeInfo = new DeviceTypeInfo[1]; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public RepeaterDeviceTypeInfo(int repeaterNo, String repeaterType, Boolean cutFlag) { try { this.repeaterNo = repeaterNo; this.repeaterType = repeaterType; this.cutFlag = cutFlag; this.useFlag = true; if (repeaterType.Equals("A")) { this.inDeviceTypeInfo = new DeviceTypeInfo[2]; this.outDeviceTypeInfo = new DeviceTypeInfo[2]; } else if (repeaterType.Equals("B")) { this.inDeviceTypeInfo = new DeviceTypeInfo[4]; this.outDeviceTypeInfo = new DeviceTypeInfo[4]; } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (repeaterType.Equals("C") || repeaterType.Equals("D")) { this.inDeviceTypeInfo = new DeviceTypeInfo[1]; this.outDeviceTypeInfo = new DeviceTypeInfo[1]; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void setInputDeviceTypeInfo(int deviceNo, String deviceType, String deviceName, String positionCode, Boolean cutFlag) { try { if (this.inDeviceTypeInfo == null) return; if (this.inDeviceTypeInfo[deviceNo - 1] == null) this.inDeviceTypeInfo[deviceNo - 1] = new DeviceTypeInfo(deviceNo); this.inDeviceTypeInfo[deviceNo - 1].DeviceType = deviceType; this.inDeviceTypeInfo[deviceNo - 1].DeviceName = deviceName; this.inDeviceTypeInfo[deviceNo - 1].PositionCode = positionCode; this.inDeviceTypeInfo[deviceNo - 1].CutFlag = cutFlag; this.inDeviceTypeInfo[deviceNo - 1].UseFlag = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public void setOutputDeviceTypeInfo(int deviceNo, String deviceType, String deviceName, String positionCode, Boolean cutFlag) { try { if (this.outDeviceTypeInfo == null) return; if (this.outDeviceTypeInfo[deviceNo - 1] == null) this.outDeviceTypeInfo[deviceNo - 1] = new DeviceTypeInfo(deviceNo); this.outDeviceTypeInfo[deviceNo - 1].DeviceType = deviceType; this.outDeviceTypeInfo[deviceNo - 1].DeviceName = deviceName; this.outDeviceTypeInfo[deviceNo - 1].PositionCode = positionCode; this.outDeviceTypeInfo[deviceNo - 1].CutFlag = cutFlag; this.outDeviceTypeInfo[deviceNo - 1].UseFlag = true; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public int RepeaterNo { get { return this.repeaterNo; } set { this.repeaterNo = value; } } public bool FireResetFlag { get { return this.fireResetFlag; } set { this.fireResetFlag = value; } } //public String InType1 { get { return this.intype[0]; } set { this.intype[0] = value; } } //public String InType2 { get { return this.intype[1]; } set { this.intype[1] = value; } } //public String InType3 { get { return this.intype[2]; } set { this.intype[2] = value; } } //public String InType4 { get { return this.intype[3]; } set { this.intype[3] = value; } } //public String InTypeName1 { get { return this.intypeName[0]; } set { this.intypeName[0] = value; } } //public String InTypeName2 { get { return this.intypeName[1]; } set { this.intypeName[1] = value; } } //public String InTypeName3 { get { return this.intypeName[2]; } set { this.intypeName[2] = value; } } //public String InTypeName4 { get { return this.intypeName[3]; } set { this.intypeName[3] = value; } } //public Boolean InCutFlag1 { get { return this.inCutFlag[0]; } set { this.inCutFlag[0] = value; } } //public Boolean InCutFlag2 { get { return this.inCutFlag[1]; } set { this.inCutFlag[1] = value; } } //public Boolean InCutFlag3 { get { return this.inCutFlag[2]; } set { this.inCutFlag[2] = value; } } //public Boolean InCutFlag4 { get { return this.inCutFlag[3]; } set { this.inCutFlag[3] = value; } } //public String OutType1 { get { return this.outtype[0]; } set { this.outtype[0] = value; } } //public String OutType2 { get { return this.outtype[1]; } set { this.outtype[1] = value; } } //public String OutType3 { get { return this.outtype[2]; } set { this.outtype[2] = value; } } //public String OutType4 { get { return this.outtype[3]; } set { this.outtype[3] = value; } } //public String OutTypeName1 { get { return this.outtypeName[0]; } set { this.outtypeName[0] = value; } } //public String OutTypeName2 { get { return this.outtypeName[1]; } set { this.outtypeName[1] = value; } } //public String OutTypeName3 { get { return this.outtypeName[2]; } set { this.outtypeName[2] = value; } } //public String OutTypeName4 { get { return this.outtypeName[3]; } set { this.outtypeName[3] = value; } } //public Boolean OutCutFlag1 { get { return this.outCutFlag[0]; } set { this.outCutFlag[0] = value; } } //public Boolean OutCutFlag2 { get { return this.outCutFlag[1]; } set { this.outCutFlag[1] = value; } } //public Boolean OutCutFlag3 { get { return this.outCutFlag[2]; } set { this.outCutFlag[2] = value; } } //public Boolean OutCutFlag4 { get { return this.outCutFlag[3]; } set { this.outCutFlag[3] = value; } } //public String[] InType { get { return this.intype; } set { this.intype= value; } } //public String[] InTypeName { get { return this.intypeName; } set { this.intypeName = value; } } //public Boolean[] InCutFlag { get { return this.inCutFlag; } set { this.inCutFlag = value; } } //public String[] OutType { get { return this.outtype; } set { this.outtype = value; } } //public String[] OuttypeName { get { return this.outtypeName; } set { this.outtypeName = value; } } //public Boolean[] OutCutFlag { get { return this.outCutFlag; } set { this.outCutFlag = value; } } public void setDeviceTypeInfo(DeviceTypeInfo dev, string inoutType) { try { if (inoutType.Equals(code_InOutType.Input)) this.inDeviceTypeInfo[dev.DeviceNo - 1] = dev; else if (inoutType.Equals(code_InOutType.Output)) this.outDeviceTypeInfos[dev.DeviceNo - 1] = dev; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public DeviceTypeInfo getDeviceTypeInfo(int deviceNo, string inoutType) { DeviceTypeInfo dev = null; try { if (inoutType.Equals(code_InOutType.Input)) dev = this.inDeviceTypeInfo[deviceNo - 1]; else if (inoutType.Equals(code_InOutType.Output)) dev = this.outDeviceTypeInfos[deviceNo - 1]; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return dev; } public DeviceTypeInfo[] inDeviceTypeInfos { get { return this.inDeviceTypeInfo; } set { this.inDeviceTypeInfo = value; } } public DeviceTypeInfo[] outDeviceTypeInfos { get { return this.outDeviceTypeInfo; } set { this.outDeviceTypeInfo = value; } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ // '1' = A : 2X2 // '2' = B : 4X4 // '4' = C : ¾Æ³¯·Î±×¿¬°¨Áö±â // '5' = D : ¾Æ³¯·Î±×¿­°¨Áö±â public String RepeaterType { get { return this.repeaterType; } set { this.repeaterType = value; // 2ȸ·Î if (this.repeaterType.Equals("A")) { if (this.inDeviceTypeInfo == null) { this.inDeviceTypeInfo = new DeviceTypeInfo[2]; this.outDeviceTypeInfo = new DeviceTypeInfo[2]; } } // 4ȸ·Î else if (this.repeaterType.Equals("B")) { if (this.inDeviceTypeInfo == null) { this.inDeviceTypeInfo = new DeviceTypeInfo[4]; this.outDeviceTypeInfo = new DeviceTypeInfo[4]; } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (this.repeaterType.Equals("C") || this.repeaterType.Equals("D")) { if (this.inDeviceTypeInfo == null) { this.inDeviceTypeInfo = new DeviceTypeInfo[1]; this.outDeviceTypeInfo = new DeviceTypeInfo[1]; } } } } public Boolean CutFlag { get { return this.cutFlag; } set { this.cutFlag = value; } } public Boolean UseFlag { get { return this.useFlag; } set { this.useFlag = value; } } } /************************************************************************************************************************/ /* Áß°è±âȸ·Î¼³Á¤°ª -frmReceiverConfig [³¡] */ /************************************************************************************************************************/ /************************************************************************************************************************/ /* ȸ·Î¼³Á¤°ª -frmReceiverConfig [½ÃÀÛ] */ /************************************************************************************************************************/ public class DeviceTypeInfo { int deviceNo = -1; string deviceType = null; //¿¬µ¿Å¸ÀÔ string deviceName = null; //ȸ·Î¼³¸í bool cutFlag = false; //Â÷´Ü¿©ºÎ bool useFlag = false; //»ç¿ë¿©ºÎ string positionCode = null; //À§Ä¡ÄÚµå public DeviceTypeInfo(int deviceNo) { try { this.deviceNo = deviceNo; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public int DeviceNo { get { return this.deviceNo; } } public String DeviceType { get { return this.deviceType; } set { this.deviceType = value; } } public String DeviceName { get { return this.deviceName; } set { this.deviceName = value; } } public bool CutFlag { get { return this.cutFlag; } set { this.cutFlag = value; } } public bool UseFlag { get { return this.useFlag; } set { this.useFlag = value; } } public String PositionCode { get { return this.positionCode; } set { this.positionCode = value; } } } /************************************************************************************************************************/ /* Áß°è±â »óŰª ¹× ȸ·Î µ¥ÀÌÅÍ [½ÃÀÛ] */ /************************************************************************************************************************/ public class RepeaterPointUnit { //ÀÔ·Âȸ·Î µ¥ÀÌÅͰª private InputDeviceStatus input1 = InputDeviceStatus.Init; private InputDeviceStatus input2 = InputDeviceStatus.Init; private InputDeviceStatus input3 = InputDeviceStatus.Init; private InputDeviceStatus input4 = InputDeviceStatus.Init; //Ãâ·Âȸ·Î µ¥ÀÌÅͰª private OutputDeviceStatus output1 = OutputDeviceStatus.Init; private OutputDeviceStatus output2 = OutputDeviceStatus.Init; private OutputDeviceStatus output3 = OutputDeviceStatus.Init; private OutputDeviceStatus output4 = OutputDeviceStatus.Init; //TprotocolÀÇ Áß°è±â µ¥ÀÌÅÍ // RCVData_ReadRepeaterPoint_unit unitData; //2010.4.13_moon //RepeaterData unitData; // repeater id// private int repeater_ID = 0; // repeater state // private bool repeaterErr = false; //¿¡·¯»óÅ private bool repeaterNon = false; //Á¸ÀçÇÏÁö ¾Ê´Â Áß°è±â private bool repeaterR0 = false; //Reserved--24Voltage Fault¹ß»ý private bool repeaterR1 = false; //Reserved private bool repeaterR2 = false; //Reserved private bool repeaterR = false; //Áß°è±â º¹±¸ ¸í·É 0-¿Ï·á,1-¿Ï·á¾ÈÇÔ private bool repeaterW = false; //Ãâ·Â¾²±â ¿Ï·á 0-¿Ï·á,1-¿Ï·á¾ÈÇÔ private bool repeaterS = false; //Search Complete 0-¿Ï·á,1-¿Ï·á¾ÈÇÔ // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ : ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿À¸·Î ÀÎÇÏ¿© ÀԷ°ªÀº Áß°è±âµç ¾Æ³¯·Î±× °¨Áö±â´Â ¹Ýµå½Ã 1byte ÀúÀåÇÏ°Ô µÈ´Ù public int AnalogDetecterValue_Input = 0; // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ // ¾Æ³¯·Î±× °¨Áö±â ·¹º§°ªÀº µ¥ÀÌŸº£À̽º°¡ ±âÁØÀÌ µÇ¹Ç·Î, °á±¹ ¸Þ¸ð¸® ÇÒ´ç Á÷Àü¿¡ ¾Æ³¯·Î±× °¨Áö±âÀÎÁö È®ÀÎÇÏ°í ¾Æ·¡ÀÇ °ªÀ» ¼ÂÆÃÇÒ ¼ö ¹Û¿¡ ¾ø´Ù. // ÇÔ¼ö¿À¹ö·ÎµùÀ¸·Î ±âº»À¸·Î »ç¿ëÇÏ´Â »ý¼ºÀÚ¿Ü¿¡, ¾Æ³¯·Î±× ŸÀÔÀÎÁö ¾Æ´ÑÁö ±¸ºÐÇϱâ À§Çؼ­ Fault, PreFire, FireDay, FireNight °¡ ¸ðµÎ 0 À̸é // ÀÌ´Â Áß°è±âÀÌ°í ±×·¸Áö ¾ÊÀ¸¸é ¾Æ³¯·Î±× °¨Áö±â¶ó°í ÆÇ´ÜÇÏ°í µ¿ÀÛÇØ¾ß ÇÑ´Ù. public AnalogLevel AnalogDetecterLevel = new AnalogLevel(0, 0, 0, 0); // ±âº» public RepeaterPointUnit(int repeater_ID, RepeaterData unitData) // public RepeaterPointUnit(int repeater_ID, RCVData_ReadRepeaterPoint_unit unitData) //2010.4.13_moon { try { // Áß°è±â ¾ÆÀ̵ð this.repeater_ID = repeater_ID; // »óŰª ³Ö±â this.SetStateData(unitData); // ÀԷ°ª ³Ö±â this.SetInputData(unitData); // Ãâ·Â°ª ³Ö±â this.SetOutputData(unitData); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } // cyim 2015.7.3 ¾Æ³¯·Î±× °¨Áö±â¿Í Áß°è±â »ý¼ºÀÚ ±¸ºÐ // »ý¼ºÀÚÀÇ °æ¿ì ÇÔ¼ö¿À¹ö·ÎµùÀ» ÅëÇÏ¿© ±âÁ¸ÀÇ Áß°è±â´Â ±×´ë·Î ÀÌ¿ëÇ쵂 º°µµ·Î ¾Æ³¯·Î±× Áß°è±â Àü¿ë »ý¼ºÀÚ¸¦ ÀÌ¿ëÇϵµ·Ï ÇÑ´Ù // Áß¿äÇÑ °ÍÀº »ý¼ºÀÚ°¡ ½ÇÇàµÇ±â Á÷Àü¿¡ ¹Ì¸® ³»ºÎÀûÀ¸·Î Áß°è±â ¾ÆÀ̵ð¸¸À» °¡Áö°í À̰ÍÀÌ ¾Æ³¯·Î±× °¨Áö±â ÀÎÁö ¾Æ´ÑÁö¸¦ ÆÇ´ÜÇÒ¼ö ¹Û¿¡ ¾ø´Â ±¸Á¶¸¦ ¾È°í ±¸¼ºµÈ´Ù´Â Á¡ÀÌ´Ù. // °á±¹ ºÐ±âµÈ »ý¼ºÀÚ´Â º°µµ·Î ¾÷µ¥ÀÌÆ® ÇÔ¼ö°¡ ÇÊ¿äÇÒ ¼ö ¹Û¿¡ ¾øÀ» °Í °°´Ù. public RepeaterPointUnit(int repeater_ID, RepeaterData unitData, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { try { // ¾Æ³¯·Î±× °¨Áö±â ·¹º§ Á¤º¸ Ãß°¡ this.AnalogDetecterLevel = analogLevel; // Áß°è±â ¾ÆÀ̵ð this.repeater_ID = repeater_ID; // »óŰª ³Ö±â this.SetStateData(unitData); // ÀԷ°ª ³Ö±â this.SetInputData(unitData.AnalogDetecterValue_Input, analogLevel, mdi); // Ưº°Ã³¸® ¾Æ³¯·Î±× °¨Áö±â´Â ÀÔ·ÂÀÌ Æ²¸®´Ù »óÀ§1ºñÆ®¸¦ Á¦¿ÜÇÑ ³ª¸ÓÁö 7 bir ÀÇ ¾Æ³¯·Î±× °ªÀÌ ÀԷ°ªÀÌ´Ù. // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® // Ãâ·Â°ª ³Ö±â this.SetOutputData(unitData); //Ãâ·Â°ª ³Ö±â } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } // ÀÏ¹Ý Áß°è±â¿ë public bool UpdateData(RepeaterData unitData) { bool ret = false; try { if (this.UpdateStateData(unitData)) { ret = true; } if (this.UpdateInputData(unitData)) { ret = true; } if (this.UpdateOutputData(unitData)) { ret = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return ret; } // cyim 2015.7.3 ¾Æ³¯·Î±× °¨Áö±â¿Í Áß°è±â »ý¼ºÀÚ ±¸ºÐ -> ¾Æ³¯·Î±× °¨Áö±â¿ë public bool UpdateData(RepeaterData unitData, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { bool ret = false; try { if (this.UpdateStateData(unitData)) { ret = true; } if (this.UpdateInputData(unitData.AnalogDetecterValue_Input, analogLevel, mdi)) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { ret = true; } if (this.UpdateOutputData(unitData)) { ret = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return ret; } bool UpdateStateData(RepeaterData unitData) { bool ret = false; try { // cyim 2013.7.18 Áß°è±â»óź¸±â ¿À·ù if (repeaterNon != unitData.Non) { repeaterNon = unitData.Non; ret = true; } if (repeaterErr != unitData.Err) { repeaterErr = unitData.Err; ret = true; } if (repeaterR0 != unitData.R0) { repeaterR0 = unitData.R0; ret = true; } if (repeaterR1 != unitData.R1) { repeaterR1 = unitData.R1; ret = true; } if (repeaterR2 != unitData.R2) { repeaterR2 = unitData.R2; ret = true; } if (repeaterR != unitData.R) { repeaterR = unitData.R; ret = true; } if (repeaterW != unitData.W) { repeaterW = unitData.W; ret = true; } if (repeaterS != unitData.S) { repeaterS = unitData.S; ret = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return ret; } //Áß°è±â »óŰª ÀúÀå private void SetStateData(RepeaterData unitData) { try { repeaterErr = unitData.Err; repeaterNon = unitData.Non; repeaterR0 = unitData.R0; repeaterR1 = unitData.R1; repeaterR2 = unitData.R2; repeaterR = unitData.R; repeaterW = unitData.W; repeaterS = unitData.S; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } //ÀԷµ¥ÀÌÅÍ ÀúÀå private void SetInputData(RepeaterData unitData) { try { input1 = inputCompute(unitData.Repeater_state_1); //2010.4.13_moon repeater -> Repeater input2 = inputCompute(unitData.Repeater_state_2);//2010.4.13_moon repeater -> Repeater input3 = inputCompute(unitData.Repeater_state_3);//2010.4.13_moon repeater -> Repeater input4 = inputCompute(unitData.Repeater_state_4);//2010.4.13_moon repeater -> Repeater } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } // cyim 2015.7.3 ¾Æ³¯·Î±× °¨Áö±â¿Í Áß°è±â »ý¼ºÀÚ ±¸ºÐ -> ¾Æ³¯·Î±× °¨Áö±â ÀԷµ¥ÀÌÅÍ ÀúÀåÇÏ´Â °æ¿ì¿¡´Â ¸Å°³º¯¼ö°¡ int °ª private void SetInputData(int analogValue, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { try { input1 = inputCompute(analogValue, analogLevel, mdi); // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } // cyim 2015.7.3 ¾Æ³¯·Î±× °¨Áö±â¿Í Áß°è±â »ý¼ºÀÚ ±¸ºÐ -> ÀÏ¹Ý Áß°è±â¿ë bool UpdateInputData(RepeaterData unitData) { bool ret = false; try { if (input1 != inputCompute(unitData.Repeater_state_1)) { input1 = inputCompute(unitData.Repeater_state_1); //2010.4.13_moon repeater -> Repeater ret = true; } if (input2 != inputCompute(unitData.Repeater_state_2)) { input2 = inputCompute(unitData.Repeater_state_2); //2010.4.13_moon repeater -> Repeater ret = true; } if (input3 != inputCompute(unitData.Repeater_state_3)) { input3 = inputCompute(unitData.Repeater_state_3); //2010.4.13_moon repeater -> Repeater ret = true; } if (input4 != inputCompute(unitData.Repeater_state_4)) { input4 = inputCompute(unitData.Repeater_state_4); //2010.4.13_moon repeater -> Repeater ret = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return ret; } // cyim 2015.7.3 ¾Æ³¯·Î±× °¨Áö±â¿Í Áß°è±â »ý¼ºÀÚ ±¸ºÐ -> ¾Æ³¯·Î±× °¨Áö±â¿ë bool UpdateInputData(int analogValue, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { bool ret = false; try { if (input1 != inputCompute(analogValue, analogLevel, mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® || AnalogDetecterValue_Input != analogValue) // ¾Æ³¯·Î±× °¨Áö±â´Â Á¤»óÀÎ »óÅÂÀÌ´õ¶óµµ °á±¹ °ªÀÚü´Â Áö¼ÓÀûÀ¸·Î º¯ÇϰԵȴÙ. °ªÀÌ º¯°æµÇ¾îµµ ¾÷µ¥ÀÌÆ® Á¶°Ç¿¡ ÇØ´çµÈ´Ù { input1 = inputCompute(analogValue, analogLevel, mdi); // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® ret = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return ret; } //Ãâ·Âµ¥ÀÌÅÍ ÀúÀå private void SetOutputData(RepeaterData unitData) { try { output1 = outputCompute(unitData.Repeater_output_1_C, unitData.Repeater_output_1_W);//2010.4.13_moon repeater -> Repeater output2 = outputCompute(unitData.Repeater_output_2_C, unitData.Repeater_output_2_W);//2010.4.13_moon repeater -> Repeater output3 = outputCompute(unitData.Repeater_output_3_C, unitData.Repeater_output_3_W);//2010.4.13_moon repeater -> Repeater output4 = outputCompute(unitData.Repeater_output_4_C, unitData.Repeater_output_4_W);//2010.4.13_moon repeater -> Repeater } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } bool UpdateOutputData(RepeaterData unitData) { bool ret = false; try { if (output1 != outputCompute(unitData.Repeater_output_1_C, unitData.Repeater_output_1_W)) { output1 = outputCompute(unitData.Repeater_output_1_C, unitData.Repeater_output_1_W); //2010.4.13_moon repeater -> Repeater ret = true; } if (output2 != outputCompute(unitData.Repeater_output_2_C, unitData.Repeater_output_2_W)) { output2 = outputCompute(unitData.Repeater_output_2_C, unitData.Repeater_output_2_W); //2010.4.13_moon repeater -> Repeater ret = true; } if (output3 != outputCompute(unitData.Repeater_output_3_C, unitData.Repeater_output_3_W)) { output3 = outputCompute(unitData.Repeater_output_3_C, unitData.Repeater_output_3_W); //2010.4.13_moon repeater -> Repeater ret = true; } if (output4 != outputCompute(unitData.Repeater_output_4_C, unitData.Repeater_output_4_W)) { output4 = outputCompute(unitData.Repeater_output_4_C, unitData.Repeater_output_4_W); //2010.4.13_moon repeater -> Repeater ret = true; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } return ret; } // cyim 2015.7.1 ÀÔ·Âȸ·Î »óŰª Ãß°¡ // ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿À¸·Î ÀÎÇÏ¿© º¯ÇüµÈ ÀÔ·Âȸ·Î °ªÀº ¾Æ·¡¿Í °°´Ù // //ÀÔ·Âȸ·Î»óŰª Ãʱâ»óÅÂ(-1),°¨Áö(0),Á¤»ó(1),´Ü¼±(3),PreFire(4) //public enum InputDeviceStatus { Init = -1, Use = 0, Normal = 1, Blocking = 3, PreFire = 4 } //Ãâ·Âȸ·Î»óŰª Ãʱâ»óÅÂ(-1),Ãâ·Â¾øÀ½(0),Ãâ·ÂÀÖÀ½(1),Â÷´Ü(3) //public enum OutputDeviceStatus { Init = -1, NotWrite = 0, Write = 1, Blocking = 3 } //Ãâ·Âµ¥ÀÌÅ͸¦ UIÈ®ÀΰªÀ¸·Î Çüº¯È¯ private OutputDeviceStatus outputCompute(bool repeater_output_C, bool repeater_output_W)//2010.4.13_moon repeater -> Repeater { if (repeater_output_C == true) return OutputDeviceStatus.Blocking; //Â÷´Ü //2010.4.13_moon == 1 -> == true else if (repeater_output_W == true) return OutputDeviceStatus.Write; //Ãâ·ÂÀÖÀ½ //2010.4.13_moon == 1 -> == true else if (repeater_output_W == false) return OutputDeviceStatus.NotWrite; //Ãâ·Â¾øÀ½ //2010.4.13_moon == 0 -> == true else return OutputDeviceStatus.Init; } //ÀԷµ¥ÀÌÅ͸¦ UIÈ®ÀΰªÀ¸·Î Çüº¯È¯ private InputDeviceStatus inputCompute(int repeater_state) { if (repeater_state == 0) return InputDeviceStatus.Use; //°¨Áö else if (repeater_state == 1) return InputDeviceStatus.Normal; //Á¤»ó else if (repeater_state == 3) return InputDeviceStatus.Blocking; //´Ü¼± else if (repeater_state == 4) return InputDeviceStatus.PreFire; //PreFire else return InputDeviceStatus.Init; } // ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿À» À§ÇØ º°µµ·Î ·¹º§ °ª Á¤º¸°¡ ÇÊ¿äÇÏ´Ù private InputDeviceStatus inputCompute(int analogValue, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® { // (Normal : 0, Fault :1, PreFire : 2, Fire : 3) int repeater_state = mdi.AnalogDetect.Get_LevelStatus(analogValue, analogLevel); // cyim 2015.8.4 ¼ö½Å¹ÝÀ» À§ÇÑ static Ŭ·¡½º Á¤¸® if (repeater_state == 3) return InputDeviceStatus.Use; //°¨Áö else if (repeater_state == 0) return InputDeviceStatus.Normal; //Á¤»ó else if (repeater_state == 1) return InputDeviceStatus.Blocking; //´Ü¼± else if (repeater_state == 2) return InputDeviceStatus.PreFire; //PreFire else return InputDeviceStatus.Init; } public bool RepeaterErr { get { return this.repeaterErr; } } //2010.4.13_moon int -> bool public bool RepeaterNon { get { return this.repeaterNon; } } //2010.4.13_moon int -> bool public bool RepeaterR0 { get { return this.repeaterR0; } } //2010.4.13_moon int -> bool public bool RepeaterR1 { get { return this.repeaterR1; } } //2010.4.13_moon int -> bool public bool RepeaterR2 { get { return this.repeaterR2; } } //2010.4.13_moon int -> bool public bool RepeaterR { get { return this.repeaterR; } } //2010.4.13_moon int -> bool public bool RepeaterW { get { return this.repeaterW; } } //2010.4.13_moon int -> bool public bool RepeaterS { get { return this.repeaterS; } } //2010.4.13_moon int -> bool public InputDeviceStatus[] Repeater_Input { get { InputDeviceStatus[] indata = new InputDeviceStatus[4] { this.input1,this.input2,this.input3,this.input4 }; return indata; } } public InputDeviceStatus Repeater_Input1 { get { return this.input1; } } public InputDeviceStatus Repeater_Input2 { get { return this.input2; } } public InputDeviceStatus Repeater_Input3 { get { return this.input3; } } public InputDeviceStatus Repeater_Input4 { get { return this.input4; } } public OutputDeviceStatus[] Repeater_Output { get { OutputDeviceStatus[] outdata = new OutputDeviceStatus[4] { this.output1,this.output2,this.output3,this.output4 }; return outdata; } set { this.output1 = value[0]; this.output2 = value[1]; this.output3 = value[2]; this.output4 = value[3]; } } public OutputDeviceStatus Repeater_Output1 { get { return this.output1; } } public OutputDeviceStatus Repeater_Output2 { get { return this.output2; } } public OutputDeviceStatus Repeater_Output3 { get { return this.output3; } } public OutputDeviceStatus Repeater_Output4 { get { return this.output4; } } } /************************************************************************************************************************/ /* Áß°è±â »óŰª ¹× ȸ·Î µ¥ÀÌÅÍ [³¡] */ /************************************************************************************************************************/ }