AgvSystems.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.ComponentModel;
  2. using WCS.Core;
  3. using WCS.WorkEngineering.Extensions;
  4. using WCS.WorkEngineering.Protocol.SRM;
  5. using WCS.WorkEngineering.Worlds;
  6. using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
  7. namespace WCS.WorkEngineering.Systems
  8. {
  9. /// <summary>
  10. /// Agv交互系统
  11. /// </summary>
  12. [BelongTo(typeof(MainWorld))]
  13. [Description("Agv交互系统")]
  14. public class AgvSystems : DeviceSystem<Station>
  15. {
  16. protected override bool ParallelDo => true;
  17. protected override bool SaveLogsToFile => true;
  18. private List<Station> devs = new List<Station>();
  19. private List<SRM> srms = new List<SRM>();
  20. public AgvSystems()
  21. {
  22. devs = Device.All.Where(v => v.HasFlag(DeviceFlags.入库, DeviceFlags.巷道口)).Select(v => new Station(v, this.World)).ToList();
  23. srms = Device.All.Where(v => v.HasProtocol(typeof(ISRM520))).Select(v => new SRM(v, this.World)).ToList();
  24. }
  25. public override void Do(Station obj)
  26. {
  27. }
  28. public override bool Select(Device dev)
  29. {
  30. return dev.Code is "1011" or "1012";
  31. }
  32. }
  33. }