UIReceiverInfo.cs 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Diagnostics;
  7. using System.Windows.Forms;
  8. using System.Collections;
  9. namespace FPER
  10. {
  11. public class UIReceiverInfo
  12. {
  13. int myReceiverID;
  14. ReceiverTypeInfo myReceiverTypeInfo; //수신기 설정값
  15. int cnt_ReceiverCut = 0; //차단 count
  16. public UIReceiverInfo(int receiverid)
  17. {
  18. try
  19. {
  20. this.myReceiverID = receiverid;
  21. }
  22. catch (Exception ex)
  23. {
  24. Util.UErrorMessage(ex, 0, 0);
  25. }
  26. }
  27. /****************************************************************************************************
  28. *
  29. * 수신기 설정값 읽어오기 : 수신기 설정값이 변경되면 호출해 준다...[시작]
  30. *
  31. ****************************************************************************************************/
  32. public ReceiverTypeInfo ReadAll_ReceiverTypeInfo(MDIParent mdi)
  33. {
  34. ReceiverTypeInfo myReceiverTypeInfo = new ReceiverTypeInfo(this.myReceiverID);
  35. try
  36. {
  37. DacBoardConfig dacBoardConfig = new DacBoardConfig(this.myReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
  38. try
  39. {
  40. /*******************************************************
  41. * 통신보드 설정값 읽어오기
  42. *******************************************************/
  43. DataTable dt = dacBoardConfig.Board_Select(this.myReceiverID, 0, "Y");
  44. if (dt.Rows.Count > 0)
  45. {
  46. // cyim 2017.01.12 : IFC3300 은 통신보드 0번이 존재한다
  47. // cyim 2016.11.03 : 통신보드(중계반)는 최대 64 //통신보드수 16개로 고정
  48. BoardTypeInfo[] brd = new BoardTypeInfo[65];
  49. int boardCnt = 0;
  50. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  51. foreach (DataRow dr in dt.Rows)
  52. {
  53. int BoardId = int.Parse(Convert.ToString(dr[0]));
  54. // cyim 2017.01.12 : IFC3300 은 통신보드 0번이 존재한다
  55. if (mdi.ReceiverModel == "IFC3300")
  56. {
  57. if (BoardId == 0)
  58. continue;
  59. }
  60. else
  61. {
  62. if (BoardId == 15)
  63. continue;
  64. }
  65. Boolean Loop0UseFlag = Convert.ToString(dr["LOOP0_USE_FLAG"]) == "Y" ? true : false;
  66. Boolean Loop1UseFlag = Convert.ToString(dr["LOOP1_USE_FLAG"]) == "Y" ? true : false;
  67. Boolean Loop2UseFlag = Convert.ToString(Util.NullToStr(dr["LOOP2_USE_FLAG"])) == "Y" ? true : false;
  68. Boolean Loop3UseFlag = Convert.ToString(Util.NullToStr(dr["LOOP3_USE_FLAG"])) == "Y" ? true : false;
  69. Boolean Loop0CutFlag = Convert.ToString(dr["LOOP0_CUT_FLAG"]) == "Y" ? true : false;
  70. Boolean Loop1CutFlag = Convert.ToString(dr["LOOP1_CUT_FLAG"]) == "Y" ? true : false;
  71. Boolean Loop2CutFlag = Convert.ToString(Util.NullToStr(dr["LOOP2_CUT_FLAG"])) == "Y" ? true : false;
  72. Boolean Loop3CutFlag = Convert.ToString(Util.NullToStr(dr["LOOP3_CUT_FLAG"])) == "Y" ? true : false;
  73. Boolean UseFlag = Convert.ToString(dr["USE_FLAG"]) == "Y" ? true : false;
  74. //통신보드설정 저장
  75. brd[BoardId - 1] = new BoardTypeInfo(BoardId, UseFlag, Loop0UseFlag, Loop1UseFlag, Loop2UseFlag, Loop3UseFlag);
  76. if (Loop0UseFlag)
  77. {
  78. //Loop0의 중계기 127개의 설정정보 저장, 배열임
  79. brd[BoardId - 1].Loop0_RepeaterType = RepeaterTypeRead(BoardId, 0);
  80. brd[BoardId - 1].Loop0CutFlag = Loop0CutFlag;
  81. }
  82. if (Loop1UseFlag)
  83. {
  84. //Loop1의 중계기 127개의 설정정보 저장, 배열임
  85. brd[BoardId - 1].Loop1_RepeaterType = RepeaterTypeRead(BoardId, 1);
  86. brd[BoardId - 1].Loop1CutFlag = Loop1CutFlag;
  87. }
  88. if (Loop2UseFlag)
  89. {
  90. //Loop0의 중계기 127개의 설정정보 저장, 배열임
  91. brd[BoardId - 1].Loop2_RepeaterType = RepeaterTypeRead(BoardId, 2);
  92. brd[BoardId - 1].Loop2CutFlag = Loop2CutFlag;
  93. }
  94. if (Loop3UseFlag)
  95. {
  96. //Loop1의 중계기 127개의 설정정보 저장, 배열임
  97. brd[BoardId - 1].Loop3_RepeaterType = RepeaterTypeRead(BoardId, 3);
  98. brd[BoardId - 1].Loop3CutFlag = Loop3CutFlag;
  99. }
  100. ++boardCnt;
  101. Application.DoEvents();
  102. }
  103. //통신보드 설정값 저장
  104. myReceiverTypeInfo.MyBoardType = brd;
  105. }
  106. else
  107. {
  108. throw new Exception("통신보드 설정정보가 없습니다. 통신보드 설정정보를 확인하십시요.");
  109. }
  110. }
  111. catch (Exception ex)
  112. {
  113. Util.UErrorMessage(ex, 0, 0);
  114. throw ex;
  115. }
  116. }
  117. catch (Exception ex)
  118. {
  119. Util.UErrorMessage(ex, 0, 0);
  120. throw ex;
  121. }
  122. return myReceiverTypeInfo;
  123. }
  124. //중계기 설정정보
  125. private RepeaterDeviceTypeInfo[] RepeaterTypeRead(int BoardId, int LoopNo)
  126. {
  127. RepeaterDeviceTypeInfo[] repType = new RepeaterDeviceTypeInfo[127];
  128. try
  129. {
  130. DacDeviceConfig dacDeviceConfig = new DacDeviceConfig(myReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
  131. DacRepeaterConfig dacRepeaterConfig = new DacRepeaterConfig(myReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
  132. // 특정 계통의 중계기 전체를 읽어온다.
  133. DataTable dt = dacRepeaterConfig.Repeater_Select(this.myReceiverID, BoardId, LoopNo, 0, null);
  134. if (dt.Rows.Count > 0)
  135. {
  136. foreach (DataRow dr in dt.Rows)
  137. {
  138. //중계기설정값
  139. int RepeaterID = int.Parse(dr["REPEATER_ID"].ToString());
  140. // lch_19.04.01
  141. // TB_REPEATER 테이블에서 128 중계기는 없는데 DB에 있을 수 있다(교류전원이상, 예비전원이상 정보를 128 중계기로 요청한다)
  142. if (RepeaterID == 128) break;
  143. // cyim 2015.6.8 아날로그 감지기 연동 추가
  144. // '1' = A : 2X2
  145. // '2' = B : 4X4
  146. // '4' = C : 아날로그연감지기
  147. // '5' = D : 아날로그열감지기
  148. String RepeaterType = Convert.ToString(dr["REPEATER_TYPE"]);
  149. Boolean UseFlag = Convert.ToString(dr["USE_FLAG"]) == "Y" ? true : false;
  150. Boolean CutFlag = Convert.ToString(dr["Cut_FLAG"]) == "Y" ? true : false;
  151. String Divicetype = "";
  152. if (RepeaterType.Equals("1")) Divicetype = "A";
  153. else if (RepeaterType.Equals("2")) Divicetype = "B";
  154. else if (RepeaterType.Equals("4")) Divicetype = "C";
  155. else if (RepeaterType.Equals("5")) Divicetype = "D";
  156. RepeaterDeviceTypeInfo dev = new RepeaterDeviceTypeInfo(RepeaterID); //중계기및 회로 설정정보
  157. if (!Divicetype.Equals(""))
  158. {
  159. dev.UseFlag = UseFlag;
  160. dev.RepeaterType = Divicetype;
  161. dev.CutFlag = CutFlag;
  162. }
  163. else dev.UseFlag = false;
  164. //회로설정값
  165. DataTable dt2 = dacDeviceConfig.Device_Select(this.myReceiverID, BoardId, LoopNo, RepeaterID, 0, null);
  166. foreach (DataRow dr2 in dt2.Rows)
  167. {
  168. int DeviceID = int.Parse(dr2["DEVICE_ID"].ToString());
  169. Boolean devCutFlag = dr2["CUT_FLAG"].ToString() == "Y" ? true : false;
  170. if (dr2["INOUT_TYPE"].ToString().Equals(code_GroupIO.Input))
  171. {
  172. dev.setInputDeviceTypeInfo(DeviceID, dr2["DEVICE_TYPE"].ToString(), dr2["DEVICE_NAME"].ToString(), dr2["POSITION_CODE"].ToString(), devCutFlag);
  173. }
  174. else
  175. {
  176. dev.setOutputDeviceTypeInfo(DeviceID, dr2["DEVICE_TYPE"].ToString(), dr2["DEVICE_NAME"].ToString(), dr2["POSITION_CODE"].ToString(), devCutFlag);
  177. }
  178. }
  179. repType[RepeaterID - 1] = dev;
  180. }
  181. }
  182. }
  183. catch (Exception ex)
  184. {
  185. Util.UErrorMessage(ex, 0, 0);
  186. throw ex;
  187. }
  188. return repType;
  189. }
  190. /****************************************************************************************************
  191. * 설정값 읽어오기 [끝]
  192. ****************************************************************************************************/
  193. //TB_CONFIG의 환경정보를 불러온다.. 없는경우 생성해 준다...
  194. public ReceiverConfigVo ReadConfig()
  195. {
  196. ReceiverConfigVo vo = null;
  197. try
  198. {
  199. DacReceiverConfig dacReceiverConfig = new DacReceiverConfig(myReceiverID); // cyim 2015.7.30 데이타베이스 접속 루틴 변경
  200. DataTable dt = dacReceiverConfig.Config_Select(this.myReceiverID);
  201. if (dt.Rows.Count > 0)
  202. {
  203. DataRow dr = dt.Rows[0];
  204. vo = new ReceiverConfigVo(this.myReceiverID);
  205. vo.Fire_accumulation_mode = Util.NullToStr(dr["FIRE_ACCUMULATION_MODE"]) == "Y" ? true : false;
  206. 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));
  207. vo.Fire_process_mode = Util.NullToStr(dr["FIRE_PROCESS_MODE"]) == "Y" ? true : false;
  208. vo.Sound_process_mode = Util.NullToStr(dr["SOUND_PROCESS_MODE"]) == "Y" ? true : false;
  209. vo.Master_user_id = Util.NullToStr(dr["MASTER_USER_ID"]);
  210. vo.Master_password = Util.NullToStr(dr["MASTER_PASSWORD"]);
  211. vo.Building_name = Util.NullToStr(dr["BUILDING_NAME"]);
  212. // cyim 2013.7.29 화재시화면전환 정보 데이타베이스 저장 및 읽기
  213. vo.Jump_field_flag = Util.NullToStr(dr["JUMP_FIELD"]);
  214. // cyim 2013.6.27 운전설정시에 시운전 모드 체크박스 추가 및 메인 UI 표시
  215. vo.Test_run_flag = Util.NullToStr(dr["TEST_RUN_FLAG"]);
  216. // cyim 2014.8.11 화면에 마스터인지 슬레이브인지 표시
  217. vo.Master_flag = Util.NullToStr(dr["MASTER_FLAG"]);
  218. try
  219. {
  220. vo.Background_image = Util.NullToStr(dr["BACKGROUND_IMAGE"]);
  221. }
  222. catch (Exception ex)
  223. {
  224. Util.UErrorMessage(ex, 0, 0);
  225. }
  226. }
  227. else
  228. {
  229. //TB_CONFIG의 환경정보가 없는경우 기본설정정보
  230. vo = new ReceiverConfigVo(this.myReceiverID);
  231. vo.Fire_accumulation_mode = false;
  232. vo.Fire_accumulation_time = 0;
  233. vo.Fire_process_mode = false;
  234. vo.Sound_process_mode = false;
  235. vo.Master_user_id = "icontrols";
  236. vo.Master_password = "";
  237. vo.Building_name = "아이콘트롤스 빌딩";
  238. // cyim 2013.7.29 화재시화면전환 정보 데이타베이스 저장 및 읽기
  239. vo.Jump_field_flag = "N";
  240. // cyim 2013.6.27 운전설정시에 시운전 모드 체크박스 추가 및 메인 UI 표시
  241. vo.Test_run_flag = "N";
  242. // cyim 2014.8.11 화면에 마스터인지 슬레이브인지 표시
  243. vo.Master_flag = "N";
  244. dacReceiverConfig.Config_Update(QUERYMode.insert, this.myReceiverID, vo.Fire_accumulation_mode ? "Y" : "N"
  245. , vo.Fire_accumulation_time, vo.Fire_process_mode ? "Y" : "N", vo.Sound_process_mode ? "Y" : "N"
  246. , vo.Master_user_id, vo.Master_password
  247. , vo.Building_name, vo.Background_image, vo.Test_run_flag, vo.Jump_field_flag);
  248. }
  249. }
  250. catch (Exception ex)
  251. {
  252. Util.UErrorMessage(ex, 0, 0);
  253. throw ex;
  254. }
  255. return vo;
  256. }
  257. /************************************************************************/
  258. /* 차단 count : 출력회로,중계기,통신보드,Loop0,Loop1 */
  259. /************************************************************************/
  260. public int Count_ReceiverCut(ReceiverTypeInfo receiverInfo)
  261. {
  262. this.myReceiverTypeInfo = receiverInfo;
  263. try
  264. {
  265. //----------------------------------------------------------------
  266. // 변수초기화
  267. //----------------------------------------------------------------
  268. this.cnt_ReceiverCut = 0; //차단 count
  269. //----------------------------------------------------------------
  270. if (receiverInfo == null) return 0;
  271. BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType; //전체통신보드
  272. if (boardInfos != null)
  273. {
  274. foreach (BoardTypeInfo brd in boardInfos)
  275. {
  276. // cyim 2016.10.31 : 계통정보는 0,1,2,3 으로 변경
  277. RepeaterDeviceTypeInfo[] loop0_repinfo; //127개 중계기 설정값
  278. RepeaterDeviceTypeInfo[] loop1_repinfo; //127개 중계기 설정값
  279. RepeaterDeviceTypeInfo[] loop2_repinfo; //127개 중계기 설정값
  280. RepeaterDeviceTypeInfo[] loop3_repinfo; //127개 중계기 설정값
  281. if (brd != null)
  282. {
  283. //통신보드 차단여부
  284. if (brd.UseFlag)
  285. {
  286. /////////////// loop 0
  287. if (brd.Loop0UseFlag)
  288. {
  289. if (brd.Loop0CutFlag)
  290. {
  291. this.cnt_ReceiverCut++; //Loop0 : 차단증가
  292. }
  293. else
  294. {
  295. loop0_repinfo = brd.Loop0_RepeaterType;
  296. RepeaterPointUnit[] loop0_repdata = brd.Loop0_RepeaterUnit_Data; //127개 중계기 데이터
  297. foreach (RepeaterDeviceTypeInfo dev in loop0_repinfo)
  298. {
  299. if (dev != null)
  300. {
  301. int RepeaterID = dev.RepeaterNo;
  302. RepeaterPointUnit unit = loop0_repdata[RepeaterID - 1];
  303. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 0); //중계기 설정타입 및 데이터로 카운트 표시
  304. if (dev.UseFlag)
  305. {
  306. if (dev.CutFlag)
  307. {
  308. this.cnt_ReceiverCut++; //중계기 : 차단증가
  309. }
  310. else
  311. {
  312. if (dev.RepeaterType.Equals("A"))
  313. { // 2*2 중계기
  314. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  315. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  316. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  317. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  318. for (int i = 0; i < 2; i++)
  319. {
  320. if (inDeviceTypeInfos == null) break;
  321. if (inDeviceTypeInfos[i] != null)
  322. {
  323. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  324. }
  325. if (outDeviceTypeInfos[i] != null)
  326. {
  327. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  328. }
  329. }
  330. }
  331. else if (dev.RepeaterType.Equals("B"))
  332. { // 4*4 중계기
  333. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  334. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  335. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  336. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  337. for (int i = 0; i < 4; i++)
  338. {
  339. if (inDeviceTypeInfos == null) break;
  340. if (inDeviceTypeInfos[i] != null)
  341. {
  342. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  343. }
  344. if (outDeviceTypeInfos[i] != null)
  345. {
  346. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  347. }
  348. }
  349. }
  350. // cyim 2015.6.8 아날로그 감지기 연동 추가
  351. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  352. { // 2*2 중계기
  353. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  354. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  355. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  356. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  357. for (int i = 0; i < 1; i++)
  358. {
  359. if (inDeviceTypeInfos == null) break;
  360. if (inDeviceTypeInfos[i] != null)
  361. {
  362. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  363. }
  364. if (outDeviceTypeInfos[i] != null)
  365. {
  366. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  367. }
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. }
  375. }
  376. /////////////// loop 0
  377. /////////////// loop 1
  378. if (brd.Loop1UseFlag)
  379. {
  380. if (brd.Loop1CutFlag)
  381. {
  382. this.cnt_ReceiverCut++; //Loop1 : 차단증가
  383. }
  384. else
  385. {
  386. loop1_repinfo = brd.Loop1_RepeaterType;
  387. RepeaterPointUnit[] loop1_repdata = brd.Loop1_RepeaterUnit_Data; //127개 중계기 데이터
  388. foreach (RepeaterDeviceTypeInfo dev in loop1_repinfo)
  389. {
  390. if (dev != null)
  391. {
  392. int RepeaterID = dev.RepeaterNo;
  393. RepeaterPointUnit unit = loop1_repdata[RepeaterID - 1];
  394. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //중계기 설정타입 및 데이터로 카운트 표시
  395. if (dev.UseFlag)
  396. {
  397. if (dev.CutFlag)
  398. {
  399. this.cnt_ReceiverCut++; //중계기 : 차단증가
  400. }
  401. else
  402. {
  403. if (dev.RepeaterType.Equals("A"))
  404. {
  405. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  406. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  407. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  408. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  409. for (int i = 0; i < 2; i++)
  410. {
  411. if (inDeviceTypeInfos[i] != null)
  412. {
  413. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  414. }
  415. if (outDeviceTypeInfos[i] != null)
  416. {
  417. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  418. }
  419. }
  420. }
  421. else if (dev.RepeaterType.Equals("B"))
  422. {
  423. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  424. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  425. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  426. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  427. for (int i = 0; i < 4; i++)
  428. {
  429. if (inDeviceTypeInfos[i] != null)
  430. {
  431. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  432. }
  433. if (outDeviceTypeInfos[i] != null)
  434. {
  435. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  436. }
  437. }
  438. }
  439. // cyim 2015.6.8 아날로그 감지기 연동 추가
  440. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  441. {
  442. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  443. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  444. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  445. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  446. for (int i = 0; i < 1; i++)
  447. {
  448. if (inDeviceTypeInfos[i] != null)
  449. {
  450. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  451. }
  452. if (outDeviceTypeInfos[i] != null)
  453. {
  454. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. }
  463. }
  464. /////////////// loop 1
  465. /////////////// loop 2
  466. if (brd.Loop2UseFlag)
  467. {
  468. if (brd.Loop2CutFlag)
  469. {
  470. this.cnt_ReceiverCut++; //Loop2 : 차단증가
  471. }
  472. else
  473. {
  474. loop2_repinfo = brd.Loop2_RepeaterType;
  475. RepeaterPointUnit[] loop2_repdata = brd.Loop2_RepeaterUnit_Data; //127개 중계기 데이터
  476. foreach (RepeaterDeviceTypeInfo dev in loop2_repinfo)
  477. {
  478. if (dev != null)
  479. {
  480. int RepeaterID = dev.RepeaterNo;
  481. RepeaterPointUnit unit = loop2_repdata[RepeaterID - 1];
  482. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //중계기 설정타입 및 데이터로 카운트 표시
  483. if (dev.UseFlag)
  484. {
  485. if (dev.CutFlag)
  486. {
  487. this.cnt_ReceiverCut++; //중계기 : 차단증가
  488. }
  489. else
  490. {
  491. if (dev.RepeaterType.Equals("A"))
  492. {
  493. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  494. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  495. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  496. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  497. for (int i = 0; i < 2; i++)
  498. {
  499. if (inDeviceTypeInfos[i] != null)
  500. {
  501. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  502. }
  503. if (outDeviceTypeInfos[i] != null)
  504. {
  505. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  506. }
  507. }
  508. }
  509. else if (dev.RepeaterType.Equals("B"))
  510. {
  511. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  512. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  513. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  514. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  515. for (int i = 0; i < 4; i++)
  516. {
  517. if (inDeviceTypeInfos[i] != null)
  518. {
  519. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  520. }
  521. if (outDeviceTypeInfos[i] != null)
  522. {
  523. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  524. }
  525. }
  526. }
  527. // cyim 2015.6.8 아날로그 감지기 연동 추가
  528. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  529. {
  530. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  531. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  532. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  533. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  534. for (int i = 0; i < 1; i++)
  535. {
  536. if (inDeviceTypeInfos[i] != null)
  537. {
  538. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  539. }
  540. if (outDeviceTypeInfos[i] != null)
  541. {
  542. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  543. }
  544. }
  545. }
  546. }
  547. }
  548. }
  549. }
  550. }
  551. }
  552. /////////////// loop 2
  553. /////////////// loop 3
  554. if (brd.Loop3UseFlag)
  555. {
  556. if (brd.Loop3CutFlag)
  557. {
  558. this.cnt_ReceiverCut++; //Loop3 : 차단증가
  559. }
  560. else
  561. {
  562. loop3_repinfo = brd.Loop3_RepeaterType;
  563. RepeaterPointUnit[] loop3_repdata = brd.Loop3_RepeaterUnit_Data; //127개 중계기 데이터
  564. foreach (RepeaterDeviceTypeInfo dev in loop3_repinfo)
  565. {
  566. if (dev != null)
  567. {
  568. int RepeaterID = dev.RepeaterNo;
  569. RepeaterPointUnit unit = loop3_repdata[RepeaterID - 1];
  570. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //중계기 설정타입 및 데이터로 카운트 표시
  571. if (dev.UseFlag)
  572. {
  573. if (dev.CutFlag)
  574. {
  575. this.cnt_ReceiverCut++; //중계기 : 차단증가
  576. }
  577. else
  578. {
  579. if (dev.RepeaterType.Equals("A"))
  580. {
  581. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  582. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  583. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  584. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  585. for (int i = 0; i < 2; i++)
  586. {
  587. if (inDeviceTypeInfos[i] != null)
  588. {
  589. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  590. }
  591. if (outDeviceTypeInfos[i] != null)
  592. {
  593. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  594. }
  595. }
  596. }
  597. else if (dev.RepeaterType.Equals("B"))
  598. {
  599. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  600. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  601. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  602. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  603. for (int i = 0; i < 4; i++)
  604. {
  605. if (inDeviceTypeInfos[i] != null)
  606. {
  607. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  608. }
  609. if (outDeviceTypeInfos[i] != null)
  610. {
  611. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  612. }
  613. }
  614. }
  615. // cyim 2015.6.8 아날로그 감지기 연동 추가
  616. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  617. {
  618. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  619. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  620. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  621. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  622. for (int i = 0; i < 1; i++)
  623. {
  624. if (inDeviceTypeInfos[i] != null)
  625. {
  626. if (inDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  627. }
  628. if (outDeviceTypeInfos[i] != null)
  629. {
  630. if (outDeviceTypeInfos[i].CutFlag) this.cnt_ReceiverCut++; //회로차단 : 증가
  631. }
  632. }
  633. }
  634. }
  635. }
  636. }
  637. }
  638. }
  639. }
  640. /////////////// loop 3
  641. }
  642. }
  643. }
  644. }
  645. }
  646. catch (Exception ex)
  647. {
  648. Util.UErrorMessage(ex, 0, 0);
  649. throw ex;
  650. }
  651. return this.cnt_ReceiverCut;
  652. }
  653. /************************************************************************/
  654. /* 차단 count : 출력회로,중계기,통신보드,Loop0,Loop1 */
  655. /************************************************************************/
  656. public ArrayList Array_ReceiverCut(ReceiverTypeInfo receiverInfo)
  657. {
  658. this.myReceiverTypeInfo = receiverInfo;
  659. ArrayList ary = new ArrayList();
  660. try
  661. {
  662. if (receiverInfo == null) return null;
  663. BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType; //전체통신보드
  664. if (boardInfos != null)
  665. {
  666. foreach (BoardTypeInfo brd in boardInfos)
  667. {
  668. // cyim 2016.10.31 : 계통정보는 0,1,2,3 으로 변경
  669. RepeaterDeviceTypeInfo[] loop0_repinfo; //127개 중계기 설정값
  670. RepeaterDeviceTypeInfo[] loop1_repinfo; //127개 중계기 설정값
  671. RepeaterDeviceTypeInfo[] loop2_repinfo; //127개 중계기 설정값
  672. RepeaterDeviceTypeInfo[] loop3_repinfo; //127개 중계기 설정값
  673. if (brd != null)
  674. {
  675. if (brd.UseFlag) //통신보드 차단여부
  676. {
  677. /////////////// loop 0
  678. if (brd.Loop0UseFlag)
  679. {
  680. if (brd.Loop0CutFlag)
  681. {
  682. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  683. , brd.BoardNo, 0, 0, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP0 차단", brd.BoardNo));
  684. ary.Add(eventLogMsg);
  685. }
  686. else
  687. {
  688. loop0_repinfo = brd.Loop0_RepeaterType;
  689. RepeaterPointUnit[] loop0_repdata = brd.Loop0_RepeaterUnit_Data; //127개 중계기 데이터
  690. foreach (RepeaterDeviceTypeInfo dev in loop0_repinfo)
  691. {
  692. if (dev != null)
  693. {
  694. int RepeaterID = dev.RepeaterNo;
  695. RepeaterPointUnit unit = loop0_repdata[RepeaterID - 1];
  696. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 0); //중계기 설정타입 및 데이터로 카운트 표시
  697. if (dev.UseFlag)
  698. {
  699. if (dev.CutFlag)
  700. {
  701. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  702. , brd.BoardNo, 0, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP0 중계기[{1}] 차단", brd.BoardNo, RepeaterID));
  703. ary.Add(eventLogMsg);
  704. }
  705. else
  706. {
  707. if (dev.RepeaterType.Equals("A"))
  708. {
  709. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  710. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  711. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  712. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  713. for (int i = 0; i < 2; i++)
  714. {
  715. if (inDeviceTypeInfos == null) break;
  716. if (inDeviceTypeInfos[i] != null)
  717. {
  718. if (inDeviceTypeInfos[i].CutFlag) //입력회로차단 : 증가
  719. {
  720. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  721. , brd.BoardNo, 0, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  722. , string.Format("통신보드[{0}] LOOP0 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  723. ary.Add(eventLogMsg);
  724. }
  725. }
  726. if (outDeviceTypeInfos[i] != null)
  727. {
  728. if (outDeviceTypeInfos[i].CutFlag) //출력회로차단 : 증가
  729. {
  730. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  731. , brd.BoardNo, 0, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  732. , string.Format("통신보드[{0}] LOOP0 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  733. ary.Add(eventLogMsg);
  734. }
  735. }
  736. }
  737. }
  738. else if (dev.RepeaterType.Equals("B"))
  739. {
  740. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  741. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  742. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  743. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  744. for (int i = 0; i < 4; i++)
  745. {
  746. if (inDeviceTypeInfos == null) break;
  747. if (inDeviceTypeInfos[i] != null)
  748. {
  749. if (inDeviceTypeInfos[i].CutFlag)
  750. {
  751. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  752. , brd.BoardNo, 0, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  753. , string.Format("통신보드[{0}] LOOP0 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  754. ary.Add(eventLogMsg);
  755. }
  756. }
  757. if (outDeviceTypeInfos[i] != null)
  758. {
  759. if (outDeviceTypeInfos[i].CutFlag)
  760. {
  761. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  762. , brd.BoardNo, 0, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  763. , string.Format("통신보드[{0}] LOOP0 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  764. ary.Add(eventLogMsg);
  765. }
  766. }
  767. }
  768. }
  769. // cyim 2015.6.8 아날로그 감지기 연동 추가
  770. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  771. {
  772. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  773. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  774. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  775. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  776. for (int i = 0; i < 1; i++)
  777. {
  778. if (inDeviceTypeInfos == null) break;
  779. if (inDeviceTypeInfos[i] != null)
  780. {
  781. if (inDeviceTypeInfos[i].CutFlag) //입력회로차단 : 증가
  782. {
  783. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  784. , brd.BoardNo, 0, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  785. , string.Format("통신보드[{0}] LOOP0 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  786. ary.Add(eventLogMsg);
  787. }
  788. }
  789. if (outDeviceTypeInfos[i] != null)
  790. {
  791. if (outDeviceTypeInfos[i].CutFlag) //출력회로차단 : 증가
  792. {
  793. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  794. , brd.BoardNo, 0, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  795. , string.Format("통신보드[{0}] LOOP0 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  796. ary.Add(eventLogMsg);
  797. }
  798. }
  799. }
  800. }
  801. }
  802. }
  803. }
  804. }
  805. }
  806. }
  807. /////////////// loop 0
  808. /////////////// loop 1
  809. if (brd.Loop1UseFlag)
  810. {
  811. if (brd.Loop1CutFlag)
  812. {
  813. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  814. , brd.BoardNo, 1, 0, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP1 차단", brd.BoardNo));
  815. ary.Add(eventLogMsg);
  816. }
  817. else
  818. {
  819. loop1_repinfo = brd.Loop1_RepeaterType;
  820. RepeaterPointUnit[] loop1_repdata = brd.Loop1_RepeaterUnit_Data; //127개 중계기 데이터
  821. foreach (RepeaterDeviceTypeInfo dev in loop1_repinfo)
  822. {
  823. if (dev != null)
  824. {
  825. int RepeaterID = dev.RepeaterNo;
  826. RepeaterPointUnit unit = loop1_repdata[RepeaterID - 1];
  827. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //중계기 설정타입 및 데이터로 카운트 표시
  828. if (dev.UseFlag)
  829. {
  830. if (dev.CutFlag)
  831. {
  832. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  833. , brd.BoardNo, 1, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP1 중계기[{1}] 차단", brd.BoardNo, RepeaterID));
  834. ary.Add(eventLogMsg);
  835. }
  836. else
  837. {
  838. if (dev.RepeaterType.Equals("A"))
  839. {
  840. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  841. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  842. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  843. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  844. for (int i = 0; i < 2; i++)
  845. {
  846. if (inDeviceTypeInfos[i] != null)
  847. {
  848. if (inDeviceTypeInfos[i].CutFlag)
  849. {
  850. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  851. , brd.BoardNo, 1, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  852. , string.Format("통신보드[{0}] LOOP1 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  853. ary.Add(eventLogMsg);
  854. }
  855. }
  856. if (outDeviceTypeInfos[i] != null)
  857. {
  858. if (outDeviceTypeInfos[i].CutFlag)
  859. {
  860. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  861. , brd.BoardNo, 1, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  862. , string.Format("통신보드[{0}] LOOP1 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  863. ary.Add(eventLogMsg);
  864. }
  865. }
  866. }
  867. }
  868. else if (dev.RepeaterType.Equals("B"))
  869. {
  870. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  871. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  872. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  873. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  874. for (int i = 0; i < 4; i++)
  875. {
  876. if (inDeviceTypeInfos[i] != null)
  877. {
  878. if (inDeviceTypeInfos[i].CutFlag)
  879. {
  880. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  881. , brd.BoardNo, 1, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  882. , string.Format("통신보드[{0}] LOOP1 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  883. ary.Add(eventLogMsg);
  884. }
  885. }
  886. if (outDeviceTypeInfos[i] != null)
  887. {
  888. if (outDeviceTypeInfos[i].CutFlag)
  889. {
  890. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  891. , brd.BoardNo, 1, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  892. , string.Format("통신보드[{0}] LOOP1 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  893. ary.Add(eventLogMsg);
  894. }
  895. }
  896. }
  897. }
  898. // cyim 2015.6.8 아날로그 감지기 연동 추가
  899. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  900. {
  901. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  902. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  903. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  904. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  905. for (int i = 0; i < 1; i++)
  906. {
  907. if (inDeviceTypeInfos[i] != null)
  908. {
  909. if (inDeviceTypeInfos[i].CutFlag)
  910. {
  911. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  912. , brd.BoardNo, 1, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  913. , string.Format("통신보드[{0}] LOOP1 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  914. ary.Add(eventLogMsg);
  915. }
  916. }
  917. if (outDeviceTypeInfos[i] != null)
  918. {
  919. if (outDeviceTypeInfos[i].CutFlag)
  920. {
  921. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  922. , brd.BoardNo, 1, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  923. , string.Format("통신보드[{0}] LOOP1 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  924. ary.Add(eventLogMsg);
  925. }
  926. }
  927. }
  928. }
  929. }
  930. }
  931. }
  932. }
  933. }
  934. }
  935. /////////////// loop 1
  936. /////////////// loop 2
  937. if (brd.Loop2UseFlag)
  938. {
  939. if (brd.Loop2CutFlag)
  940. {
  941. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  942. , brd.BoardNo, 2, 0, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP2 차단", brd.BoardNo));
  943. ary.Add(eventLogMsg);
  944. }
  945. else
  946. {
  947. loop2_repinfo = brd.Loop2_RepeaterType;
  948. RepeaterPointUnit[] loop2_repdata = brd.Loop2_RepeaterUnit_Data; //127개 중계기 데이터
  949. foreach (RepeaterDeviceTypeInfo dev in loop2_repinfo)
  950. {
  951. if (dev != null)
  952. {
  953. int RepeaterID = dev.RepeaterNo;
  954. RepeaterPointUnit unit = loop2_repdata[RepeaterID - 1];
  955. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //중계기 설정타입 및 데이터로 카운트 표시
  956. if (dev.UseFlag)
  957. {
  958. if (dev.CutFlag)
  959. {
  960. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  961. , brd.BoardNo, 2, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP2 중계기[{1}] 차단", brd.BoardNo, RepeaterID));
  962. ary.Add(eventLogMsg);
  963. }
  964. else
  965. {
  966. if (dev.RepeaterType.Equals("A"))
  967. {
  968. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  969. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  970. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  971. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  972. for (int i = 0; i < 2; i++)
  973. {
  974. if (inDeviceTypeInfos[i] != null)
  975. {
  976. if (inDeviceTypeInfos[i].CutFlag)
  977. {
  978. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  979. , brd.BoardNo, 2, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  980. , string.Format("통신보드[{0}] LOOP2 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  981. ary.Add(eventLogMsg);
  982. }
  983. }
  984. if (outDeviceTypeInfos[i] != null)
  985. {
  986. if (outDeviceTypeInfos[i].CutFlag)
  987. {
  988. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  989. , brd.BoardNo, 2, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  990. , string.Format("통신보드[{0}] LOOP2 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  991. ary.Add(eventLogMsg);
  992. }
  993. }
  994. }
  995. }
  996. else if (dev.RepeaterType.Equals("B"))
  997. {
  998. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  999. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  1000. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  1001. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  1002. for (int i = 0; i < 4; i++)
  1003. {
  1004. if (inDeviceTypeInfos[i] != null)
  1005. {
  1006. if (inDeviceTypeInfos[i].CutFlag)
  1007. {
  1008. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1009. , brd.BoardNo, 2, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  1010. , string.Format("통신보드[{0}] LOOP2 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  1011. ary.Add(eventLogMsg);
  1012. }
  1013. }
  1014. if (outDeviceTypeInfos[i] != null)
  1015. {
  1016. if (outDeviceTypeInfos[i].CutFlag)
  1017. {
  1018. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1019. , brd.BoardNo, 2, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  1020. , string.Format("통신보드[{0}] LOOP2 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  1021. ary.Add(eventLogMsg);
  1022. }
  1023. }
  1024. }
  1025. }
  1026. // cyim 2015.6.8 아날로그 감지기 연동 추가
  1027. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  1028. {
  1029. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  1030. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  1031. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  1032. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  1033. for (int i = 0; i < 1; i++)
  1034. {
  1035. if (inDeviceTypeInfos[i] != null)
  1036. {
  1037. if (inDeviceTypeInfos[i].CutFlag)
  1038. {
  1039. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1040. , brd.BoardNo, 2, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  1041. , string.Format("통신보드[{0}] LOOP2 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  1042. ary.Add(eventLogMsg);
  1043. }
  1044. }
  1045. if (outDeviceTypeInfos[i] != null)
  1046. {
  1047. if (outDeviceTypeInfos[i].CutFlag)
  1048. {
  1049. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1050. , brd.BoardNo, 2, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  1051. , string.Format("통신보드[{0}] LOOP2 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  1052. ary.Add(eventLogMsg);
  1053. }
  1054. }
  1055. }
  1056. }
  1057. }
  1058. }
  1059. }
  1060. }
  1061. }
  1062. }
  1063. /////////////// loop 2
  1064. /////////////// loop 3
  1065. if (brd.Loop3UseFlag)
  1066. {
  1067. if (brd.Loop3CutFlag)
  1068. {
  1069. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1070. , brd.BoardNo, 3, 0, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP3 차단", brd.BoardNo));
  1071. ary.Add(eventLogMsg);
  1072. }
  1073. else
  1074. {
  1075. loop3_repinfo = brd.Loop3_RepeaterType;
  1076. RepeaterPointUnit[] loop3_repdata = brd.Loop3_RepeaterUnit_Data; //127개 중계기 데이터
  1077. foreach (RepeaterDeviceTypeInfo dev in loop3_repinfo)
  1078. {
  1079. if (dev != null)
  1080. {
  1081. int RepeaterID = dev.RepeaterNo;
  1082. RepeaterPointUnit unit = loop3_repdata[RepeaterID - 1];
  1083. //RepeaterUnit_Display(dev, unit, this.myReceiverId, brd.BoardNo, 1); //중계기 설정타입 및 데이터로 카운트 표시
  1084. if (dev.UseFlag)
  1085. {
  1086. if (dev.CutFlag)
  1087. {
  1088. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1089. , brd.BoardNo, 3, RepeaterID, 0, "A", true, MappingStatus.Normal, string.Format("통신보드[{0}] LOOP3 중계기[{1}] 차단", brd.BoardNo, RepeaterID));
  1090. ary.Add(eventLogMsg);
  1091. }
  1092. else
  1093. {
  1094. if (dev.RepeaterType.Equals("A"))
  1095. {
  1096. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[2];
  1097. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[2];
  1098. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  1099. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  1100. for (int i = 0; i < 2; i++)
  1101. {
  1102. if (inDeviceTypeInfos[i] != null)
  1103. {
  1104. if (inDeviceTypeInfos[i].CutFlag)
  1105. {
  1106. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1107. , brd.BoardNo, 3, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  1108. , string.Format("통신보드[{0}] LOOP3 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  1109. ary.Add(eventLogMsg);
  1110. }
  1111. }
  1112. if (outDeviceTypeInfos[i] != null)
  1113. {
  1114. if (outDeviceTypeInfos[i].CutFlag)
  1115. {
  1116. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1117. , brd.BoardNo, 3, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  1118. , string.Format("통신보드[{0}] LOOP3 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  1119. ary.Add(eventLogMsg);
  1120. }
  1121. }
  1122. }
  1123. }
  1124. else if (dev.RepeaterType.Equals("B"))
  1125. {
  1126. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[4];
  1127. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[4];
  1128. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  1129. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  1130. for (int i = 0; i < 4; i++)
  1131. {
  1132. if (inDeviceTypeInfos[i] != null)
  1133. {
  1134. if (inDeviceTypeInfos[i].CutFlag)
  1135. {
  1136. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1137. , brd.BoardNo, 3, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  1138. , string.Format("통신보드[{0}] LOOP3 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  1139. ary.Add(eventLogMsg);
  1140. }
  1141. }
  1142. if (outDeviceTypeInfos[i] != null)
  1143. {
  1144. if (outDeviceTypeInfos[i].CutFlag)
  1145. {
  1146. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1147. , brd.BoardNo, 3, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  1148. , string.Format("통신보드[{0}] LOOP3 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  1149. ary.Add(eventLogMsg);
  1150. }
  1151. }
  1152. }
  1153. }
  1154. // cyim 2015.6.8 아날로그 감지기 연동 추가
  1155. else if (dev.RepeaterType.Equals("C") || dev.RepeaterType.Equals("D"))
  1156. {
  1157. DeviceTypeInfo[] inDeviceTypeInfos = new DeviceTypeInfo[1];
  1158. DeviceTypeInfo[] outDeviceTypeInfos = new DeviceTypeInfo[1];
  1159. inDeviceTypeInfos = dev.inDeviceTypeInfos;
  1160. outDeviceTypeInfos = dev.outDeviceTypeInfos;
  1161. for (int i = 0; i < 1; i++)
  1162. {
  1163. if (inDeviceTypeInfos[i] != null)
  1164. {
  1165. if (inDeviceTypeInfos[i].CutFlag)
  1166. {
  1167. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1168. , brd.BoardNo, 3, RepeaterID, i + 1, "I", true, MappingStatus.Normal
  1169. , string.Format("통신보드[{0}] LOOP3 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "I"));
  1170. ary.Add(eventLogMsg);
  1171. }
  1172. }
  1173. if (outDeviceTypeInfos[i] != null)
  1174. {
  1175. if (outDeviceTypeInfos[i].CutFlag)
  1176. {
  1177. EventLogInfo eventLogMsg = CreateEventLogInfo("CE", receiverInfo.ReceiverNo, 1
  1178. , brd.BoardNo, 3, RepeaterID, i + 1, "O", true, MappingStatus.Normal
  1179. , string.Format("통신보드[{0}] LOOP3 중계기[{1}] 회로[{2}] 타입[{3}] 차단", brd.BoardNo, RepeaterID, i + 1, "O"));
  1180. ary.Add(eventLogMsg);
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187. }
  1188. }
  1189. }
  1190. }
  1191. /////////////// loop 3
  1192. }
  1193. //else
  1194. //{
  1195. // this.cnt_ReceiverCut++; //통신보드 : 차단증가
  1196. //}
  1197. }
  1198. }
  1199. }
  1200. }
  1201. catch (Exception ex)
  1202. {
  1203. Util.UErrorMessage(ex, 0, 0);
  1204. throw ex;
  1205. }
  1206. return ary;
  1207. }
  1208. //이벤트 로그 메세지 생성
  1209. private EventLogInfo CreateEventLogInfo(String Command_type, int Receiver_id
  1210. , int Comm_id, int Board_id, int Loop_no, int Repeater_id, int Device_id, String Inout_type
  1211. , bool LiveMsgFlag, MappingStatus EventStatus, string message
  1212. )
  1213. {
  1214. EventLogInfo eventLogInfo = null;
  1215. try
  1216. {
  1217. DateTime commandTime = DateTime.Now;
  1218. // * 'L' 밀리 세컨드. 필요에 따라서 0을 선두에 추가해, 3 자리수로 표현합니다 (000 - 999).
  1219. //* 'N' 나노초. 필요에 따라서 0을 선두에 추가해, 9 자리수로 표현합니다 (000000000 - 999999999).
  1220. 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
  1221. , Receiver_id, Comm_id, Board_id, Loop_no, Repeater_id, Device_id, Inout_type, commandTime.Millisecond);
  1222. eventLogInfo = new EventLogInfo(commandId);
  1223. //MskDeviceIDString device_str = new MskDeviceIDString(
  1224. // Comm_id, Board_id, Loop_no, Repeater_id, Device_id, Inout_type);
  1225. string eventTypeName = "차단설정";
  1226. //string message = String.Format("[{0}]{1} ", Command_type, eventTypeName);
  1227. string command_time = String.Format("{0:yyyy}{0:MM}{0:dd}{0:HH}{0:mm}{0:ss}{1:00000}", commandTime, commandTime.Millisecond);
  1228. //eventLogInfo.EventTime = command_time;
  1229. eventLogInfo.EventTime = commandTime;
  1230. eventLogInfo.EventType = Command_type; //-----------------------
  1231. eventLogInfo.EventTypeName = eventTypeName; //-----------------------
  1232. eventLogInfo.Message = message; //-----------------------
  1233. eventLogInfo.EventStatus = EventStatus;
  1234. eventLogInfo.LiveMsgFlag = LiveMsgFlag;
  1235. eventLogInfo.ReceiverID = Receiver_id;
  1236. eventLogInfo.CommId = Comm_id;
  1237. eventLogInfo.BoardNo = Board_id;
  1238. eventLogInfo.LoopNo = Loop_no;
  1239. eventLogInfo.RepeaterNo = Repeater_id;
  1240. eventLogInfo.DeviceId = Device_id;
  1241. eventLogInfo.InoutType = Inout_type;
  1242. eventLogInfo.DeviceMessage = Util.device_message(Inout_type, Receiver_id, Comm_id, Board_id, Loop_no, Repeater_id, Device_id);
  1243. //eventLogInfo.Confirm_flag = "N";
  1244. //eventLogInfo.Confirm_remark = message;
  1245. }
  1246. catch (Exception ex)
  1247. {
  1248. Util.UErrorMessage(ex, 0, 0);
  1249. //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName);
  1250. //Debug.WriteLine(ex.Message);
  1251. }
  1252. return eventLogInfo;
  1253. }
  1254. }
  1255. //환경설정정보
  1256. public class ReceiverConfigVo
  1257. {
  1258. private int receiver_id = 0; //현재수신기ID
  1259. private bool fire_accumulation_mode = false; //축적모드
  1260. private int fire_accumulation_time = 0; //축적시간(초)-설정값
  1261. private int fire_accumulation_second = 0; //축적시간(초)
  1262. private bool fire_process_mode = false; //화재모드
  1263. private bool sound_process_mode = false; //지구음향모드--사용안함
  1264. private string master_user_id = ""; //관리자ID
  1265. private string master_password = ""; //관리자PASSWORD
  1266. private string building_name = "아이콘트롤스 빌딩"; //건물명
  1267. //private string background_image = null; //바탕이미지
  1268. private string background_image = null; //바탕이미지
  1269. //D:\타기작업실\아이콘트롤스\이미지
  1270. private bool fire_accumulation_start = false; //축적감지 시작
  1271. // cyim 2013.7.29 화재시화면전환 정보 데이타베이스 저장 및 읽기
  1272. private string jump_field_flag = "";
  1273. // cyim 2013.6.27 운전설정시에 시운전 모드 체크박스 추가 및 메인 UI 표시
  1274. private string test_run_flag = "";
  1275. // cyim 2014.8.11 화면에 마스터인지 슬레이브인지 표시
  1276. private string master_flag = "";
  1277. public ReceiverConfigVo(int recevier_id)
  1278. {
  1279. this.receiver_id = recevier_id;
  1280. }
  1281. public bool Fire_accumulation_mode { get { return this.fire_accumulation_mode; } set { this.fire_accumulation_mode = value; } }
  1282. public int Fire_accumulation_time { get { return this.fire_accumulation_time; } set { this.fire_accumulation_time = value; this.fire_accumulation_second = value; } }
  1283. public int Fire_accumulation_second { get { return this.fire_accumulation_second; } set { this.fire_accumulation_second = value; } }
  1284. public bool Fire_process_mode { get { return this.fire_process_mode; } set { this.fire_process_mode = value; } }
  1285. public bool Sound_process_mode { get { return this.sound_process_mode; } set { this.sound_process_mode = value; } }
  1286. public string Master_user_id { get { return this.master_user_id; } set { this.master_user_id = value; } }
  1287. public string Master_password { get { return this.master_password; } set { this.master_password = value; } }
  1288. public bool Fire_accumulation_start { get { return this.fire_accumulation_start; } set { this.fire_accumulation_start = value; } }
  1289. public string Building_name { get { return this.building_name; } set { this.building_name = value; } }
  1290. //public string Background_image { get { return this.background_image; } set { this.background_image = value; } }
  1291. public string Background_image { get { return this.background_image; } set { this.background_image = value; } }
  1292. // cyim 2013.7.29 화재시화면전환 정보 데이타베이스 저장 및 읽기
  1293. public string Jump_field_flag { get { return this.jump_field_flag; } set { this.jump_field_flag = value; } }
  1294. // cyim 2013.6.27 운전설정시에 시운전 모드 체크박스 추가 및 메인 UI 표시
  1295. public string Test_run_flag { get { return this.test_run_flag; } set { this.test_run_flag = value; } }
  1296. // cyim 2014.8.11 화면에 마스터인지 슬레이브인지 표시
  1297. public string Master_flag { get { return this.master_flag; } set { this.master_flag = value; } }
  1298. public void Fire_accumulation_reset()
  1299. {
  1300. try
  1301. {
  1302. this.fire_accumulation_second = this.fire_accumulation_time;
  1303. }
  1304. catch (Exception ex)
  1305. {
  1306. Util.UErrorMessage(ex, 0, 0);
  1307. }
  1308. }
  1309. }
  1310. public class ReceiverAlarmProcess
  1311. {
  1312. private int errorCnt = 0; //통신에러카운트
  1313. private int fireCnt = 0; //화재발생카운트
  1314. private int writeCnt = 0; //설비가동카운트
  1315. private int blockingCnt = 0; //단선카운트
  1316. private int cutCnt = 0; //차단카운트
  1317. private RCVData_ReadNotifyStatus[] fireStatus; //화재발생내역
  1318. private RCVData_ReadNotifyStatus[] writeStatus; //설비가동내역
  1319. private RCVData_ReadNotifyStatus[] faultStatus; //Fault내역
  1320. public ReceiverAlarmProcess()
  1321. {
  1322. try
  1323. {
  1324. fireStatus = new RCVData_ReadNotifyStatus[0];
  1325. writeStatus = new RCVData_ReadNotifyStatus[0];
  1326. faultStatus = new RCVData_ReadNotifyStatus[0];
  1327. }
  1328. catch (Exception ex)
  1329. {
  1330. Util.UErrorMessage(ex, 0, 0);
  1331. }
  1332. }
  1333. public int ErrorCnt { get { return this.errorCnt; } set { this.errorCnt = value; } }
  1334. public int FireCnt { get { return this.fireCnt; } set { this.fireCnt = value; } }
  1335. public int WriteCnt { get { return this.writeCnt; } set { this.writeCnt = value; } }
  1336. public int BlockingCnt { get { return this.blockingCnt; } set { this.blockingCnt = value; } }
  1337. public int CutCnt { get { return this.cutCnt; } set { this.cutCnt = value; } }
  1338. //화재목록에 추가
  1339. public void FireSatusAdd(RCVData_ReadNotifyStatus res)
  1340. {
  1341. try
  1342. {
  1343. int cnt = fireStatus.Length;
  1344. Array.Resize(ref fireStatus, cnt + 1);
  1345. }
  1346. catch (Exception ex)
  1347. {
  1348. Util.UErrorMessage(ex, 0, 0);
  1349. throw ex;
  1350. //MessageBox.Show(string.Format("[{0}]\r\n{1}", ex.Message, ex.Source), Application.ProductName);
  1351. }
  1352. }
  1353. //화재목록에서 제외
  1354. public void FireSatusDel(RCVData_ReadNotifyStatus res)
  1355. {
  1356. try
  1357. {
  1358. int cnt = fireStatus.Length;
  1359. RCVData_ReadNotifyStatus[] nfireStatus = new RCVData_ReadNotifyStatus[cnt];
  1360. Array.Copy(fireStatus, 0, nfireStatus, 0, cnt);
  1361. for (int i = 0; i < cnt; i++)
  1362. {
  1363. if (nfireStatus[i] == res)
  1364. {
  1365. Array.Resize(ref fireStatus, cnt - 1);
  1366. Array.Copy(fireStatus, 0, nfireStatus, 0, cnt);
  1367. }
  1368. }
  1369. }
  1370. catch (Exception ex)
  1371. {
  1372. Util.UErrorMessage(ex, 0, 0);
  1373. throw ex;
  1374. //Debug.WriteLine(ex.Message);
  1375. }
  1376. }
  1377. }
  1378. }