FormRepeater.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. namespace FPER
  9. {
  10. // 현장도면 회로 창 클래스
  11. public partial class FormRepeater : Form
  12. {
  13. // 회로번호
  14. // 예시 : MI010110161
  15. // 설명 : MI (입력) - 01 (수신기) - 01 (통신보드) - 1 (채널계통) - 016 (중계기) - 1 (포인트)
  16. // 메인 폼 파라미터
  17. MDIParent mdi;
  18. //public int ioType = 0;
  19. // 생성자
  20. public FormRepeater(MDIParent ParentForm)
  21. {
  22. // 컴포넌트 초기화
  23. InitializeComponent();
  24. // 메인폼
  25. this.mdi = ParentForm;
  26. }
  27. // 입력 회로 내용
  28. public void SetInputContext1(string txt)
  29. {
  30. this.Input1.Text = txt;
  31. this.Input1.Select(0, 0);
  32. }
  33. public void SetInputContext2(string txt)
  34. {
  35. this.Input2.Text = txt;
  36. this.Input2.Select(0, 0);
  37. }
  38. public void SetInputContext3(string txt)
  39. {
  40. this.Input3.Text = txt;
  41. this.Input3.Select(0, 0);
  42. }
  43. public void SetInputContext4(string txt)
  44. {
  45. this.Input4.Text = txt;
  46. this.Input4.Select(0, 0);
  47. }
  48. // 출력회로
  49. public void SetOutPutText1(string txt)
  50. {
  51. this.Output1.Text = txt;
  52. this.Output1.Select(0, 0);
  53. }
  54. public void SetOutPutText2(string txt)
  55. {
  56. this.Output2.Text = txt;
  57. this.Output2.Select(0, 0);
  58. }
  59. public void SetOutPutText3(string txt)
  60. {
  61. this.Output3.Text = txt;
  62. this.Output3.Select(0, 0);
  63. }
  64. public void SetOutPutText4(string txt)
  65. {
  66. this.Output4.Text = txt;
  67. this.Output4.Select(0, 0);
  68. }
  69. // 창 사라지는 타이머
  70. int hideLevel = 100;
  71. int hideCount = 0;
  72. private void timerHide_Tick(object sender, EventArgs e)
  73. {
  74. //if (hideLevel < 10) {
  75. // this.Visible = false;
  76. //}
  77. if (this.hideCount >= 300)
  78. {
  79. this.Visible = false;
  80. }
  81. else if (this.hideCount >= 200)
  82. {
  83. this.hideLevel = hideLevel - 5;
  84. this.Opacity = ((double)hideLevel) / 100.0;
  85. }
  86. else
  87. {
  88. this.hideCount++;
  89. }
  90. this.Update();
  91. }
  92. // 보임,안보임 변경 함수
  93. private void FormDevice_VisibleChanged(object sender, EventArgs e)
  94. {
  95. if (this.Visible == true)
  96. {
  97. this.hideLevel = 100;
  98. this.Opacity = 100;
  99. this.hideCount = 0;
  100. this.timerHide.Start();
  101. }
  102. else
  103. {
  104. this.timerHide.Stop();
  105. }
  106. }
  107. // 창 클릭 함수
  108. private void FormDevice_MouseClick(object sender, MouseEventArgs e)
  109. {
  110. this.Visible = false;
  111. }
  112. private void FormDevice_Deactivate(object sender, EventArgs e)
  113. {
  114. }
  115. }
  116. }