| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | using WCS.Core;using WCS.WorkEngineering.Extensions;using WCS.WorkEngineering.Protocol.RGV;using WCS.WorkEngineering.Protocol.SRM;using WCS.WorkEngineering.Worlds;namespace WCS.WorkEngineering.Systems{    /// <summary>    ///  设备信息写入接口    /// </summary>    [BelongTo(typeof(MainWorld))]    public class SrmDebugSystem : ServiceSystem<SrmDebugInfo>    {        private List<SRM> Srms;        /// <summary>        ///  构造函数        /// </summary>        public SrmDebugSystem()        {            Srms = Device.All.Where(v => v.HasProtocol<ISRM520>()).Select(v => new SRM(v, this.World)).ToList();        }        protected override void Do(SrmDebugInfo info)        {            var srm = Srms.FirstOrDefault(v => v.Entity.Code == info.SrmCode);            srm.Data.TaskType = info.srmTaskType;            srm.Data.SLine = info.SLine;            srm.Data.SCol = info.SCol;            srm.Data.SLayer = info.SLayer;            srm.Data.ELine = info.ELine;            srm.Data.ECol = info.ECol;            srm.Data.ELayer = info.ELayer;            srm.Data.VoucherNo++;        }    }    /// <summary>    /// 设备写入信息    /// </summary>    public class SrmDebugInfo    {        public string SrmCode { get; set; }        public SrmTaskType srmTaskType { get; set; }        public short SLine { get; set; }        public short SCol { get; set; }        public short SLayer { get; set; }        public short ELine { get; set; }        public short ECol { get; set; }        public short ELayer { get; set; }    }}
 |