frmBoardGroup_BigReceiver.cs 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Diagnostics;
  9. namespace FPER
  10. {
  11. public partial class frmBoardGroup_BigReceiver : Form
  12. {
  13. MDIParent mdi = null;
  14. LogFileCreate LFC = new LogFileCreate();
  15. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  16. //PictureBox[] PicBoard;
  17. //Label[] lblBoardComm;
  18. Label[] PicBoard;
  19. Button[] Board_loop0;
  20. Button[] Board_loop1;
  21. Button[] Board_loop2;
  22. Button[] Board_loop3;
  23. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  24. // Loop2 와 Loop3 의 경우 1~8 아이디는 Dummy 다
  25. // LCH 2018.02.27 : 수정됨
  26. //Button btnBoard1_loop2 = new Button();
  27. //Button btnBoard2_loop2 = new Button();
  28. //Button btnBoard3_loop2 = new Button();
  29. //Button btnBoard4_loop2 = new Button();
  30. //Button btnBoard5_loop2 = new Button();
  31. //Button btnBoard6_loop2 = new Button();
  32. //Button btnBoard7_loop2 = new Button();
  33. //Button btnBoard8_loop2 = new Button();
  34. //Button btnBoard1_loop3 = new Button();
  35. //Button btnBoard2_loop3 = new Button();
  36. //Button btnBoard3_loop3 = new Button();
  37. //Button btnBoard4_loop3 = new Button();
  38. //Button btnBoard5_loop3 = new Button();
  39. //Button btnBoard6_loop3 = new Button();
  40. //Button btnBoard7_loop3 = new Button();
  41. //Button btnBoard8_loop3 = new Button();
  42. delegate void deleFormInit();
  43. public frmBoardGroup_BigReceiver()
  44. {
  45. InitializeComponent();
  46. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  47. Dummy_Init();
  48. // cyim 2017.01.12 : IFC3300 은 통신보드 0번이 존재한다 : 단 여기에서는 UI 버튼 상태만 확인하므로 1번부터 64번만 체크해도 된다
  49. // cyim 2016.11.03 : 통신보드(중계반)는 최대 64
  50. for (int i = 1; i <= 64; i++)
  51. {
  52. for (int j = 0; j < 4; j++)
  53. {
  54. // cyim 2016.10.31 : 대용량 수신기용 UI 변경 : 버튼 핸들러는 일괄 등록한다
  55. Button btn = (Button)Util.FineControl(this, string.Format("btnBoard{0}_loop{1}", i, j));
  56. btn.Click += new EventHandler(btnBoard_loop_Click);
  57. }
  58. //TextBox textbox = (TextBox)Util.FineControl(this, string.Format("textbox{0}", i));
  59. }
  60. }
  61. public void Form_Init()
  62. {
  63. try
  64. {
  65. if (this.InvokeRequired)
  66. {
  67. deleFormInit d = new deleFormInit(Form_Init);
  68. this.Invoke(d, new object[] { });
  69. }
  70. else
  71. {
  72. getData();
  73. }
  74. }
  75. catch (Exception ex)
  76. {
  77. Util.UErrorMessage(ex, 0, 0);
  78. }
  79. }
  80. public void Dummy_Init()
  81. {
  82. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  83. // Loop2 와 Loop3 의 경우 1~8 아이디는 Dummy 다
  84. // LCH 2018.02.27 : 수정됨
  85. //btnBoard1_loop2.Name = "btnBoard1_loop2";
  86. //btnBoard2_loop2.Name = "btnBoard2_loop2";
  87. //btnBoard3_loop2.Name = "btnBoard3_loop2";
  88. //btnBoard4_loop2.Name = "btnBoard4_loop2";
  89. //btnBoard5_loop2.Name = "btnBoard5_loop2";
  90. //btnBoard6_loop2.Name = "btnBoard6_loop2";
  91. //btnBoard7_loop2.Name = "btnBoard7_loop2";
  92. //btnBoard8_loop2.Name = "btnBoard8_loop2";
  93. //btnBoard1_loop3.Name = "btnBoard1_loop3";
  94. //btnBoard2_loop3.Name = "btnBoard2_loop3";
  95. //btnBoard3_loop3.Name = "btnBoard3_loop3";
  96. //btnBoard4_loop3.Name = "btnBoard4_loop3";
  97. //btnBoard5_loop3.Name = "btnBoard5_loop3";
  98. //btnBoard6_loop3.Name = "btnBoard6_loop3";
  99. //btnBoard7_loop3.Name = "btnBoard7_loop3";
  100. //btnBoard8_loop3.Name = "btnBoard8_loop3";
  101. //this.Controls.Add(btnBoard1_loop2);
  102. //this.Controls.Add(btnBoard2_loop2);
  103. //this.Controls.Add(btnBoard3_loop2);
  104. //this.Controls.Add(btnBoard4_loop2);
  105. //this.Controls.Add(btnBoard5_loop2);
  106. //this.Controls.Add(btnBoard6_loop2);
  107. //this.Controls.Add(btnBoard7_loop2);
  108. //this.Controls.Add(btnBoard8_loop2);
  109. //this.Controls.Add(btnBoard1_loop3);
  110. //this.Controls.Add(btnBoard2_loop3);
  111. //this.Controls.Add(btnBoard3_loop3);
  112. //this.Controls.Add(btnBoard4_loop3);
  113. //this.Controls.Add(btnBoard5_loop3);
  114. //this.Controls.Add(btnBoard6_loop3);
  115. //this.Controls.Add(btnBoard7_loop3);
  116. //this.Controls.Add(btnBoard8_loop3);
  117. }
  118. private void frmBoardGroup_Load_1(object sender, EventArgs e)
  119. {
  120. // cyim 2013.8.1 : 더블버퍼링 적용
  121. SetStyle(ControlStyles.UserPaint, true);
  122. //this.UpdateStyles();
  123. SetStyle(ControlStyles.AllPaintingInWmPaint, true);
  124. //this.UpdateStyles();
  125. SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
  126. this.UpdateStyles();
  127. try
  128. {
  129. mdi = (MDIParent)this.MdiParent;
  130. txtThisReceiverID.Text = string.Format("{0:00}", mdi.myReceiverID);
  131. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  132. //this.PicBoard = new PictureBox[16]{
  133. // picBoard1,picBoard2,picBoard3,picBoard4,picBoard5,picBoard6,picBoard7,picBoard8,
  134. // picBoard9,picBoard10,picBoard11,picBoard12,picBoard13,picBoard14,picBoard15,picBoard16
  135. //};
  136. //this.lblBoardComm = new Label[16]{
  137. // lblBoardComm1,lblBoardComm2,lblBoardComm3,lblBoardComm4,lblBoardComm5,lblBoardComm6,lblBoardComm7,lblBoardComm8,
  138. // lblBoardComm9,lblBoardComm10,lblBoardComm11,lblBoardComm12,lblBoardComm13,lblBoardComm14,lblBoardComm15,lblBoardComm16
  139. //};
  140. //this.Board_loop0 = new Button[16]{
  141. // btnBoard1_loop0,btnBoard2_loop0,btnBoard3_loop0,btnBoard4_loop0,btnBoard5_loop0,btnBoard6_loop0,btnBoard7_loop0,btnBoard8_loop0,
  142. // btnBoard9_loop0,btnBoard10_loop0,btnBoard11_loop0,btnBoard12_loop0,btnBoard13_loop0,btnBoard14_loop0,btnBoard15_loop0,btnBoard16_loop0
  143. //};
  144. //this.Board_loop1 = new Button[16]{
  145. // btnBoard1_loop1,btnBoard2_loop1,btnBoard3_loop1,btnBoard4_loop1,btnBoard5_loop1,btnBoard6_loop1,btnBoard7_loop1,btnBoard8_loop1,
  146. // btnBoard9_loop1,btnBoard10_loop1,btnBoard11_loop1,btnBoard12_loop1,btnBoard13_loop1,btnBoard14_loop1,btnBoard15_loop1,btnBoard16_loop1
  147. //};
  148. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  149. this.PicBoard = new Label[64]{
  150. lbl_COMM1, lbl_COMM2, lbl_COMM3, lbl_COMM4, lbl_COMM5, lbl_COMM6, lbl_COMM7, lbl_COMM8, lbl_COMM9, lbl_COMM10, lbl_COMM11, lbl_COMM12, lbl_COMM13, lbl_COMM14, lbl_COMM15, lbl_COMM16,
  151. lbl_COMM17, lbl_COMM18, lbl_COMM19, lbl_COMM20, lbl_COMM21, lbl_COMM22, lbl_COMM23, lbl_COMM24, lbl_COMM25, lbl_COMM26, lbl_COMM27, lbl_COMM28, lbl_COMM29, lbl_COMM30, lbl_COMM31, lbl_COMM32,
  152. lbl_COMM33, lbl_COMM34, lbl_COMM35, lbl_COMM36, lbl_COMM37, lbl_COMM38, lbl_COMM39, lbl_COMM40, lbl_COMM41, lbl_COMM42, lbl_COMM43, lbl_COMM44, lbl_COMM45, lbl_COMM46, lbl_COMM47, lbl_COMM48,
  153. lbl_COMM49, lbl_COMM50, lbl_COMM51, lbl_COMM52, lbl_COMM53, lbl_COMM54, lbl_COMM55, lbl_COMM56, lbl_COMM57, lbl_COMM58, lbl_COMM59, lbl_COMM60, lbl_COMM61, lbl_COMM62, lbl_COMM63, lbl_COMM64
  154. };
  155. this.Board_loop0 = new Button[64]{
  156. btnBoard1_loop0, btnBoard2_loop0, btnBoard3_loop0, btnBoard4_loop0, btnBoard5_loop0, btnBoard6_loop0, btnBoard7_loop0, btnBoard8_loop0, btnBoard9_loop0, btnBoard10_loop0, btnBoard11_loop0, btnBoard12_loop0, btnBoard13_loop0, btnBoard14_loop0, btnBoard15_loop0, btnBoard16_loop0,
  157. btnBoard17_loop0, btnBoard18_loop0, btnBoard19_loop0, btnBoard20_loop0, btnBoard21_loop0, btnBoard22_loop0, btnBoard23_loop0, btnBoard24_loop0, btnBoard25_loop0, btnBoard26_loop0, btnBoard27_loop0, btnBoard28_loop0, btnBoard29_loop0, btnBoard30_loop0, btnBoard31_loop0, btnBoard32_loop0,
  158. btnBoard33_loop0, btnBoard34_loop0, btnBoard35_loop0, btnBoard36_loop0, btnBoard37_loop0, btnBoard38_loop0, btnBoard39_loop0, btnBoard40_loop0, btnBoard41_loop0, btnBoard42_loop0, btnBoard43_loop0, btnBoard44_loop0, btnBoard45_loop0, btnBoard46_loop0, btnBoard47_loop0, btnBoard48_loop0,
  159. btnBoard49_loop0, btnBoard50_loop0, btnBoard51_loop0, btnBoard52_loop0, btnBoard53_loop0, btnBoard54_loop0, btnBoard55_loop0, btnBoard56_loop0, btnBoard57_loop0, btnBoard58_loop0, btnBoard59_loop0, btnBoard60_loop0, btnBoard61_loop0, btnBoard62_loop0, btnBoard63_loop0, btnBoard64_loop0
  160. };
  161. this.Board_loop1 = new Button[64]{
  162. btnBoard1_loop1, btnBoard2_loop1, btnBoard3_loop1, btnBoard4_loop1, btnBoard5_loop1, btnBoard6_loop1, btnBoard7_loop1, btnBoard8_loop1, btnBoard9_loop1, btnBoard10_loop1, btnBoard11_loop1, btnBoard12_loop1, btnBoard13_loop1, btnBoard14_loop1, btnBoard15_loop1, btnBoard16_loop1,
  163. btnBoard17_loop1, btnBoard18_loop1, btnBoard19_loop1, btnBoard20_loop1, btnBoard21_loop1, btnBoard22_loop1, btnBoard23_loop1, btnBoard24_loop1, btnBoard25_loop1, btnBoard26_loop1, btnBoard27_loop1, btnBoard28_loop1, btnBoard29_loop1, btnBoard30_loop1, btnBoard31_loop1, btnBoard32_loop1,
  164. btnBoard33_loop1, btnBoard34_loop1, btnBoard35_loop1, btnBoard36_loop1, btnBoard37_loop1, btnBoard38_loop1, btnBoard39_loop1, btnBoard40_loop1, btnBoard41_loop1, btnBoard42_loop1, btnBoard43_loop1, btnBoard44_loop1, btnBoard45_loop1, btnBoard46_loop1, btnBoard47_loop1, btnBoard48_loop1,
  165. btnBoard49_loop1, btnBoard50_loop1, btnBoard51_loop1, btnBoard52_loop1, btnBoard53_loop1, btnBoard54_loop1, btnBoard55_loop1, btnBoard56_loop1, btnBoard57_loop1, btnBoard58_loop1, btnBoard59_loop1, btnBoard60_loop1, btnBoard61_loop1, btnBoard62_loop1, btnBoard63_loop1, btnBoard64_loop1
  166. };
  167. this.Board_loop2 = new Button[64]{
  168. btnBoard1_loop2, btnBoard2_loop2, btnBoard3_loop2, btnBoard4_loop2, btnBoard5_loop2, btnBoard6_loop2, btnBoard7_loop2, btnBoard8_loop2, btnBoard9_loop2, btnBoard10_loop2, btnBoard11_loop2, btnBoard12_loop2, btnBoard13_loop2, btnBoard14_loop2, btnBoard15_loop2, btnBoard16_loop2,
  169. btnBoard17_loop2, btnBoard18_loop2, btnBoard19_loop2, btnBoard20_loop2, btnBoard21_loop2, btnBoard22_loop2, btnBoard23_loop2, btnBoard24_loop2, btnBoard25_loop2, btnBoard26_loop2, btnBoard27_loop2, btnBoard28_loop2, btnBoard29_loop2, btnBoard30_loop2, btnBoard31_loop2, btnBoard32_loop2,
  170. btnBoard33_loop2, btnBoard34_loop2, btnBoard35_loop2, btnBoard36_loop2, btnBoard37_loop2, btnBoard38_loop2, btnBoard39_loop2, btnBoard40_loop2, btnBoard41_loop2, btnBoard42_loop2, btnBoard43_loop2, btnBoard44_loop2, btnBoard45_loop2, btnBoard46_loop2, btnBoard47_loop2, btnBoard48_loop2,
  171. btnBoard49_loop2, btnBoard50_loop2, btnBoard51_loop2, btnBoard52_loop2, btnBoard53_loop2, btnBoard54_loop2, btnBoard55_loop2, btnBoard56_loop2, btnBoard57_loop2, btnBoard58_loop2, btnBoard59_loop2, btnBoard60_loop2, btnBoard61_loop2, btnBoard62_loop2, btnBoard63_loop2, btnBoard64_loop2
  172. };
  173. this.Board_loop3 = new Button[64]{
  174. btnBoard1_loop3, btnBoard2_loop3, btnBoard3_loop3, btnBoard4_loop3, btnBoard5_loop3, btnBoard6_loop3, btnBoard7_loop3, btnBoard8_loop3, btnBoard9_loop3, btnBoard10_loop3, btnBoard11_loop3, btnBoard12_loop3, btnBoard13_loop3, btnBoard14_loop3, btnBoard15_loop3, btnBoard16_loop3,
  175. btnBoard17_loop3, btnBoard18_loop3, btnBoard19_loop3, btnBoard20_loop3, btnBoard21_loop3, btnBoard22_loop3, btnBoard23_loop3, btnBoard24_loop3, btnBoard25_loop3, btnBoard26_loop3, btnBoard27_loop3, btnBoard28_loop3, btnBoard29_loop3, btnBoard30_loop3, btnBoard31_loop3, btnBoard32_loop3,
  176. btnBoard33_loop3, btnBoard34_loop3, btnBoard35_loop3, btnBoard36_loop3, btnBoard37_loop3, btnBoard38_loop3, btnBoard39_loop3, btnBoard40_loop3, btnBoard41_loop3, btnBoard42_loop3, btnBoard43_loop3, btnBoard44_loop3, btnBoard45_loop3, btnBoard46_loop3, btnBoard47_loop3, btnBoard48_loop3,
  177. btnBoard49_loop3, btnBoard50_loop3, btnBoard51_loop3, btnBoard52_loop3, btnBoard53_loop3, btnBoard54_loop3, btnBoard55_loop3, btnBoard56_loop3, btnBoard57_loop3, btnBoard58_loop3, btnBoard59_loop3, btnBoard60_loop3, btnBoard61_loop3, btnBoard62_loop3, btnBoard63_loop3, btnBoard64_loop3
  178. };
  179. getData();
  180. }
  181. catch (Exception ex)
  182. {
  183. Util.UErrorMessage(ex, 0, 0);
  184. }
  185. }
  186. private void frmBoardGroup_Activated(object sender, EventArgs e)
  187. {
  188. try
  189. {
  190. this.mdi.SelectMenuIndex = 3;
  191. }
  192. catch (Exception ex)
  193. {
  194. Util.UErrorMessage(ex, 0, 0);
  195. }
  196. }
  197. private void frmBoardGroup_Disposed(object sender, EventArgs e)
  198. {
  199. try
  200. {
  201. this.mdi.SelectMenuIndex = 0;
  202. }
  203. catch (Exception ex)
  204. {
  205. Util.UErrorMessage(ex, 0, 0);
  206. }
  207. }
  208. private void getData()
  209. {
  210. try
  211. {
  212. if (this.InvokeRequired)
  213. {
  214. deleFormInit d = new deleFormInit(getData);
  215. this.Invoke(d, new object[] { });
  216. }
  217. else
  218. {
  219. init();
  220. if (mdi.ui == null) return;
  221. ReceiverTypeInfo receiverInfo = mdi.ui.MyReceiverTypeInfo;
  222. if (receiverInfo == null) return;
  223. BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType; //전체통신보드
  224. if (boardInfos != null)
  225. {
  226. foreach (BoardTypeInfo brd in boardInfos)
  227. {
  228. if (brd != null)
  229. {
  230. if (brd.UseFlag)
  231. {
  232. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  233. if (brd.Loop0UseFlag)
  234. {
  235. this.Board_loop0[brd.BoardNo - 1].Enabled = true;
  236. this.Board_loop0[brd.BoardNo - 1].BackColor = Color.Blue; // LCH 2018.02.27 : 수정됨
  237. }
  238. if (brd.Loop1UseFlag)
  239. {
  240. this.Board_loop1[brd.BoardNo - 1].Enabled = true;
  241. this.Board_loop1[brd.BoardNo - 1].BackColor = Color.Blue; // LCH 2018.02.27 : 수정됨
  242. }
  243. if (brd.Loop2UseFlag)
  244. {
  245. this.Board_loop2[brd.BoardNo - 1].Enabled = true;
  246. this.Board_loop2[brd.BoardNo - 1].BackColor = Color.Blue; // LCH 2018.02.27 : 수정됨
  247. }
  248. if (brd.Loop3UseFlag)
  249. {
  250. this.Board_loop3[brd.BoardNo - 1].Enabled = true;
  251. this.Board_loop3[brd.BoardNo - 1].BackColor = Color.Blue; // LCH 2018.02.27 : 수정됨
  252. }
  253. }
  254. }
  255. }
  256. }
  257. btnCommand_Click(btnCommand, EventArgs.Empty);
  258. }
  259. }
  260. catch (Exception ex)
  261. {
  262. Util.UErrorMessage(ex, 0, 0);
  263. }
  264. }
  265. private void init()
  266. {
  267. try
  268. {
  269. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  270. for (int i = 0; i < 64; i++)
  271. {
  272. // cyim 2013.8.1 디자인개선작업 : 시스템정보 - 중계반상태보기 imageList1->imageList_RepeaterBoard
  273. //this.PicBoard[i].BackgroundImage = imageList_RepeaterBoard.Images[3]; //비사용 -> 비활성화
  274. this.PicBoard[i].BackColor = Color.Gray;
  275. this.Board_loop0[i].Enabled = false;
  276. this.Board_loop1[i].Enabled = false;
  277. this.Board_loop2[i].Enabled = false;
  278. this.Board_loop3[i].Enabled = false;
  279. //this.lblBoardComm[i].Visible = false;
  280. }
  281. }
  282. catch (Exception ex)
  283. {
  284. Util.UErrorMessage(ex, 0, 0);
  285. }
  286. }
  287. private void btnWinClose_Click(object sender, EventArgs e)
  288. {
  289. this.Close();
  290. }
  291. private void btnCommand_Click(object sender, EventArgs e)
  292. {
  293. try
  294. {
  295. MDIParent mdi = (MDIParent)this.MdiParent;
  296. SocketUI ui = mdi.ui;
  297. //버튼 비활성 설정
  298. button_end(false);
  299. LFC.Log("타입: 수신기 조작 로그, 메세지: 시스템정보-중계기 상태보기-읽기명령 클릭");
  300. //통신보드 전체 읽기 명령
  301. dCommandResponse d = new dCommandResponse(BoardInfoAll);
  302. //명령생성 및 실행
  303. //중계기 설정 데이터를 CmdInfo에 넣어준다..
  304. CmdInfo cmd = new CmdInfo(prt_cmd_define.read_command_status, mdi.myReceiverID, 1, 0, 0, d);
  305. cmd.CommandType = "BS";
  306. cmd.ApplyRange = "B"; //차단레벨(회로타입차단용) A-All,C-Comm,B-Board,L-Loop,R-중계기,D-회로,I-입력회로,O-출력회로
  307. ui.runCommand(cmd);
  308. }
  309. catch (Exception ex)
  310. {
  311. Util.UErrorMessage(ex, 0, 0);
  312. }
  313. }
  314. //화면 마우스 커서 및 버튼 다시 클릭 못하도록 설정 및 해제
  315. private void button_end(Boolean val)
  316. {
  317. try
  318. {
  319. if (val)
  320. {
  321. this.btnCommand.Enabled = true;
  322. this.Cursor = Cursors.Default;
  323. }
  324. else
  325. {
  326. this.btnCommand.Enabled = false;
  327. this.Cursor = Cursors.WaitCursor;
  328. }
  329. }
  330. catch (Exception ex)
  331. {
  332. Util.UErrorMessage(ex, 0, 0);
  333. }
  334. }
  335. //*********************************************************************//
  336. // 통신보드 전체읽기 응답데이터 이벤트 //
  337. //*********************************************************************//
  338. public void BoardInfoAll(CmdInfo cmd)
  339. {
  340. //에러응답처리
  341. if (!Util.ComInfoErrProcess(cmd, mdi.ui.Connected, "RCVData_ReadCommandStatus")) // cyim 2015.7.23 NACK 처리 부분 오류
  342. {
  343. button_end(true);
  344. return;
  345. }
  346. try
  347. {
  348. RCVData_ReadCommandStatus resData = (RCVData_ReadCommandStatus)cmd.ResponseData;
  349. string[] status = resData.BoardConnStatus;
  350. // cyim 2016.10.31 : 대용량 수신기용 UI 변경
  351. for (int i = 0; i < 64; i++)
  352. {
  353. //
  354. // cyim 2013.8.1 디자인개선작업 : 시스템정보 - 중계반상태보기 imageList1->imageList_RepeaterBoard (회색,파랑,빨강)
  355. //
  356. // F-front,B-back,X-error,N-none 로 들어온다
  357. // 비활성화
  358. if (status[i].Equals("N"))
  359. {
  360. //this.PicBoard[i].BackgroundImage = imageList_RepeaterBoard.Images[3];
  361. this.PicBoard[i].BackColor = Color.Gray;
  362. }
  363. //사용
  364. else if (status[i].Equals("F"))
  365. {
  366. //this.PicBoard[i].BackgroundImage = imageList_RepeaterBoard.Images[1];
  367. // cyim 2013.8.1 디자인개선작업 : imageList_Loop 추가해서 버튼색상 반영
  368. //this.Board_loop0[i].BackgroundImage = imageList_Loop.Images[1];
  369. //this.Board_loop1[i].BackgroundImage = imageList_Loop.Images[1];
  370. this.PicBoard[i].BackColor = Color.Transparent;
  371. this.Board_loop0[i].BackColor = this.Board_loop1[i].BackColor = this.Board_loop2[i].BackColor = this.Board_loop3[i].BackColor = Color.AliceBlue;
  372. }
  373. // cyim 2013.8.1 중계반상태보기 화면에서 통신에러는 이미지 표시가 안됨 E->X
  374. //통신에러
  375. else if (status[i].Equals("X"))
  376. {
  377. //this.PicBoard[i].BackgroundImage = imageList_RepeaterBoard.Images[2];
  378. // cyim 2013.8.1 디자인개선작업 : imageList_Loop 추가해서 버튼색상 반영
  379. //this.Board_loop0[i].BackgroundImage = imageList_Loop.Images[2];
  380. //this.Board_loop1[i].BackgroundImage = imageList_Loop.Images[2];
  381. this.PicBoard[i].BackColor = Color.Transparent;
  382. this.Board_loop0[i].BackColor = this.Board_loop1[i].BackColor = this.Board_loop2[i].BackColor = this.Board_loop3[i].BackColor = Color.PaleVioletRed;
  383. // cyim 2013.8.1 중계반상태보기에서 통신에러 문구는 표시안함
  384. //this.lblBoardComm[i].Text = "통신에러";
  385. //this.lblBoardComm[i].Visible = true;
  386. }
  387. }
  388. }
  389. catch (Exception ex)
  390. {
  391. Util.UErrorMessage(ex, 0, 0);
  392. }
  393. finally
  394. {
  395. //버튼 비활성 해제
  396. button_end(true);
  397. }
  398. }
  399. private void btnBoard_loop_Click(object sender, EventArgs e)
  400. {
  401. try
  402. {
  403. // ex : btnBoard2_loop3
  404. Button btn = (Button)sender;
  405. string[] btn_name = null;
  406. btn_name = btn.Name.Split('_');
  407. int board_id = Int32.Parse(btn_name[0].Substring(8));
  408. int loop_no = Int32.Parse(btn_name[1].Substring(4));
  409. frmRepeaterGroup frm = new frmRepeaterGroup();
  410. frm.setBoardId(board_id, loop_no);
  411. mdi.ShowChildForm(frm);
  412. }
  413. catch (Exception ex)
  414. {
  415. Util.UErrorMessage(ex, 0, 0);
  416. }
  417. }
  418. /*
  419. private void btnBoard1_loop0_Click(object sender, EventArgs e)
  420. {
  421. try
  422. {
  423. frmRepeaterGroup frm = new frmRepeaterGroup();
  424. frm.setBoardId(1, 0);
  425. mdi.ShowChildForm(frm);
  426. }
  427. catch (Exception ex)
  428. {
  429. Util.UErrorMessage(ex, 0, 0);
  430. }
  431. }
  432. private void btnBoard1_loop1_Click(object sender, EventArgs e)
  433. {
  434. try
  435. {
  436. frmRepeaterGroup frm = new frmRepeaterGroup();
  437. frm.setBoardId(1, 1);
  438. mdi.ShowChildForm(frm);
  439. }
  440. catch (Exception ex)
  441. {
  442. Util.UErrorMessage(ex, 0, 0);
  443. }
  444. }
  445. private void btnBoard2_loop0_Click(object sender, EventArgs e)
  446. {
  447. try
  448. {
  449. frmRepeaterGroup frm = new frmRepeaterGroup();
  450. frm.setBoardId(2, 0);
  451. mdi.ShowChildForm(frm);
  452. }
  453. catch (Exception ex)
  454. {
  455. Util.UErrorMessage(ex, 0, 0);
  456. }
  457. }
  458. private void btnBoard2_loop1_Click(object sender, EventArgs e)
  459. {
  460. try
  461. {
  462. frmRepeaterGroup frm = new frmRepeaterGroup();
  463. frm.setBoardId(2, 1);
  464. mdi.ShowChildForm(frm);
  465. }
  466. catch (Exception ex)
  467. {
  468. Util.UErrorMessage(ex, 0, 0);
  469. }
  470. }
  471. private void btnBoard3_loop0_Click(object sender, EventArgs e)
  472. {
  473. try
  474. {
  475. frmRepeaterGroup frm = new frmRepeaterGroup();
  476. frm.setBoardId(3, 0);
  477. mdi.ShowChildForm(frm);
  478. }
  479. catch (Exception ex)
  480. {
  481. Util.UErrorMessage(ex, 0, 0);
  482. }
  483. }
  484. private void btnBoard3_loop1_Click(object sender, EventArgs e)
  485. {
  486. try
  487. {
  488. frmRepeaterGroup frm = new frmRepeaterGroup();
  489. frm.setBoardId(3, 1);
  490. mdi.ShowChildForm(frm);
  491. }
  492. catch (Exception ex)
  493. {
  494. Util.UErrorMessage(ex, 0, 0);
  495. }
  496. }
  497. private void btnBoard4_loop0_Click(object sender, EventArgs e)
  498. {
  499. try
  500. {
  501. frmRepeaterGroup frm = new frmRepeaterGroup();
  502. frm.setBoardId(4, 0);
  503. mdi.ShowChildForm(frm);
  504. }
  505. catch (Exception ex)
  506. {
  507. Util.UErrorMessage(ex, 0, 0);
  508. }
  509. }
  510. private void btnBoard4_loop1_Click(object sender, EventArgs e)
  511. {
  512. try
  513. {
  514. frmRepeaterGroup frm = new frmRepeaterGroup();
  515. frm.setBoardId(4, 1);
  516. mdi.ShowChildForm(frm);
  517. }
  518. catch (Exception ex)
  519. {
  520. Util.UErrorMessage(ex, 0, 0);
  521. }
  522. }
  523. private void btnBoard5_loop0_Click(object sender, EventArgs e)
  524. {
  525. try
  526. {
  527. frmRepeaterGroup frm = new frmRepeaterGroup();
  528. frm.setBoardId(5, 0);
  529. mdi.ShowChildForm(frm);
  530. }
  531. catch (Exception ex)
  532. {
  533. Util.UErrorMessage(ex, 0, 0);
  534. }
  535. }
  536. private void btnBoard5_loop1_Click(object sender, EventArgs e)
  537. {
  538. try
  539. {
  540. frmRepeaterGroup frm = new frmRepeaterGroup();
  541. frm.setBoardId(5, 1);
  542. mdi.ShowChildForm(frm);
  543. }
  544. catch (Exception ex)
  545. {
  546. Util.UErrorMessage(ex, 0, 0);
  547. }
  548. }
  549. private void btnBoard6_loop0_Click(object sender, EventArgs e)
  550. {
  551. try
  552. {
  553. frmRepeaterGroup frm = new frmRepeaterGroup();
  554. frm.setBoardId(6, 0);
  555. mdi.ShowChildForm(frm);
  556. }
  557. catch (Exception ex)
  558. {
  559. Util.UErrorMessage(ex, 0, 0);
  560. }
  561. }
  562. private void btnBoard6_loop1_Click(object sender, EventArgs e)
  563. {
  564. try
  565. {
  566. frmRepeaterGroup frm = new frmRepeaterGroup();
  567. frm.setBoardId(6, 1);
  568. mdi.ShowChildForm(frm);
  569. }
  570. catch (Exception ex)
  571. {
  572. Util.UErrorMessage(ex, 0, 0);
  573. }
  574. }
  575. private void btnBoard7_loop0_Click(object sender, EventArgs e)
  576. {
  577. try
  578. {
  579. frmRepeaterGroup frm = new frmRepeaterGroup();
  580. frm.setBoardId(7, 0);
  581. mdi.ShowChildForm(frm);
  582. }
  583. catch (Exception ex)
  584. {
  585. Util.UErrorMessage(ex, 0, 0);
  586. }
  587. }
  588. private void btnBoard7_loop1_Click(object sender, EventArgs e)
  589. {
  590. try
  591. {
  592. frmRepeaterGroup frm = new frmRepeaterGroup();
  593. frm.setBoardId(7, 1);
  594. mdi.ShowChildForm(frm);
  595. }
  596. catch (Exception ex)
  597. {
  598. Util.UErrorMessage(ex, 0, 0);
  599. }
  600. }
  601. private void btnBoard8_loop0_Click(object sender, EventArgs e)
  602. {
  603. try
  604. {
  605. frmRepeaterGroup frm = new frmRepeaterGroup();
  606. frm.setBoardId(8, 0);
  607. mdi.ShowChildForm(frm);
  608. }
  609. catch (Exception ex)
  610. {
  611. Util.UErrorMessage(ex, 0, 0);
  612. }
  613. }
  614. private void btnBoard8_loop1_Click(object sender, EventArgs e)
  615. {
  616. try
  617. {
  618. frmRepeaterGroup frm = new frmRepeaterGroup();
  619. frm.setBoardId(8, 1);
  620. mdi.ShowChildForm(frm);
  621. }
  622. catch (Exception ex)
  623. {
  624. Util.UErrorMessage(ex, 0, 0);
  625. }
  626. }
  627. private void btnBoard16_loop0_Click(object sender, EventArgs e)
  628. {
  629. try
  630. {
  631. frmRepeaterGroup frm = new frmRepeaterGroup();
  632. frm.setBoardId(16, 0);
  633. mdi.ShowChildForm(frm);
  634. }
  635. catch (Exception ex)
  636. {
  637. Util.UErrorMessage(ex, 0, 0);
  638. }
  639. }
  640. private void btnBoard16_loop1_Click(object sender, EventArgs e)
  641. {
  642. try
  643. {
  644. frmRepeaterGroup frm = new frmRepeaterGroup();
  645. frm.setBoardId(16, 1);
  646. mdi.ShowChildForm(frm);
  647. }
  648. catch (Exception ex)
  649. {
  650. Util.UErrorMessage(ex, 0, 0);
  651. }
  652. }
  653. private void btnBoard15_loop0_Click(object sender, EventArgs e)
  654. {
  655. try
  656. {
  657. frmRepeaterGroup frm = new frmRepeaterGroup();
  658. frm.setBoardId(15, 0);
  659. mdi.ShowChildForm(frm);
  660. }
  661. catch (Exception ex)
  662. {
  663. Util.UErrorMessage(ex, 0, 0);
  664. }
  665. }
  666. private void btnBoard15_loop1_Click(object sender, EventArgs e)
  667. {
  668. try
  669. {
  670. frmRepeaterGroup frm = new frmRepeaterGroup();
  671. frm.setBoardId(15, 1);
  672. mdi.ShowChildForm(frm);
  673. }
  674. catch (Exception ex)
  675. {
  676. Util.UErrorMessage(ex, 0, 0);
  677. }
  678. }
  679. private void btnBoard14_loop0_Click(object sender, EventArgs e)
  680. {
  681. try
  682. {
  683. frmRepeaterGroup frm = new frmRepeaterGroup();
  684. frm.setBoardId(14, 0);
  685. mdi.ShowChildForm(frm);
  686. }
  687. catch (Exception ex)
  688. {
  689. Util.UErrorMessage(ex, 0, 0);
  690. }
  691. }
  692. private void btnBoard14_loop1_Click(object sender, EventArgs e)
  693. {
  694. try
  695. {
  696. frmRepeaterGroup frm = new frmRepeaterGroup();
  697. frm.setBoardId(14, 1);
  698. mdi.ShowChildForm(frm);
  699. }
  700. catch (Exception ex)
  701. {
  702. Util.UErrorMessage(ex, 0, 0);
  703. }
  704. }
  705. private void btnBoard13_loop0_Click(object sender, EventArgs e)
  706. {
  707. try
  708. {
  709. frmRepeaterGroup frm = new frmRepeaterGroup();
  710. frm.setBoardId(13, 0);
  711. mdi.ShowChildForm(frm);
  712. }
  713. catch (Exception ex)
  714. {
  715. Util.UErrorMessage(ex, 0, 0);
  716. }
  717. }
  718. private void btnBoard13_loop1_Click(object sender, EventArgs e)
  719. {
  720. try
  721. {
  722. frmRepeaterGroup frm = new frmRepeaterGroup();
  723. frm.setBoardId(13, 1);
  724. mdi.ShowChildForm(frm);
  725. }
  726. catch (Exception ex)
  727. {
  728. Util.UErrorMessage(ex, 0, 0);
  729. }
  730. }
  731. private void btnBoard12_loop0_Click(object sender, EventArgs e)
  732. {
  733. try
  734. {
  735. frmRepeaterGroup frm = new frmRepeaterGroup();
  736. frm.setBoardId(12, 0);
  737. mdi.ShowChildForm(frm);
  738. }
  739. catch (Exception ex)
  740. {
  741. Util.UErrorMessage(ex, 0, 0);
  742. }
  743. }
  744. private void btnBoard12_loop1_Click(object sender, EventArgs e)
  745. {
  746. try
  747. {
  748. frmRepeaterGroup frm = new frmRepeaterGroup();
  749. frm.setBoardId(12, 1);
  750. mdi.ShowChildForm(frm);
  751. }
  752. catch (Exception ex)
  753. {
  754. Util.UErrorMessage(ex, 0, 0);
  755. }
  756. }
  757. private void btnBoard11_loop0_Click(object sender, EventArgs e)
  758. {
  759. try
  760. {
  761. frmRepeaterGroup frm = new frmRepeaterGroup();
  762. frm.setBoardId(11, 0);
  763. mdi.ShowChildForm(frm);
  764. }
  765. catch (Exception ex)
  766. {
  767. Util.UErrorMessage(ex, 0, 0);
  768. }
  769. }
  770. private void btnBoard11_loop1_Click(object sender, EventArgs e)
  771. {
  772. try
  773. {
  774. frmRepeaterGroup frm = new frmRepeaterGroup();
  775. frm.setBoardId(11, 1);
  776. mdi.ShowChildForm(frm);
  777. }
  778. catch (Exception ex)
  779. {
  780. Util.UErrorMessage(ex, 0, 0);
  781. }
  782. }
  783. private void btnBoard10_loop0_Click(object sender, EventArgs e)
  784. {
  785. try
  786. {
  787. frmRepeaterGroup frm = new frmRepeaterGroup();
  788. frm.setBoardId(10, 0);
  789. mdi.ShowChildForm(frm);
  790. }
  791. catch (Exception ex)
  792. {
  793. Util.UErrorMessage(ex, 0, 0);
  794. }
  795. }
  796. private void btnBoard10_loop1_Click(object sender, EventArgs e)
  797. {
  798. try
  799. {
  800. frmRepeaterGroup frm = new frmRepeaterGroup();
  801. frm.setBoardId(10, 1);
  802. mdi.ShowChildForm(frm);
  803. }
  804. catch (Exception ex)
  805. {
  806. Util.UErrorMessage(ex, 0, 0);
  807. }
  808. }
  809. private void btnBoard9_loop0_Click(object sender, EventArgs e)
  810. {
  811. try
  812. {
  813. frmRepeaterGroup frm = new frmRepeaterGroup();
  814. frm.setBoardId(9, 0);
  815. mdi.ShowChildForm(frm);
  816. }
  817. catch (Exception ex)
  818. {
  819. Util.UErrorMessage(ex, 0, 0);
  820. }
  821. }
  822. private void btnBoard9_loop1_Click(object sender, EventArgs e)
  823. {
  824. try
  825. {
  826. frmRepeaterGroup frm = new frmRepeaterGroup();
  827. frm.setBoardId(9, 1);
  828. mdi.ShowChildForm(frm);
  829. }
  830. catch (Exception ex)
  831. {
  832. Util.UErrorMessage(ex, 0, 0);
  833. }
  834. }
  835. */
  836. }
  837. }