using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Drawing; using System.Diagnostics; using System.Windows.Forms; using System.Collections; namespace FPER { public class UIReceiverInfo { int myReceiverID; ReceiverTypeInfo myReceiverTypeInfo; //¼ö½Å±â ¼³Á¤°ª int cnt_ReceiverCut = 0; //Â÷´Ü count public UIReceiverInfo(int receiverid) { try { this.myReceiverID = receiverid; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } /**************************************************************************************************** * * ¼ö½Å±â ¼³Á¤°ª Àоî¿À±â : ¼ö½Å±â ¼³Á¤°ªÀÌ º¯°æµÇ¸é È£ÃâÇØ ÁØ´Ù...[½ÃÀÛ] * ****************************************************************************************************/ public ReceiverTypeInfo ReadAll_ReceiverTypeInfo(MDIParent mdi) { ReceiverTypeInfo myReceiverTypeInfo = new ReceiverTypeInfo(this.myReceiverID); try { DacBoardConfig dacBoardConfig = new DacBoardConfig(this.myReceiverID); // cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ try { /******************************************************* * Åë½Åº¸µå ¼³Á¤°ª Àоî¿À±â *******************************************************/ DataTable dt = dacBoardConfig.Board_Select(this.myReceiverID, 0, "Y"); if (dt.Rows.Count > 0) { // cyim 2017.01.12 : IFC3300 Àº Åë½Åº¸µå 0¹øÀÌ Á¸ÀçÇÑ´Ù // cyim 2016.11.03 : Åë½Åº¸µå(Áß°è¹Ý)´Â ÃÖ´ë 64 //Åë½Åº¸µå¼ö 16°³·Î °íÁ¤ BoardTypeInfo[] brd = new BoardTypeInfo[65]; int boardCnt = 0; // cyim 2016.10.31 : ´ë¿ë·® ¼ö½Å±â¿ë UI º¯°æ foreach (DataRow dr in dt.Rows) { int BoardId = int.Parse(Convert.ToString(dr[0])); // cyim 2017.01.12 : IFC3300 Àº Åë½Åº¸µå 0¹øÀÌ Á¸ÀçÇÑ´Ù if (mdi.ReceiverModel == "IFC3300") { if (BoardId == 0) continue; } else { if (BoardId == 15) continue; } Boolean Loop0UseFlag = Convert.ToString(dr["LOOP0_USE_FLAG"]) == "Y" ? true : false; Boolean Loop1UseFlag = Convert.ToString(dr["LOOP1_USE_FLAG"]) == "Y" ? true : false; Boolean Loop2UseFlag = Convert.ToString(Util.NullToStr(dr["LOOP2_USE_FLAG"])) == "Y" ? true : false; Boolean Loop3UseFlag = Convert.ToString(Util.NullToStr(dr["LOOP3_USE_FLAG"])) == "Y" ? true : false; Boolean Loop0CutFlag = Convert.ToString(dr["LOOP0_CUT_FLAG"]) == "Y" ? true : false; Boolean Loop1CutFlag = Convert.ToString(dr["LOOP1_CUT_FLAG"]) == "Y" ? true : false; Boolean Loop2CutFlag = Convert.ToString(Util.NullToStr(dr["LOOP2_CUT_FLAG"])) == "Y" ? true : false; Boolean Loop3CutFlag = Convert.ToString(Util.NullToStr(dr["LOOP3_CUT_FLAG"])) == "Y" ? true : false; Boolean UseFlag = Convert.ToString(dr["USE_FLAG"]) == "Y" ? true : false; //Åë½Åº¸µå¼³Á¤ ÀúÀå brd[BoardId - 1] = new BoardTypeInfo(BoardId, UseFlag, Loop0UseFlag, Loop1UseFlag, Loop2UseFlag, Loop3UseFlag); if (Loop0UseFlag) { //Loop0ÀÇ Áß°è±â 127°³ÀÇ ¼³Á¤Á¤º¸ ÀúÀå, ¹è¿­ÀÓ brd[BoardId - 1].Loop0_RepeaterType = RepeaterTypeRead(BoardId, 0); brd[BoardId - 1].Loop0CutFlag = Loop0CutFlag; } if (Loop1UseFlag) { //Loop1ÀÇ Áß°è±â 127°³ÀÇ ¼³Á¤Á¤º¸ ÀúÀå, ¹è¿­ÀÓ brd[BoardId - 1].Loop1_RepeaterType = RepeaterTypeRead(BoardId, 1); brd[BoardId - 1].Loop1CutFlag = Loop1CutFlag; } if (Loop2UseFlag) { //Loop0ÀÇ Áß°è±â 127°³ÀÇ ¼³Á¤Á¤º¸ ÀúÀå, ¹è¿­ÀÓ brd[BoardId - 1].Loop2_RepeaterType = RepeaterTypeRead(BoardId, 2); brd[BoardId - 1].Loop2CutFlag = Loop2CutFlag; } if (Loop3UseFlag) { //Loop1ÀÇ Áß°è±â 127°³ÀÇ ¼³Á¤Á¤º¸ ÀúÀå, ¹è¿­ÀÓ brd[BoardId - 1].Loop3_RepeaterType = RepeaterTypeRead(BoardId, 3); brd[BoardId - 1].Loop3CutFlag = Loop3CutFlag; } ++boardCnt; Application.DoEvents(); } //Åë½Åº¸µå ¼³Á¤°ª ÀúÀå myReceiverTypeInfo.MyBoardType = brd; } else { throw new Exception("Åë½Åº¸µå ¼³Á¤Á¤º¸°¡ ¾ø½À´Ï´Ù. Åë½Åº¸µå ¼³Á¤Á¤º¸¸¦ È®ÀÎÇϽʽÿä."); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } return myReceiverTypeInfo; } //Áß°è±â ¼³Á¤Á¤º¸ private RepeaterDeviceTypeInfo[] RepeaterTypeRead(int BoardId, int LoopNo) { RepeaterDeviceTypeInfo[] repType = new RepeaterDeviceTypeInfo[127]; try { DacDeviceConfig dacDeviceConfig = new DacDeviceConfig(myReceiverID); // cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DacRepeaterConfig dacRepeaterConfig = new DacRepeaterConfig(myReceiverID); // cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ // ƯÁ¤ °èÅëÀÇ Áß°è±â Àüü¸¦ Àоî¿Â´Ù. DataTable dt = dacRepeaterConfig.Repeater_Select(this.myReceiverID, BoardId, LoopNo, 0, null); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { //Áß°è±â¼³Á¤°ª int RepeaterID = int.Parse(dr["REPEATER_ID"].ToString()); // lch_19.04.01 // TB_REPEATER Å×ÀÌºí¿¡¼­ 128 Áß°è±â´Â ¾ø´Âµ¥ DB¿¡ ÀÖÀ» ¼ö ÀÖ´Ù(±³·ùÀü¿øÀÌ»ó, ¿¹ºñÀü¿øÀÌ»ó Á¤º¸¸¦ 128 Áß°è±â·Î ¿äûÇÑ´Ù) if (RepeaterID == 128) break; // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ // '1' = A : 2X2 // '2' = B : 4X4 // '4' = C : ¾Æ³¯·Î±×¿¬°¨Áö±â // '5' = D : ¾Æ³¯·Î±×¿­°¨Áö±â String RepeaterType = Convert.ToString(dr["REPEATER_TYPE"]); Boolean UseFlag = Convert.ToString(dr["USE_FLAG"]) == "Y" ? true : false; Boolean CutFlag = Convert.ToString(dr["Cut_FLAG"]) == "Y" ? true : false; String Divicetype = ""; if (RepeaterType.Equals("1")) Divicetype = "A"; else if (RepeaterType.Equals("2")) Divicetype = "B"; else if (RepeaterType.Equals("4")) Divicetype = "C"; else if (RepeaterType.Equals("5")) Divicetype = "D"; RepeaterDeviceTypeInfo dev = new RepeaterDeviceTypeInfo(RepeaterID); //Áß°è±â¹× ȸ·Î ¼³Á¤Á¤º¸ if (!Divicetype.Equals("")) { dev.UseFlag = UseFlag; dev.RepeaterType = Divicetype; dev.CutFlag = CutFlag; } else dev.UseFlag = false; //ȸ·Î¼³Á¤°ª DataTable dt2 = dacDeviceConfig.Device_Select(this.myReceiverID, BoardId, LoopNo, RepeaterID, 0, null); foreach (DataRow dr2 in dt2.Rows) { int DeviceID = int.Parse(dr2["DEVICE_ID"].ToString()); Boolean devCutFlag = dr2["CUT_FLAG"].ToString() == "Y" ? true : false; if (dr2["INOUT_TYPE"].ToString().Equals(code_GroupIO.Input)) { dev.setInputDeviceTypeInfo(DeviceID, dr2["DEVICE_TYPE"].ToString(), dr2["DEVICE_NAME"].ToString(), dr2["POSITION_CODE"].ToString(), devCutFlag); } else { dev.setOutputDeviceTypeInfo(DeviceID, dr2["DEVICE_TYPE"].ToString(), dr2["DEVICE_NAME"].ToString(), dr2["POSITION_CODE"].ToString(), devCutFlag); } } repType[RepeaterID - 1] = dev; } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } return repType; } /**************************************************************************************************** * ¼³Á¤°ª Àоî¿À±â [³¡] ****************************************************************************************************/ //TB_CONFIGÀÇ È¯°æÁ¤º¸¸¦ ºÒ·¯¿Â´Ù.. ¾ø´Â°æ¿ì »ý¼ºÇØ ÁØ´Ù... public ReceiverConfigVo ReadConfig() { ReceiverConfigVo vo = null; try { DacReceiverConfig dacReceiverConfig = new DacReceiverConfig(myReceiverID); // cyim 2015.7.30 µ¥ÀÌŸº£À̽º Á¢¼Ó ·çƾ º¯°æ DataTable dt = dacReceiverConfig.Config_Select(this.myReceiverID); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; vo = new ReceiverConfigVo(this.myReceiverID); vo.Fire_accumulation_mode = Util.NullToStr(dr["FIRE_ACCUMULATION_MODE"]) == "Y" ? true : false; vo.Fire_accumulation_time = (Util.StrToInt(dr["FIRE_ACCUMULATION_TIME"], 0) > 60 ? Util.StrToInt(dr["FIRE_ACCUMULATION_TIME"], 0) / 1000 : Util.StrToInt(dr["FIRE_ACCUMULATION_TIME"], 0)); vo.Fire_process_mode = Util.NullToStr(dr["FIRE_PROCESS_MODE"]) == "Y" ? true : false; vo.Sound_process_mode = Util.NullToStr(dr["SOUND_PROCESS_MODE"]) == "Y" ? true : false; vo.Master_user_id = Util.NullToStr(dr["MASTER_USER_ID"]); vo.Master_password = Util.NullToStr(dr["MASTER_PASSWORD"]); vo.Building_name = Util.NullToStr(dr["BUILDING_NAME"]); // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ vo.Jump_field_flag = Util.NullToStr(dr["JUMP_FIELD"]); // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã vo.Test_run_flag = Util.NullToStr(dr["TEST_RUN_FLAG"]); // cyim 2014.8.11 È­¸é¿¡ ¸¶½ºÅÍÀÎÁö ½½·¹À̺êÀÎÁö Ç¥½Ã vo.Master_flag = Util.NullToStr(dr["MASTER_FLAG"]); try { vo.Background_image = Util.NullToStr(dr["BACKGROUND_IMAGE"]); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } else { //TB_CONFIGÀÇ È¯°æÁ¤º¸°¡ ¾ø´Â°æ¿ì ±âº»¼³Á¤Á¤º¸ vo = new ReceiverConfigVo(this.myReceiverID); vo.Fire_accumulation_mode = false; vo.Fire_accumulation_time = 0; vo.Fire_process_mode = false; vo.Sound_process_mode = false; vo.Master_user_id = "icontrols"; vo.Master_password = ""; vo.Building_name = "¾ÆÀÌÄÜÆ®·Ñ½º ºôµù"; // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ vo.Jump_field_flag = "N"; // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã vo.Test_run_flag = "N"; // cyim 2014.8.11 È­¸é¿¡ ¸¶½ºÅÍÀÎÁö ½½·¹À̺êÀÎÁö Ç¥½Ã vo.Master_flag = "N"; dacReceiverConfig.Config_Update(QUERYMode.insert, this.myReceiverID, vo.Fire_accumulation_mode ? "Y" : "N" , vo.Fire_accumulation_time, vo.Fire_process_mode ? "Y" : "N", vo.Sound_process_mode ? "Y" : "N" , vo.Master_user_id, vo.Master_password , vo.Building_name, vo.Background_image, vo.Test_run_flag, vo.Jump_field_flag); } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } return vo; } /************************************************************************/ /* Â÷´Ü count : Ãâ·Âȸ·Î,Áß°è±â,Åë½Åº¸µå,Loop0,Loop1 */ /************************************************************************/ public int Count_ReceiverCut(ReceiverTypeInfo receiverInfo) { this.myReceiverTypeInfo = receiverInfo; try { //---------------------------------------------------------------- // º¯¼öÃʱâÈ­ //---------------------------------------------------------------- this.cnt_ReceiverCut = 0; //Â÷´Ü count //---------------------------------------------------------------- if (receiverInfo == null) return 0; BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType; //ÀüüÅë½Åº¸µå if (boardInfos != null) { foreach (BoardTypeInfo brd in boardInfos) { // cyim 2016.10.31 : °èÅëÁ¤º¸´Â 0,1,2,3 À¸·Î º¯°æ RepeaterDeviceTypeInfo[] loop0_repinfo; //127°³ Áß°è±â ¼³Á¤°ª RepeaterDeviceTypeInfo[] loop1_repinfo; //127°³ Áß°è±â ¼³Á¤°ª RepeaterDeviceTypeInfo[] loop2_repinfo; //127°³ Áß°è±â ¼³Á¤°ª RepeaterDeviceTypeInfo[] loop3_repinfo; //127°³ Áß°è±â ¼³Á¤°ª if (brd != null) { //Åë½Åº¸µå Â÷´Ü¿©ºÎ if (brd.UseFlag) { /////////////// loop 0 if (brd.Loop0UseFlag) { if (brd.Loop0CutFlag) { this.cnt_ReceiverCut++; //Loop0 : Â÷´ÜÁõ°¡ } else { loop0_repinfo = brd.Loop0_RepeaterType; RepeaterPointUnit[] loop0_repdata = brd.Loop0_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop0_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop0_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 0); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { this.cnt_ReceiverCut++; //Áß°è±â : Â÷´ÜÁõ°¡ } else { if (dev.RepeaterType.Equals("A")) { // 2*2 Áß°è±â DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos == null) break; if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } else if (dev.RepeaterType.Equals("B")) { // 4*4 Áß°è±â DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos == null) break; if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { // 2*2 Áß°è±â DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos == null) break; if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } } } } } } } /////////////// loop 0 /////////////// loop 1 if (brd.Loop1UseFlag) { if (brd.Loop1CutFlag) { this.cnt_ReceiverCut++; //Loop1 : Â÷´ÜÁõ°¡ } else { loop1_repinfo = brd.Loop1_RepeaterType; RepeaterPointUnit[] loop1_repdata = brd.Loop1_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop1_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop1_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { this.cnt_ReceiverCut++; //Áß°è±â : Â÷´ÜÁõ°¡ } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } } } } } } } /////////////// loop 1 /////////////// loop 2 if (brd.Loop2UseFlag) { if (brd.Loop2CutFlag) { this.cnt_ReceiverCut++; //Loop2 : Â÷´ÜÁõ°¡ } else { loop2_repinfo = brd.Loop2_RepeaterType; RepeaterPointUnit[] loop2_repdata = brd.Loop2_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop2_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop2_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { this.cnt_ReceiverCut++; //Áß°è±â : Â÷´ÜÁõ°¡ } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } } } } } } } /////////////// loop 2 /////////////// loop 3 if (brd.Loop3UseFlag) { if (brd.Loop3CutFlag) { this.cnt_ReceiverCut++; //Loop3 : Â÷´ÜÁõ°¡ } else { loop3_repinfo = brd.Loop3_RepeaterType; RepeaterPointUnit[] loop3_repdata = brd.Loop3_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop3_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop3_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { this.cnt_ReceiverCut++; //Áß°è±â : Â÷´ÜÁõ°¡ } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //ȸ·ÎÂ÷´Ü : Áõ°¡ } } } } } } } } } /////////////// loop 3 } } } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } return this.cnt_ReceiverCut; } /************************************************************************/ /* Â÷´Ü count : Ãâ·Âȸ·Î,Áß°è±â,Åë½Åº¸µå,Loop0,Loop1 */ /************************************************************************/ public ArrayList Array_ReceiverCut(ReceiverTypeInfo receiverInfo) { this.myReceiverTypeInfo = receiverInfo; ArrayList ary = new ArrayList(); try { if (receiverInfo == null) return null; BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType; //ÀüüÅë½Åº¸µå if (boardInfos != null) { foreach (BoardTypeInfo brd in boardInfos) { // cyim 2016.10.31 : °èÅëÁ¤º¸´Â 0,1,2,3 À¸·Î º¯°æ RepeaterDeviceTypeInfo[] loop0_repinfo; //127°³ Áß°è±â ¼³Á¤°ª RepeaterDeviceTypeInfo[] loop1_repinfo; //127°³ Áß°è±â ¼³Á¤°ª RepeaterDeviceTypeInfo[] loop2_repinfo; //127°³ Áß°è±â ¼³Á¤°ª RepeaterDeviceTypeInfo[] loop3_repinfo; //127°³ Áß°è±â ¼³Á¤°ª if (brd != null) { if (brd.UseFlag) //Åë½Åº¸µå Â÷´Ü¿©ºÎ { /////////////// loop 0 if (brd.Loop0UseFlag) { if (brd.Loop0CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, 0, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP0 Â÷´Ü", brd.BoardNo)); ary.Add(eventLogMsg); } else { loop0_repinfo = brd.Loop0_RepeaterType; RepeaterPointUnit[] loop0_repdata = brd.Loop0_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop0_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop0_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 0); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] Â÷´Ü", brd.BoardNo, RepeaterID)); ary.Add(eventLogMsg); } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos == null) break; if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) //ÀÔ·Âȸ·ÎÂ÷´Ü : Áõ°¡ { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) //Ãâ·Âȸ·ÎÂ÷´Ü : Áõ°¡ { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos == null) break; if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos == null) break; if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) //ÀÔ·Âȸ·ÎÂ÷´Ü : Áõ°¡ { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) //Ãâ·Âȸ·ÎÂ÷´Ü : Áõ°¡ { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 0, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP0 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } } } } } } } /////////////// loop 0 /////////////// loop 1 if (brd.Loop1UseFlag) { if (brd.Loop1CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, 0, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP1 Â÷´Ü", brd.BoardNo)); ary.Add(eventLogMsg); } else { loop1_repinfo = brd.Loop1_RepeaterType; RepeaterPointUnit[] loop1_repdata = brd.Loop1_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop1_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop1_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] Â÷´Ü", brd.BoardNo, RepeaterID)); ary.Add(eventLogMsg); } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 1, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP1 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } } } } } } } /////////////// loop 1 /////////////// loop 2 if (brd.Loop2UseFlag) { if (brd.Loop2CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, 0, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP2 Â÷´Ü", brd.BoardNo)); ary.Add(eventLogMsg); } else { loop2_repinfo = brd.Loop2_RepeaterType; RepeaterPointUnit[] loop2_repdata = brd.Loop2_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop2_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop2_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] Â÷´Ü", brd.BoardNo, RepeaterID)); ary.Add(eventLogMsg); } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 2, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP2 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } } } } } } } /////////////// loop 2 /////////////// loop 3 if (brd.Loop3UseFlag) { if (brd.Loop3CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, 0, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP3 Â÷´Ü", brd.BoardNo)); ary.Add(eventLogMsg); } else { loop3_repinfo = brd.Loop3_RepeaterType; RepeaterPointUnit[] loop3_repdata = brd.Loop3_RepeaterUnit_Data; //127°³ Áß°è±â µ¥ÀÌÅÍ foreach (RepeaterDeviceTypeInfo dev in loop3_repinfo) { if (dev != null) { int RepeaterID = dev.RepeaterNo; RepeaterPointUnit unit = loop3_repdata[RepeaterID - 1]; //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //Áß°è±â ¼³Á¤Å¸ÀÔ ¹× µ¥ÀÌÅÍ·Î Ä«¿îÆ® Ç¥½Ã if (dev.UseFlag) { if (dev.CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] Â÷´Ü", brd.BoardNo, RepeaterID)); ary.Add(eventLogMsg); } else { if (dev.RepeaterType.Equals("A")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 2; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } else if (dev.RepeaterType.Equals("B")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 4; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } // cyim 2015.6.8 ¾Æ³¯·Î±× °¨Áö±â ¿¬µ¿ Ãß°¡ else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D")) { DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1]; DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1]; inDeviceTypeInfos = dev.inDeviceTypeInfos; outDeviceTypeInfos = dev.outDeviceTypeInfos; for (int i = 0; i < 1; i++) { if (inDeviceTypeInfos[i] != null) { if (inDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, i + 1, "I", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "I")); ary.Add(eventLogMsg); } } if (outDeviceTypeInfos[i] != null) { if (outDeviceTypeInfos[i].CutFlag) { EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1 , brd.BoardNo, 3, RepeaterID, i + 1, "O", true, MappingStatus.Normal , string.Format("Åë½Åº¸µå[{0}] LOOP3 Áß°è±â[{1}] ȸ·Î[{2}] ŸÀÔ[{3}] Â÷´Ü", brd.BoardNo, RepeaterID, i + 1, "O")); ary.Add(eventLogMsg); } } } } } } } } } } /////////////// loop 3 } //else //{ // this.cnt_ReceiverCut++; //Åë½Åº¸µå : Â÷´ÜÁõ°¡ //} } } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; } return ary; } //À̺¥Æ® ·Î±× ¸Þ¼¼Áö »ý¼º private EventLogInfo CreateEventLogInfo(String Command_type, int Receiver_id , int Comm_id, int Board_id, int Loop_no, int Repeater_id, int Device_id, String Inout_type , bool LiveMsgFlag, MappingStatus EventStatus, string message ) { EventLogInfo eventLogInfo = null; try { DateTime commandTime = DateTime.Now; // * 'L' ¹Ð¸® ¼¼ÄÁµå. Çʿ信 µû¶ó¼­ 0À» ¼±µÎ¿¡ Ãß°¡ÇØ, 3 ÀÚ¸®¼ö·Î Ç¥ÇöÇÕ´Ï´Ù (000 - 999). //* 'N' ³ª³ëÃÊ. Çʿ信 µû¶ó¼­ 0À» ¼±µÎ¿¡ Ãß°¡ÇØ, 9 ÀÚ¸®¼ö·Î Ç¥ÇöÇÕ´Ï´Ù (000000000 - 999999999). string commandId = String.Format("{0:yyyy}{0:MM}{0:dd}{0:HH}{0:mm}{0:ss}{9:00000}{1}{2:00}{3:0}{4:00}{5:0}{6:000}{7:00}{8}", commandTime, Command_type , Receiver_id, Comm_id, Board_id, Loop_no, Repeater_id, Device_id, Inout_type, commandTime.Millisecond); eventLogInfo = new EventLogInfo(commandId); //MskDeviceIDString device_str = new MskDeviceIDString( // Comm_id, Board_id, Loop_no, Repeater_id, Device_id, Inout_type); string eventTypeName = "Â÷´Ü¼³Á¤"; //string message = String.Format("[{0}]{1} ", Command_type, eventTypeName); string command_time = String.Format("{0:yyyy}{0:MM}{0:dd}{0:HH}{0:mm}{0:ss}{1:00000}", commandTime, commandTime.Millisecond); //eventLogInfo.EventTime = command_time; eventLogInfo.EventTime = commandTime; eventLogInfo.EventType = Command_type; //----------------------- eventLogInfo.EventTypeName = eventTypeName; //----------------------- eventLogInfo.Message = message; //----------------------- eventLogInfo.EventStatus = EventStatus; eventLogInfo.LiveMsgFlag = LiveMsgFlag; eventLogInfo.ReceiverID = Receiver_id; eventLogInfo.CommId = Comm_id; eventLogInfo.BoardNo = Board_id; eventLogInfo.LoopNo = Loop_no; eventLogInfo.RepeaterNo = Repeater_id; eventLogInfo.DeviceId = Device_id; eventLogInfo.InoutType = Inout_type; eventLogInfo.DeviceMessage = Util.device_message(Inout_type, Receiver_id, Comm_id, Board_id, Loop_no, Repeater_id, Device_id); //eventLogInfo.Confirm_flag = "N"; //eventLogInfo.Confirm_remark = message; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName); //Debug.WriteLine(ex.Message); } return eventLogInfo; } } //ȯ°æ¼³Á¤Á¤º¸ public class ReceiverConfigVo { private int receiver_id = 0; //ÇöÀç¼ö½Å±âID private bool fire_accumulation_mode = false; //ÃàÀû¸ðµå private int fire_accumulation_time = 0; //ÃàÀû½Ã°£(ÃÊ)-¼³Á¤°ª private int fire_accumulation_second = 0; //ÃàÀû½Ã°£(ÃÊ) private bool fire_process_mode = false; //È­Àç¸ðµå private bool sound_process_mode = false; //Áö±¸À½Çâ¸ðµå--»ç¿ë¾ÈÇÔ private string master_user_id = ""; //°ü¸®ÀÚID private string master_password = ""; //°ü¸®ÀÚPASSWORD private string building_name = "¾ÆÀÌÄÜÆ®·Ñ½º ºôµù"; //°Ç¹°¸í //private string background_image = null; //¹ÙÅÁÀ̹ÌÁö private string background_image = null; //¹ÙÅÁÀ̹ÌÁö //D:\Ÿ±âÀÛ¾÷½Ç\¾ÆÀÌÄÜÆ®·Ñ½º\À̹ÌÁö private bool fire_accumulation_start = false; //ÃàÀû°¨Áö ½ÃÀÛ // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ private string jump_field_flag = ""; // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã private string test_run_flag = ""; // cyim 2014.8.11 È­¸é¿¡ ¸¶½ºÅÍÀÎÁö ½½·¹À̺êÀÎÁö Ç¥½Ã private string master_flag = ""; public ReceiverConfigVo(int recevier_id) { this.receiver_id = recevier_id; } public bool Fire_accumulation_mode { get { return this.fire_accumulation_mode; } set { this.fire_accumulation_mode = value; } } public int Fire_accumulation_time { get { return this.fire_accumulation_time; } set { this.fire_accumulation_time = value; this.fire_accumulation_second = value; } } public int Fire_accumulation_second { get { return this.fire_accumulation_second; } set { this.fire_accumulation_second = value; } } public bool Fire_process_mode { get { return this.fire_process_mode; } set { this.fire_process_mode = value; } } public bool Sound_process_mode { get { return this.sound_process_mode; } set { this.sound_process_mode = value; } } public string Master_user_id { get { return this.master_user_id; } set { this.master_user_id = value; } } public string Master_password { get { return this.master_password; } set { this.master_password = value; } } public bool Fire_accumulation_start { get { return this.fire_accumulation_start; } set { this.fire_accumulation_start = value; } } public string Building_name { get { return this.building_name; } set { this.building_name = value; } } //public string Background_image { get { return this.background_image; } set { this.background_image = value; } } public string Background_image { get { return this.background_image; } set { this.background_image = value; } } // cyim 2013.7.29 È­Àç½ÃÈ­¸éÀüȯ Á¤º¸ µ¥ÀÌŸº£À̽º ÀúÀå ¹× Àбâ public string Jump_field_flag { get { return this.jump_field_flag; } set { this.jump_field_flag = value; } } // cyim 2013.6.27 ¿îÀü¼³Á¤½Ã¿¡ ½Ã¿îÀü ¸ðµå üũ¹Ú½º Ãß°¡ ¹× ¸ÞÀÎ UI Ç¥½Ã public string Test_run_flag { get { return this.test_run_flag; } set { this.test_run_flag = value; } } // cyim 2014.8.11 È­¸é¿¡ ¸¶½ºÅÍÀÎÁö ½½·¹À̺êÀÎÁö Ç¥½Ã public string Master_flag { get { return this.master_flag; } set { this.master_flag = value; } } public void Fire_accumulation_reset() { try { this.fire_accumulation_second = this.fire_accumulation_time; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } } public class ReceiverAlarmProcess { private int errorCnt = 0; //Åë½Å¿¡·¯Ä«¿îÆ® private int fireCnt = 0; //È­Àç¹ß»ýÄ«¿îÆ® private int writeCnt = 0; //¼³ºñ°¡µ¿Ä«¿îÆ® private int blockingCnt = 0; //´Ü¼±Ä«¿îÆ® private int cutCnt = 0; //Â÷´ÜÄ«¿îÆ® private RCVData_ReadNotifyStatus[] fireStatus; //È­Àç¹ß»ý³»¿ª private RCVData_ReadNotifyStatus[] writeStatus; //¼³ºñ°¡µ¿³»¿ª private RCVData_ReadNotifyStatus[] faultStatus; //Fault³»¿ª public ReceiverAlarmProcess() { try { fireStatus = new RCVData_ReadNotifyStatus[0]; writeStatus = new RCVData_ReadNotifyStatus[0]; faultStatus = new RCVData_ReadNotifyStatus[0]; } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); } } public int ErrorCnt { get { return this.errorCnt; } set { this.errorCnt = value; } } public int FireCnt { get { return this.fireCnt; } set { this.fireCnt = value; } } public int WriteCnt { get { return this.writeCnt; } set { this.writeCnt = value; } } public int BlockingCnt { get { return this.blockingCnt; } set { this.blockingCnt = value; } } public int CutCnt { get { return this.cutCnt; } set { this.cutCnt = value; } } //È­Àç¸ñ·Ï¿¡ Ãß°¡ public void FireSatusAdd(RCVData_ReadNotifyStatus res) { try { int cnt = fireStatus.Length; Array.Resize(ref fireStatus, cnt + 1); } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName); } } //È­Àç¸ñ·Ï¿¡¼­ Á¦¿Ü public void FireSatusDel(RCVData_ReadNotifyStatus res) { try { int cnt = fireStatus.Length; RCVData_ReadNotifyStatus[] nfireStatus = new RCVData_ReadNotifyStatus[cnt]; Array.Copy(fireStatus, 0, nfireStatus, 0, cnt); for (int i = 0; i < cnt; i++) { if (nfireStatus[i] == res) { Array.Resize(ref fireStatus, cnt - 1); Array.Copy(fireStatus, 0, nfireStatus, 0, cnt); } } } catch (Exception ex) { Util.UErrorMessage(ex, 0, 0); throw ex; //Debug.WriteLine(ex.Message); } } } }