RoomInfo.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using WisdomClient;
  12. using WisdomClient.data;
  13. namespace IntelligentControlForsx.MyControls.windturbine
  14. {
  15. /// <summary>
  16. /// 机舱信息
  17. /// </summary>
  18. public partial class RoomInfo : BaseControl
  19. {
  20. public RoomInfo()
  21. {
  22. InitializeComponent();
  23. }
  24. public override void Active(string stationId, string windturbineId, string modelId)
  25. {
  26. STATIONID = stationId;
  27. WINDTURBINEID = windturbineId;
  28. timer1.Enabled = true;
  29. Refresh();
  30. }
  31. public override void DeActive()
  32. {
  33. timer1.Enabled = false;
  34. }
  35. private void timer1_Tick(object sender, EventArgs e)
  36. {
  37. if (isRefreshOver)
  38. {
  39. isRefreshOver = false;
  40. //刷新数据线程
  41. Thread refreshThread = new Thread(Refresh);
  42. refreshThread.Start();
  43. isRefreshOver = true;
  44. }
  45. //绑定数据线程
  46. Thread bindDataThread = new Thread(BindData);
  47. bindDataThread.Start();
  48. }
  49. }
  50. }