BasicInfo.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Drawing;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using IntelligentControlForsx.Service.WindturbineInfo;
  13. using log4net;
  14. using WisdomClient;
  15. using WisdomClient.data;
  16. namespace IntelligentControlForsx.MyControls.windturbine
  17. {
  18. /// <summary>
  19. /// 基本参数
  20. /// </summary>
  21. public partial class BasicInfo : BaseControl
  22. {
  23. private static ILog logger = LogManager.GetLogger("AppInfoLog");
  24. public BasicInfo()
  25. {
  26. InitializeComponent();
  27. }
  28. public override void Active(string stationId, string windturbineId, string modelId)
  29. {
  30. STATIONID = stationId;
  31. WINDTURBINEID = windturbineId;
  32. timer1.Enabled = true;
  33. Refresh();
  34. }
  35. public override void DeActive()
  36. {
  37. timer1.Enabled = false;
  38. }
  39. private void timer1_Tick(object sender, EventArgs e)
  40. {
  41. if (isRefreshOver)
  42. {
  43. isRefreshOver = false;
  44. //刷新数据线程
  45. Thread refreshThread = new Thread(Refresh);
  46. refreshThread.Start();
  47. isRefreshOver = true;
  48. }
  49. //绑定数据线程
  50. Thread bindDataThread = new Thread(BindData);
  51. bindDataThread.Start();
  52. }
  53. }
  54. }