刷新界面

  1. protected override void StatusUpdate(Panda.Model.DTO.Modbus.VFC.DeviceVFCInfo data)
  2. {
  3. #region 更新界面状态
  4. try
  5. {
  6. BeginInvoke(new Action(() =>
  7. {
  8. #region 更新界面状态
  9. if (data == null)
  10. {
  11. return;
  12. }
  13. titleRunStatus.Elements[0].Text = data.RunStatus ? "正在运行":"已停止";
  14. titleA.Elements[0].Text = data.A.ToString("f2");
  15. titleBar.Elements[0].Text = data.BAR.ToString("f2");
  16. titleHZ.Elements[0].Text = data.HZ.ToString("f2");
  17. if (data.RunStatus)
  18. {
  19. tileBarItem5.Text = "关闭变频";
  20. tileBarItem5.AppearanceItem.Normal.BackColor = Color.Green;
  21. }
  22. else {
  23. tileBarItem5.Text = "打开变频";
  24. tileBarItem5.AppearanceItem.Normal.BackColor = Color.Orange;
  25. }
  26. if (data.WarnStatus == 0)
  27. {
  28. tileBarItem5.Elements[1].Text = "";
  29. }
  30. else
  31. {
  32. tileBarItem5.Elements[1].Text = "警报请检查设备";
  33. }
  34. #endregion
  35. }));
  36. }
  37. catch (Exception ex)
  38. {
  39. Panda.Framework.LogHelper.WriteExceptionLog("程序操作异常", ex);
  40. }
  41. #endregion
  42. }