OutInLine.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using IntelligentControlForsx.Service.WindturbineControl.Domain;
  11. using log4net;
  12. namespace IntelligentControlForsx.MyControls.windturbine
  13. {
  14. public partial class OutInLine : UserControl
  15. {
  16. private static ILog logger = LogManager.GetLogger("AppInfoLog");
  17. public OutInLine()
  18. {
  19. InitializeComponent();
  20. }
  21. private string warningNum;
  22. public string WarningNum
  23. {
  24. set
  25. {
  26. lblWarningNum.Text = value;
  27. warningNum = value;
  28. }
  29. get { return warningNum; }
  30. }
  31. /// <summary>
  32. /// 点名
  33. /// </summary>
  34. private string pointName;
  35. public string PointName
  36. {
  37. set
  38. {
  39. lblPLCName.Text = value;
  40. pointName = value;
  41. }
  42. get { return pointName; }
  43. }
  44. /// <summary>
  45. /// plc点名
  46. /// </summary>
  47. private string plcName;
  48. public string PLCName
  49. {
  50. set
  51. {
  52. lblPointName.Text = value;
  53. plcName = value;
  54. }
  55. get { return plcName; }
  56. }
  57. /// <summary>
  58. /// 点值
  59. /// </summary>
  60. private string pointValue;
  61. public string PointValue
  62. {
  63. set
  64. {
  65. try
  66. {
  67. int num = Convert.ToInt32(value);
  68. if (num == 0)
  69. lblValue.Text = "正常";
  70. else
  71. {
  72. lblValue.Text = "故障";
  73. lblWarningNum.ForeColor = Color.FromArgb(255, 128, 0);
  74. lblPLCName.ForeColor = Color.FromArgb(255, 128, 0);
  75. lblPointName.ForeColor = Color.FromArgb(255, 128, 0);
  76. lblValue.ForeColor = Color.FromArgb(255, 128, 0);
  77. }
  78. }
  79. catch (Exception ex)
  80. {
  81. logger.Info("转换错误" + ex);
  82. }
  83. finally
  84. {
  85. lblValue.Text = "正常";
  86. }
  87. pointValue = value;
  88. }
  89. get { return pointValue; }
  90. }
  91. }
  92. }