AddLiquidDropperOpen.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using SHJX.Service.Control.Extends;
  2. using SHJX.Service.Control.Common.Assets;
  3. using SHJX.Service.Control.Disposables;
  4. namespace SHJX.Service.Control.Pipeline.Nodes.LiquidNode
  5. {
  6. public class AddLiquidDropperOpen : INode
  7. {
  8. public AddLiquidDropperOpen()
  9. {
  10. Name = nameof(AddLiquidDropperOpen);
  11. }
  12. public override INode Invoke()
  13. {
  14. bool locker;
  15. do
  16. {
  17. StateMachine state = DataManagerInstance.QueryStateMachine(StateMachineName.MOTOR_LOCK);
  18. locker = state.Status > 0;
  19. } while (locker);
  20. do
  21. {
  22. StateMachine state = DataManagerInstance.QueryStateMachine(StateMachineName.MOTOR_LOCKDROPPER);
  23. locker = state.Status > 0;
  24. } while (locker);
  25. DataManagerInstance.IncreaseLock(StateMachineName.MOTOR_LOCKDROPPER);
  26. bool res = true;
  27. do
  28. {
  29. char[] readData = EquipmentNames.AxisD.MotorRead();
  30. if (readData is null or not { Length: 8 })
  31. {
  32. continue;
  33. }
  34. res = readData[2].Equals('0');
  35. Thread.Sleep(800);
  36. } while (!res);
  37. res = EquipmentNames.AxisD.LiquidMotorMove(Convert.ToInt32(-170* 4000));
  38. return this;
  39. }
  40. }
  41. }