TitrationStirPort.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using SHJX.Service.Common.Extend;
  3. using SHJX.Service.Common.ReadXML;
  4. using SHJX.Service.Model.Control;
  5. using SHJX.Service.ServerClient.Interface;
  6. using SHJX.Service.ServerClient.TempController;
  7. using SHJX.Service.Common.Logging;
  8. using Microsoft.Extensions.Logging;
  9. namespace SHJX.Service.ServerClient.RS485Control
  10. {
  11. /// <summary>
  12. /// 消解位搅拌
  13. /// </summary>
  14. public class TitrationStirPort : SerialPortImp, PortControlImp
  15. {
  16. private static readonly ILogger logger = LogFactory.BuildLogger(typeof(TitrationStirPort));
  17. /// <summary>
  18. /// 消解位搅拌
  19. /// </summary>
  20. /// <param name="log">日志</param>
  21. /// <param name="config">配置</param>
  22. public TitrationStirPort( ReadConfigUtil config)
  23. : base( config) { }
  24. public object Read(PortArgs args)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. public bool Write(PortArgs args)
  29. {
  30. var way = args.WriteWay switch
  31. {
  32. WriteWay.Start => "L",
  33. WriteWay.Stop => "H",
  34. _ => throw new ArgumentNullException(args.WriteWay.GetEnumDesc<WriteWay>())
  35. };
  36. return MotorStorage(args.NodeId, 2, way);
  37. }
  38. }
  39. }