GasAnalogControl4Jet.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. *
  3. * @author seagle
  4. * @date 2024-7-22
  5. * @Description 管路图元件对象封装
  6. */
  7. using Aitex.Core.Common.DeviceData;
  8. using log4net;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. using System.Xml.Linq;
  15. namespace MECF.Framework.UI.Core.DxfScript
  16. {
  17. public class GasAnalogControl4Jet : GasBaseShape
  18. {
  19. public GasButton InnerButton { get; set; } = null;
  20. public GasButton TopButton { get; set; } = null;
  21. public GasButton LeftButton { get; set; } = null;
  22. public GasButton RightButton { get; set; } = null;
  23. public AITMfcData AITMfcData { get; set; }
  24. public bool IsMfm { get; set; } = true;
  25. public string RampngKey { get; set; }
  26. public string AlarmValueKey { get; set; }
  27. public string ValueKey { get; set; }
  28. public string MaxValueKey { get; set; }
  29. public string UnitKey { get; set; }
  30. public string Name { get; set; }
  31. public GasAnalogControl4Jet(GasButton innerButton, GasButton topButton, GasButton leftButton, GasButton rightButton)
  32. {
  33. InnerButton = innerButton;
  34. TopButton = topButton;
  35. LeftButton = leftButton;
  36. RightButton = rightButton;
  37. Id = innerButton.Id;
  38. SetDataKey();
  39. }
  40. public override bool Contains(double x, double y)
  41. {
  42. return InnerButton.Contains(x, y);
  43. }
  44. public override void Move(double x, double y)
  45. {
  46. InnerButton.Move(x, y);
  47. TopButton.Move(x, y);
  48. LeftButton.Move(x, y);
  49. RightButton.Move(x, y);
  50. }
  51. private void SetDataKey()
  52. {
  53. IsMfm = TopButton.InnerText.Text.Contains("MFM");
  54. Name = IsMfm ? TopButton.InnerText.Text : $"MFC{TopButton.InnerText.Text}";
  55. Name = Name.Replace(" ", "");
  56. ValueKey = $"PM1.{Name}.Feedback";
  57. UnitKey = $"PM1.{Name}.Unit";
  58. AlarmValueKey= $"PM1.{Name}.AlarmWatchTable";
  59. RampngKey = $"PM1.{Name}.Ramping";
  60. MaxValueKey = $"PM1.{Name}.Scal";
  61. }
  62. }
  63. }