ControlFormTop.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.Control.FormInfo;
  11. namespace IntelligentControlForsx.MyControls
  12. {
  13. public partial class ControlFormTop : UserControl
  14. {
  15. public ControlFormTop()
  16. {
  17. InitializeComponent();
  18. }
  19. public void BindStationInfo(StatInfo info)
  20. {
  21. lblZFDL.Text = info.PowerAll != null ? info.PowerAll.Value.ToString("f2") : "";
  22. lblNFDL.Text = info.PowerByYear != null ? info.PowerByYear.Value.ToString("f2") : "";
  23. lblYFDL.Text = info.PowerByMonth != null ? info.PowerByMonth.Value.ToString("f2") : "0";
  24. lblRFDL.Text = info.PowerByDay != null ? info.PowerByDay.Value.ToString("f2") : "";
  25. lblPower.Text = info.Power.HasValue ? info.Power.Value.ToString("f2") : "0";
  26. lblWindSpeed.Text = info.Speed.HasValue ? info.Speed.Value.ToString("f2") : "0";
  27. lblAllCount.Text = info.LinkCount.HasValue ? "接入 " + info.LinkCount.Value.ToString() : "0";
  28. lblOnlineCount.Text = info.OnlineCount.HasValue ? "并网 " + info.OnlineCount.Value.ToString() : "0";
  29. lblStandbyCount.Text = info.StandByCount.HasValue ? "待机 " + info.StandByCount.Value.ToString() : "0";
  30. lblFaultCount.Text = info.FaultCount.HasValue ? "故障 " + info.FaultCount.ToString() : "0";
  31. lblMaintainCount.Text = info.MaintainCount.HasValue ? "维护 " + info.MaintainCount.Value.ToString() : "0";
  32. lblOfflineCount.Text = info.OfflineCount.HasValue ? "离线 " + info.OfflineCount.Value.ToString() : "0";
  33. lblStartCount.Text = info.StartCount.HasValue ? "启动 " + info.StartCount.Value.ToString() : "0";
  34. lblStopCount.Text = info.StopCount.HasValue ? "停机 " + info.StopCount.ToString() : "0";
  35. lblOnPowerCount.Text = info.OnPowerCount.HasValue ? "上电 " + info.OnPowerCount.ToString() : "0";
  36. string stationName = "";
  37. switch (info.StationId)
  38. {
  39. case "NSS_FDC":
  40. stationName = "牛首山风电场";
  41. break;
  42. case "XS_FDC":
  43. stationName = "香山风电场";
  44. break;
  45. case "SBQ_FDC":
  46. stationName = "石板泉风电场";
  47. break;
  48. case "MHS_FDC":
  49. stationName = "麻黄山风电场";
  50. break;
  51. case "QS_FDC":
  52. stationName = "青山风电场";
  53. break;
  54. case "0":
  55. stationName = "石板泉风电场";
  56. break;
  57. }
  58. lblStationName.Text = stationName;
  59. }
  60. public void BindAllStationInfo(StatInfo info)
  61. {
  62. if (info != null)
  63. {
  64. lblAllPowerCount.Text = info.PowerAll.HasValue ? info.PowerAll.Value.ToString("f2") : "0";
  65. lblAllPowerByYear.Text = info.PowerByYear.HasValue ? info.PowerByYear.Value.ToString("f2") : "0";
  66. lblAllPowerByMonth.Text = info.PowerByMonth != null ? info.PowerByMonth.Value.ToString("f2") : "0";
  67. lblAllPowerByDay.Text = info.PowerByDay.HasValue ? info.PowerByDay.Value.ToString("f2") : "0";
  68. lblAllPower.Text = info.Power.HasValue ? info.Power.Value.ToString("f2") : "0";
  69. lblAllSpeed.Text = info.Speed.HasValue ? info.Speed.Value.ToString("f2") : "0";
  70. // lblAllLink.Text = "接入:"+info.LinkCount.ToString();
  71. string run = info.OnlineCount.HasValue ? info.OnlineCount.Value.ToString() : "0";
  72. string standBy = info.StandByCount.HasValue ? info.StandByCount.Value.ToString() : "0";
  73. string fault = info.FaultCount.HasValue ? info.FaultCount.Value.ToString() : "0";
  74. string maintain = info.MaintainCount.HasValue ? info.MaintainCount.Value.ToString() : "0";
  75. string offline = info.OfflineCount.HasValue ? info.OfflineCount.Value.ToString() : "0";
  76. string start = info.StartCount.HasValue ? info.StartCount.Value.ToString() : "0";
  77. string stop = info.StopCount.HasValue ? info.StopCount.Value.ToString() : "0";
  78. string onPower = info.OnPowerCount.HasValue ? info.OnPowerCount.Value.ToString() : "0";
  79. lblAllRun.Text = "运行:" + run;
  80. lblAllStandby.Text = "待机:" + standBy;
  81. lblAllFault.Text = "故障:" + fault;
  82. lblAllMaintain.Text = "维护:" + maintain;
  83. lblAllOffline.Text = "离线:" + offline;
  84. lblAllStart.Text = "启动:" + start;
  85. lblAllStop.Text = "停机:" + stop;
  86. lblAllOnPower.Text = "上电:" + onPower;
  87. }
  88. }
  89. }
  90. }