GearBoxInfo.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 IntelligentControlForsx.Service.WindturbineInfo;
  12. using log4net;
  13. using WisdomClient;
  14. using WisdomClient.data;
  15. namespace IntelligentControlForsx.MyControls.windturbine
  16. {
  17. /// <summary>
  18. /// 齿轮箱
  19. /// </summary>
  20. public partial class GearBoxInfo : BaseControl
  21. {
  22. private static ILog logger = LogManager.GetLogger("AppInfoLog");
  23. public GearBoxInfo()
  24. {
  25. InitializeComponent();
  26. }
  27. public override void Active(string stationId, string windturbineId, string modelId)
  28. {
  29. STATIONID = stationId;
  30. WINDTURBINEID = windturbineId;
  31. timer1.Enabled = true;
  32. Refresh();
  33. }
  34. public override void DeActive()
  35. {
  36. timer1.Enabled = false;
  37. }
  38. private void timer1_Tick(object sender, EventArgs e)
  39. {
  40. if (isRefreshOver)
  41. {
  42. isRefreshOver = false;
  43. //刷新数据线程
  44. Thread refreshThread = new Thread(Refresh);
  45. refreshThread.Start();
  46. isRefreshOver = true;
  47. }
  48. //绑定数据线程
  49. Thread bindDataThread = new Thread(BindData);
  50. bindDataThread.Start();
  51. }
  52. }
  53. }