SilverSulfateOperate.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using SHJX.Service.ServerClient;
  2. using SHJX.Service.Control.PortOperate.Interface;
  3. using SHJX.Service.Control.Common;
  4. namespace SHJX.Service.Control.PortOperate
  5. {
  6. public class SilverSulfateOperate : PortOperateImp
  7. {
  8. /// <summary>
  9. /// 硫酸银
  10. /// </summary>
  11. /// <param name="optClient"></param>
  12. public SilverSulfateOperate(OptClient optClient) : base(optClient)
  13. {
  14. OpName = "SilverSulfate";
  15. }
  16. /*protected override void CutPipe(string pipeName)
  17. {
  18. OptPipe(() =>
  19. {
  20. var readRes = Read();
  21. if (readRes is null || readRes.Length < 1) return false;
  22. var res = pipeName switch
  23. {
  24. "In" => readRes[6].Equals('0'),
  25. "Out1" => readRes[5].Equals('0'),
  26. "Out2" => readRes[7].Equals('0'),
  27. _ => false,
  28. };
  29. return res;
  30. });
  31. }*/
  32. public override bool LiquidOperation(string pipeName, long quantity)
  33. {
  34. using (OptionSilverSulfatePipe optPipe = new(pipeName))
  35. {
  36. return MotorWrite(quantity); //吸液
  37. }
  38. }
  39. }
  40. }