TitrationDropperClose.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using SHJX.Service.Control.Common.Assets;
  2. namespace SHJX.Service.Control.Pipeline.Nodes.LiquidNode
  3. {
  4. public class TitrationDropperClose : INode
  5. {
  6. private static readonly ILogger logger = LogFactory.BuildLogger(typeof(LiquidPipeSwitch));
  7. public TitrationDropperClose()
  8. {
  9. Name = nameof(TitrationDropperClose);
  10. }
  11. public override INode Invoke()
  12. {
  13. try
  14. {
  15. bool res2 = EquipmentNames.TitrationDropperInversion.RegisterOpen();
  16. Thread.Sleep(2000);
  17. do
  18. {
  19. Thread.Sleep(300);
  20. char[] readData = EquipmentNames.TitrationDropper.MotorRead();
  21. if (readData is null or not { Length: 8 })
  22. {
  23. continue;
  24. }
  25. res2 = readData[5 - 1].Equals('0');
  26. } while (!res2);
  27. EquipmentNames.TitrationDropperInversion.RegisterClose();
  28. logger.LogInformation($"滴定1****滴嘴关闭");
  29. return this;
  30. }
  31. catch
  32. { return this; }
  33. }
  34. private void thThread()
  35. {
  36. int i = 0;
  37. while (i < 20)
  38. {
  39. i++;
  40. Thread.Sleep(150);
  41. }
  42. EquipmentNames.TitrationDropperInversion.RegisterClose();
  43. }
  44. }
  45. }