DataCollectionSysyem.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.ComponentModel;
  2. using WCS.Core;
  3. using WCS.Entity.Protocol.Station;
  4. using WCS.Service.Worlds;
  5. using WCS.WorkEngineering.Extensions;
  6. namespace WCS.Service.Systems
  7. {
  8. /// <summary>
  9. /// 数据采集系统
  10. /// </summary>
  11. //[BelongTo(typeof(DataCollectionWorld))]
  12. [Description("数据采集系统")]
  13. public class DataCollectionSysyem : ServiceSystem<bool, bool>
  14. {
  15. public List<Device<IStation520, IStation521>> ConvList;
  16. public DataCollectionSysyem()
  17. {
  18. ConvList = World.Devices.Where(v => v.IsConv()).Select(v => new Device<IStation520, IStation521>(v)).ToList();
  19. }
  20. protected override bool Do(bool obj)
  21. {
  22. //Db.Do(db =>
  23. //{
  24. // var plcData = new WCS_PlcData()
  25. // {
  26. // UPDATETIME = DateTime.Now,
  27. // WAREHOUSE = "111",
  28. // CONTENT = JsonConvert.SerializeObject(ConvList),
  29. // };
  30. // db.Default.Insertable<WCS_PlcData>(plcData).ExecuteCommand(); ;
  31. //});
  32. Console.WriteLine("11111");
  33. return true;
  34. }
  35. }
  36. }