KashiyamaPump.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Xml;
  6. using Aitex.Core.Common.DeviceData;
  7. using Aitex.Core.RT.DataCenter;
  8. using Aitex.Core.RT.Device;
  9. using Aitex.Core.RT.Event;
  10. using Aitex.Core.RT.IOCore;
  11. using Aitex.Core.RT.Log;
  12. using Aitex.Core.RT.OperationCenter;
  13. using Aitex.Core.RT.SCCore;
  14. using Aitex.Core.RT.Tolerance;
  15. using Aitex.Core.Util;
  16. using MECF.Framework.Common.Communications;
  17. using MECF.Framework.Common.DataCenter;
  18. using MECF.Framework.Common.Device.Bases;
  19. using MECF.Framework.Common.Equipment;
  20. using VirgoCommon;
  21. using VirgoRT.Devices.IODevices;
  22. namespace VirgoRT.Devices
  23. {
  24. class KashiyamaPump : PumpBase
  25. {
  26. public override bool IsRunning => _pumpCtrl.IsRunning;
  27. public override bool IsError => _pumpCtrl.IsError;
  28. private readonly IoPumpCtrl _pumpCtrl;
  29. public override AITPumpData DeviceData
  30. {
  31. get
  32. {
  33. AITPumpData deviceData = new AITPumpData
  34. {
  35. DeviceName = Name,
  36. DeviceModule = Module,
  37. DeviceSchematicId = DeviceID,
  38. DisplayName = Display,
  39. IsError = false,
  40. IsWarning = false,
  41. IsOn = IsRunning,
  42. IsDryPumpEnable = true,
  43. IsN2PressureEnable = false,
  44. IsWaterFlowEnable = false,
  45. };
  46. return deviceData;
  47. }
  48. }
  49. public KashiyamaPump(ModuleName mod) : base(mod.ToString(), VirgoDevice.MainPump.ToString(), "Kashiyama Pump", "")
  50. {
  51. _pumpCtrl = DEVICE.GetDevice<IoPumpCtrl>($"{Module}.{VirgoDevice.PumpCtrl}");
  52. }
  53. public override bool Initialize()
  54. {
  55. base.Initialize();
  56. _pumpCtrl.Initialize();
  57. return true;
  58. }
  59. public override void SetPumpOnOff(bool isOn)
  60. {
  61. if (isOn)
  62. _pumpCtrl.StartPump();
  63. else
  64. _pumpCtrl.StopPump();
  65. }
  66. }
  67. }