林豪 左 il y a 2 ans
Parent
commit
01de3bf8bd
30 fichiers modifiés avec 316 ajouts et 70 suppressions
  1. 1 0
      WCS.Core/VitrualRedisPLC.cs
  2. 1 1
      WCS.Entity.Protocol/BCR/IBCR81.cs
  3. 1 1
      WCS.Entity.Protocol/BCR/WCS_BCR80.cs
  4. 1 1
      WCS.Entity.Protocol/BCR/WCS_BCR81.cs
  5. 6 5
      WCS.Entity.Protocol/DataStructure/DeviceDataPack.cs
  6. 9 8
      WCS.Entity.Protocol/DataStructure/StationData.cs
  7. 1 1
      WCS.Entity.Protocol/SRM/WCS_SRM520.cs
  8. 1 1
      WCS.Entity.Protocol/SRM/WCS_SRM521.cs
  9. 1 1
      WCS.Entity.Protocol/SRM/WCS_SRM537.cs
  10. 1 2
      WCS.Entity.Protocol/Station/StationEnum.cs
  11. 51 0
      WCS.Entity.Protocol/Station/WCS_Station520.cs
  12. 39 0
      WCS.Entity.Protocol/Station/WCS_Station521.cs
  13. 27 0
      WCS.Entity.Protocol/Station/WCS_Station523.cs
  14. 27 0
      WCS.Entity.Protocol/Station/WCS_Station91.cs
  15. 4 0
      WCS.Service/PLCAccessors/SiemensS7PLC.cs
  16. 1 1
      WCS.Service/Worker.cs
  17. 1 1
      WCS.WorkEngineering/Extensions/BCRExtension.cs
  18. 1 1
      WCS.WorkEngineering/Extensions/StationExtension.cs
  19. 1 0
      WCS.WorkEngineering/ProtocolProxy.cs
  20. 1 1
      WCS.WorkEngineering/Systems/DataCollectionSysyem.cs
  21. 2 2
      WCS.WorkEngineering/Systems/DeviceWriteSystem.cs
  22. 58 0
      WCS.WorkEngineering/Systems/GetDeviceSystem.cs
  23. 2 1
      WCS.WorkEngineering/Systems/OutboundSiteInteractionSystems.cs
  24. 0 22
      WCS.WorkEngineering/Systems/SrmSystems.cs
  25. 18 10
      WCS.WorkEngineering/WebApi/Controllers/AgvApi.cs
  26. 39 1
      WCS.WorkEngineering/WebApi/Controllers/AgvController.cs
  27. 13 0
      WCS.WorkEngineering/WebApi/Controllers/WcsController.cs
  28. 1 1
      WCS.WorkEngineering/WebApi/Models/AGV/Request/ContinueTaskRequest.cs
  29. 6 7
      WCS.WorkEngineering/WorkStart.cs
  30. 1 1
      WCS.WorkEngineering/Worlds/DataCollectionWorld.cs

+ 1 - 0
WCS.Core/VitrualRedisPLC.cs

@@ -25,6 +25,7 @@ namespace WCS.Core
             {
                 redis.SetRange(key, 0, new byte[dbLen]);
             }
+
             var res = redis.GetRange<byte[]>(key, address, address + length - 1);
             return res;
         }

+ 1 - 1
WCS.Entity.Protocol/BCR/IBCR81.cs

@@ -10,7 +10,7 @@ namespace WCS.Entity.Protocol.BCR
         /// <summary>
         /// 内容
         /// </summary>
-        [StringLength(130)]
+        [StringLength(8)]
         string Content { get; set; }
     }
 }

+ 1 - 1
WCS.Entity.Protocol/BCR/WCS_BCR80.cs

@@ -6,7 +6,7 @@ namespace WCS.Entity.Protocol.BCR
     /// 读码器读取协议
     /// </summary>
     [DataContract]
-    public class WCS_BCR80 : WCS_PROTOCOLDATA, IBCR80
+    public class WCS_BCR80 : IBCR80
     {
         /// <summary>
         /// 内容

+ 1 - 1
WCS.Entity.Protocol/BCR/WCS_BCR81.cs

@@ -6,7 +6,7 @@ namespace WCS.Entity.Protocol.BCR
     /// 读码器写入协议81
     /// </summary>
     [DataContract]
-    public class WCS_BCR81 : WCS_PROTOCOLDATA, IBCR80
+    public class WCS_BCR81 : IBCR80
     {
         /// <summary>
         /// 内容

+ 6 - 5
WCS.Entity.Protocol/DataStructure/DeviceDataPack.cs

@@ -28,32 +28,33 @@ namespace WCS.Entity.Protocol.DataStructure
         public DeviceDataCollection<StationData> StationDatas { get; set; }
 
         /// <summary>
-        ///  
+        ///  扫码器数据
         /// </summary>
+        [DataMember(Order = 3)]
         public DeviceDataCollection<BCRData> BcrDatas { get; set; }
 
         /// <summary>
         ///  机器人数据集
         /// </summary>
-        [DataMember(Order = 3)]
+        [DataMember(Order = 4)]
         public DeviceDataCollection<RobotData> RobotData { get; set; }
 
         /// <summary>
         ///  产线数据集
         /// </summary>
-        [DataMember(Order = 4)]
+        [DataMember(Order = 5)]
         public DeviceDataCollection<ProdLineData> ProdLineData { get; set; }
 
         /// <summary>
         ///  时间
         /// </summary>
-        [DataMember(Order = 5)]
+        [DataMember(Order = 6)]
         public DateTime Frame { get; set; }
 
         /// <summary>
         /// 回放最早时间
         /// </summary>
-        [DataMember(Order = 6)]
+        [DataMember(Order = 7)]
         public int PlaybackSeconds { get; set; }
     }
 }

+ 9 - 8
WCS.Entity.Protocol/DataStructure/StationData.cs

@@ -1,20 +1,21 @@
 using System.Runtime.Serialization;
+using WCS.Entity.Protocol.Station;
 
 namespace WCS.Entity.Protocol.DataStructure
 {
     [DataContract]
     public class StationData : DeviceData
     {
-        //[DataMember(Order = 3)]
-        //public Device<IStation520> D520 { get; set; }
+        [DataMember(Order = 3)]
+        public WCS_Station520 D520 { get; set; }
 
-        //[DataMember(Order = 4)]
-        //public Device<IStation521> D521 { get; set; }
+        [DataMember(Order = 4)]
+        public WCS_Station521 D521 { get; set; }
 
-        //[DataMember(Order = 5)]
-        //public Device<IStation523> D523 { get; set; }
+        [DataMember(Order = 5)]
+        public WCS_Station523 D523 { get; set; }
 
-        //[DataMember(Order = 4)]
-        //public WCS_RobotStation RobotStation { get; set; }
+        [DataMember(Order = 4)]
+        public WCS_Station91 D91 { get; set; }
     }
 }

+ 1 - 1
WCS.Entity.Protocol/SRM/WCS_SRM520.cs

@@ -6,7 +6,7 @@ namespace WCS.Entity.Protocol.SRM
     ///  SRM520
     /// </summary>
     [DataContract]
-    public class WCS_SRM520 : WCS_PROTOCOLDATA, ISRM520
+    public class WCS_SRM520 :ISRM520
     {
         /// <inheritdoc/>
         [DataMember(Order = 0)]

+ 1 - 1
WCS.Entity.Protocol/SRM/WCS_SRM521.cs

@@ -6,7 +6,7 @@ namespace WCS.Entity.Protocol.SRM
     ///  SRM521
     /// </summary>
     [DataContract]
-    public class WCS_SRM521 : WCS_PROTOCOLDATA, ISRM521
+    public class WCS_SRM521 : ISRM521
     {
         /// <inheritdoc/>
         [DataMember(Order = 0)]

+ 1 - 1
WCS.Entity.Protocol/SRM/WCS_SRM537.cs

@@ -6,7 +6,7 @@ namespace WCS.Entity.Protocol.SRM
     ///  SRM537
     /// </summary>
     [DataContract]
-    public class WCS_SRM537 : WCS_PROTOCOLDATA, ISRM537
+    public class WCS_SRM537 :  ISRM537
     {
         /// <inheritdoc/>
         [DataMember(Order = 0)]

+ 1 - 2
WCS.Entity.Protocol/Station/StationEnum.cs

@@ -2,7 +2,6 @@
 
 namespace WCS.Entity.Protocol.Station
 {
-    
     /// <summary>
     /// 输送机模式
     /// </summary>
@@ -28,7 +27,7 @@ namespace WCS.Entity.Protocol.Station
     /// 输送机警报
     /// </summary>
     [Flags]
-    public enum AlarmEunm
+    public enum AlarmEunm : ushort
     {
     }
 

+ 51 - 0
WCS.Entity.Protocol/Station/WCS_Station520.cs

@@ -0,0 +1,51 @@
+using System.Runtime.Serialization;
+
+namespace WCS.Entity.Protocol.Station
+{
+    /// <summary>
+    ///  520
+    /// </summary>
+    [DataContract]
+    public class WCS_Station520 :  IStation523
+    {
+        /// <inheritdoc/>
+        [DataMember(Order = 0)]
+        public int TaskNumber { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 1)]
+        public short GoodsStart { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 2)]
+        public short GoodsEnd { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 3)]
+        public ModeEunm Mode { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 4)]
+        public short CmdType { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 5)]
+        public short VoucherNo { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 6)]
+        public AlarmEunm Alarm { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 7)]
+        public short RES { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 8)]
+        public StatusEunm Status { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 9)]
+        public float RunTime { get; set; }
+    }
+}

+ 39 - 0
WCS.Entity.Protocol/Station/WCS_Station521.cs

@@ -0,0 +1,39 @@
+using System.Runtime.Serialization;
+
+namespace WCS.Entity.Protocol.Station
+{
+    /// <summary>
+    ///  521
+    /// </summary>
+    [DataContract]
+    public class WCS_Station521 : IStation521
+    {
+        /// <inheritdoc/>
+        [DataMember(Order = 0)]
+        public int TaskNumber { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 1)]
+        public short GoodsStart { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 2)]
+        public short GoodsEnd { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 3)]
+        public ModeEunm Mode { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 4)]
+        public short CmdType { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 5)]
+        public short VoucherNo { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 6)]
+        public short Request { get; set; }
+    }
+}

+ 27 - 0
WCS.Entity.Protocol/Station/WCS_Station523.cs

@@ -0,0 +1,27 @@
+using System.Runtime.Serialization;
+
+namespace WCS.Entity.Protocol.Station
+{
+    /// <summary>
+    ///  523
+    /// </summary>
+    [DataContract]
+    public class WCS_Station523 :  IStation91
+    {
+        /// <inheritdoc/>
+        [DataMember(Order = 0)]
+        public ShapeAlarmEunm ShapeAlarm { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 1)]
+        public float Weight { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 2)]
+        public float Length { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 3)]
+        public float Width { get; set; }
+    }
+}

+ 27 - 0
WCS.Entity.Protocol/Station/WCS_Station91.cs

@@ -0,0 +1,27 @@
+using System.Runtime.Serialization;
+
+namespace WCS.Entity.Protocol.Station
+{
+    /// <summary>
+    ///  91
+    /// </summary>
+    [DataContract]
+    public class WCS_Station91 : IStation91
+    {
+        /// <inheritdoc/>
+        [DataMember(Order = 0)]
+        public ShapeAlarmEunm ShapeAlarm { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 1)]
+        public float Weight { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 2)]
+        public float Length { get; set; }
+
+        /// <inheritdoc/>
+        [DataMember(Order = 3)]
+        public float Width { get; set; }
+    }
+}

+ 4 - 0
WCS.Service/PLCAccessors/SiemensS7PLC.cs

@@ -25,6 +25,10 @@ namespace WCS.Service.PLCAccessors
 
             if (!plc.Connected)
                 plc.Connect();
+            if (db == 81)
+            {
+                var aa = 0;
+            }
             var res = plc.ReadArea(AreaType.DB, db, address, length, DataType.Byte);
             if (res == null)
                 throw new Exception("读取DB块数据失败");

+ 1 - 1
WCS.Service/Worker.cs

@@ -66,7 +66,7 @@ namespace WCS.Service
             {
                 if (ServiceHub.DbConnectionStrings.All(v => v.Key != Wcsdb)) throw new Exception("请在DbConnectionStrings中配置WCS基础数据库连接字符串");
                 if (ServiceHub.DbConnectionStrings.All(v => v.Key == Wcsdb && !v.IsDefault)) throw new Exception("请在DbConnectionStrings中配置WCS基础数据库为默认数据库");
-                if (ServiceHub.DbConnectionStrings.All(v => v.Key != WcsDlog)) throw new Exception("请在DbConnectionStrings中配置WCS日志数据库连接字符串");
+               // if (ServiceHub.DbConnectionStrings.All(v => v.Key != WcsDlog)) throw new Exception("请在DbConnectionStrings中配置WCS日志数据库连接字符串");
             }
 
             //设置连接信息

+ 1 - 1
WCS.WorkEngineering/Extensions/BCRExtension.cs

@@ -8,7 +8,7 @@ namespace WCS.WorkEngineering.Extensions
     /// <summary>
     ///  BCR扩展
     /// </summary>
-    public class BCR : Device<IBCR80, IBCR81>
+    public class BCR : Device<IBCR81>
     {
         /// <summary>
         ///  BCR扩展

+ 1 - 1
WCS.WorkEngineering/Extensions/StationExtension.cs

@@ -5,7 +5,7 @@ using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.Extensions
 {
-    public class Station : Device<IStation520, IStation521, IStation523>
+    public class Station : Device<IStation523, IStation521, IStation523>
     {
         public Station(Device device, World world) : base(device, world)
         {

+ 1 - 0
WCS.WorkEngineering/ProtocolProxy.cs

@@ -11,6 +11,7 @@ namespace WCS.Service
 
         protected override void DataChanged()
         {
+
             Console.WriteLine($"{Device.Code} Changed");
         }
     }

+ 1 - 1
WCS.WorkEngineering/Systems/DataCollectionSysyem.cs

@@ -23,7 +23,7 @@ namespace WCS.Service.Systems
 
         public DataCollectionSysyem()
         {
-            ConvList = Device.All.Where(v => v.HasProtocol(typeof(IStation520))).Select(v => new Station(v, this.World)).ToList();
+            ConvList = Device.All.Where(v => v.HasProtocol(typeof(IStation523))).Select(v => new Station(v, this.World)).ToList();
         }
 
         protected override bool Do(bool obj)

+ 2 - 2
WCS.WorkEngineering/Systems/DeviceWriteSystem.cs

@@ -24,7 +24,7 @@ namespace WCS.WorkEngineering.Systems
         /// </summary>
         public DeviceWriteSystem()
         {
-            Convs = Device.All.Where(v => v.HasProtocol<IStation520>()).Select(v => new Station(v, this.World)).ToDictionary(v => v.Entity.Code, v => v);
+            Convs = Device.All.Where(v => v.HasProtocol<IStation523>()).Select(v => new Station(v, this.World)).ToDictionary(v => v.Entity.Code, v => v);
             Srms = Device.All.Where(v => v.HasProtocol<ISRM520>()).Select(v => new SRM(v, this.World)).ToDictionary(v => v.Entity.Code, v => v);
         }
 
@@ -43,7 +43,7 @@ namespace WCS.WorkEngineering.Systems
 
                 case DeviceTypeEnum.DEV:
                     var conv = Convs[info.Code];
-                    type = typeof(IStation520).Assembly.GetTypes().Where(v => v.Name == info.Protocol).First();
+                    type = typeof(IStation523).Assembly.GetTypes().Where(v => v.Name == info.Protocol).First();
                     obj = conv.Entity.Protocol(type, this.World);
 
                     break;

+ 58 - 0
WCS.WorkEngineering/Systems/GetDeviceSystem.cs

@@ -0,0 +1,58 @@
+using WCS.Core;
+using WCS.Entity.Protocol.BCR;
+using WCS.Entity.Protocol.SRM;
+using WCS.Entity.Protocol.Station;
+using WCS.WorkEngineering.Extensions;
+using WCS.WorkEngineering.Worlds;
+
+namespace WCS.WorkEngineering.Systems
+{
+    /// <summary>
+    ///  设备信息写入接口
+    /// </summary>
+    [BelongTo(typeof(MainWorld))]
+    public class GetDeviceSystem : ServiceSystem<string, object>
+    {
+        /// <summary>
+        /// 所有的站台
+        /// </summary>
+        private List<Station> Convs;
+
+        private List<SRM> Srms;
+
+        private List<BCR> Bcrs;
+
+        private List<Device<IStation91>> Device91;
+
+        /// <summary>
+        ///  构造函数
+        /// </summary>
+        public GetDeviceSystem()
+        {
+            Convs = Device.All.Where(v => v.HasProtocol<IStation523>()).Select(v => new Station(v, this.World)).ToList();
+            Srms = Device.All.Where(v => v.HasProtocol<ISRM520>()).Select(v => new SRM(v, this.World)).ToList();
+            Bcrs = Device.All.Where(v => v.HasProtocol<IBCR81>()).Select(v => new BCR(v, this.World)).ToList();
+            Device91 = Device.All.Where(v => v.HasProtocol<IStation91>()).Select(v => new Device<IStation91>(v, this.World)).ToList();
+        }
+
+        protected override object Do(string info)
+        {
+            switch (info)
+            {
+                case "堆垛机":
+                    return Srms;
+
+                case "输送机":
+                    return Convs;
+
+                case "读码器":
+                    return Bcrs;
+
+                case "外检":
+                    return Device91;
+
+                default: return "未知设备类型";
+            }
+        }
+    }
+}

+ 2 - 1
WCS.WorkEngineering/Systems/OutboundSiteInteractionSystems.cs

@@ -1,5 +1,6 @@
 using WCS.Core;
 using WCS.WorkEngineering.Extensions;
+using WCS.WorkEngineering.Worlds;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
 
 namespace WCS.WorkEngineering.Systems
@@ -7,7 +8,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     /// 出库站台交互
     /// </summary>
-    //[BelongTo(typeof(MainWorld))]
+    [BelongTo(typeof(MainWorld))]
     public class OutboundSiteInteractionSystems : DeviceSystem<Station>
     {
         protected override bool ParallelDo => true;

+ 0 - 22
WCS.WorkEngineering/Systems/SrmSystems.cs

@@ -56,26 +56,6 @@ namespace WCS.WorkEngineering.Systems
 
         public override void Do(SRM obj)
         {
-            if (obj.Entity.Code == "SRM1")
-            {
-                if (obj.Data.VoucherNo != obj.Data2.VoucherNo) return;
-              // if (obj.Data2.RunStatus != SrmRunStatus.Idle) throw new KnownException($"堆垛机处于{obj.Data2.RunStatus}状态", LogLevelEnum.High);
-                obj.Data.TaskType = SrmTaskTypeEnum.DeleteTask;
-                obj.Data.SLine = 6;
-                obj.Data.SCol = 1;
-                obj.Data.SLayer = 1;
-                obj.Data.EDepth = ForkPosition.OneDepth;
-                obj.Data.ELine = 1014;
-                obj.Data.ECol = 1;
-                obj.Data.ELayer = 1;
-                obj.Data.EDepth = ForkPosition.TwoDepth;
-                obj.Data.VoucherNo++;
-            }
-            else
-            {
-                return;
-            }
-
             //判断堆垛机是否报警
             if (obj.Data2.Status.HasFlag(SrmStatus.Alarm)) throw new KnownException(obj.Data3.Alarm.ToString(), LogLevelEnum.High);
 
@@ -309,6 +289,4 @@ namespace WCS.WorkEngineering.Systems
             return dev.Code.Contains("SRM");
         }
     }
-
-   
 }

+ 18 - 10
WCS.WorkEngineering/WebApi/Controllers/AgvApi.cs

@@ -42,18 +42,18 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         /// <returns></returns>
         public static GenAgvSchedulingTaskResponse 满轮入库(string ctnrCode, string position, string taskCode, string priority)
         {
-            return GenAgvSchedulingTask("iwms_third", ctnrCode, "1", new List<positionCodeClass>()
+            return GenAgvSchedulingTask("iwms_third", ctnrCode, "4", new List<positionCodeClass>()
             {
                 new positionCodeClass(){ //取货机台
                     positionCode=position,
                     type="00"
                 },
                 new positionCodeClass(){ //巷道分配点
-                    positionCode="LK_1",
+                    positionCode="HJLK",
                     type="00"
                 },
                 new positionCodeClass(){ //预分配放货点
-                    positionCode="liku1",
+                    positionCode="1015",
                     type="00"
                 }
             }, priority, taskCode, "ZTGT03", "1");
@@ -82,7 +82,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         }
 
         /// <summary>
-        ///  机台补
+        ///  机台补
         /// </summary>
         /// <param name="ctnrCode">RFID</param>
         /// <param name="position1">取货站台</param>
@@ -90,7 +90,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         /// <param name="taskCode">WMS任务号</param>
         /// <param name="priority">优先级</param>
         /// <returns></returns>
-        public static GenAgvSchedulingTaskResponse 机台补(string ctnrCode, string position1, string position2, string taskCode, string priority)
+        public static GenAgvSchedulingTaskResponse 机台补(string ctnrCode, string position1, string position2, string taskCode, string priority)
         {
             return GenAgvSchedulingTask("iWMS", ctnrCode, "1", new List<positionCodeClass>()
             {
@@ -120,7 +120,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         /// <exception cref="KnownException"></exception>
         public static GenAgvSchedulingTaskResponse GenAgvSchedulingTask(string clienCode, string ctnrCode, string ctnrTyp, List<positionCodeClass> positionCodePath, string priority, string taskCode, string taskType, string hjTaskTy)
         {
-            var res = APICaller.CallApi2<GenAgvSchedulingTaskResponse>(AgvUrl + "/hikRpcService/continueTask", new GenAgvSchedulingTaskRequest
+            var res = APICaller.CallApi2<GenAgvSchedulingTaskResponse>(AgvUrl + "/rcms/services/rest/hikRpcService/genAgvSchedulingTask", new GenAgvSchedulingTaskRequest
             {
                 clientCode = clienCode,
                 ctnrCode = ctnrCode,
@@ -128,11 +128,12 @@ namespace WCS.WorkEngineering.WebApi.Controllers
                 interfaceName = "genAgvSchedulingTask",
                 positionCodePath = positionCodePath,
                 priority = priority,
-                reqCode = Guid.NewGuid().ToString(),
+                reqCode = Guid.NewGuid().ToString().Replace("-", ""),
                 taskCode = taskCode,
                 taskTyp = taskType,
                 hjTaskTy = hjTaskTy,
-                tokenCode = "08cf13d176b54d96aa"
+                tokenCode = "56898661ea976b748f328cefa6960434",
+                agvCode = "2047"
             });
             if (res.code != AgvResponseCode.Success)
             {
@@ -143,6 +144,8 @@ namespace WCS.WorkEngineering.WebApi.Controllers
 
         #endregion 任务单生成
 
+        #region 继续执行任务
+
         /// <summary>
         ///  继续执行任务
         /// </summary>
@@ -156,8 +159,11 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             {
                 reqCode = Guid.NewGuid().ToString(),
                 taskCode = taskCode,
-                type = "00",
-                nextPositionCode = nextPositionCode
+                nextPositionCode = new positionCodeClass()
+                {
+                    positionCode = nextPositionCode,
+                    type = "00"
+                }
             });
             if (res.code != AgvResponseCode.Success)
             {
@@ -165,5 +171,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             }
             return res;
         }
+
+        #endregion 继续执行任务
     }
 }

+ 39 - 1
WCS.WorkEngineering/WebApi/Controllers/AgvController.cs

@@ -14,6 +14,45 @@ namespace WCS.WorkEngineering.WebApi.Controllers
     [Route("api/[controller]/[action]")]
     public class AgvController : ControllerBase
     {
+        /// <summary>
+        ///  AGV任务下发测试
+        /// </summary>
+        /// <param name="type">任务类型</param>
+        /// <param name="code">RFID</param>
+        /// <param name="pos">目标位置</param>
+        /// <returns></returns>
+        [HttpPost]
+        public string AgvDebug(int type, string code, string pos)
+        {
+            try
+            {
+                switch (type)
+                {
+                    case 1:
+                        //AgvApi.机台补空();
+                        break;
+
+                    case 2:
+                        //AgvApi.机台补满();
+                        break;
+
+                    case 3:
+                        AgvApi.满轮入库(code, pos, Guid.NewGuid().ToString().Replace("-", ""), "1");
+                        break;
+
+                    default:
+                        break;
+                }
+                return "成功";
+            }
+            catch (Exception ex)
+            {
+                return $"Error-----" +
+                      $"{ex.Message}------" +
+                      $"{ex.StackTrace}";
+            }
+        }
+
         /// <summary>
         /// AGV执行回调
         /// </summary>
@@ -34,7 +73,6 @@ namespace WCS.WorkEngineering.WebApi.Controllers
                     {
                         msg = "未找到对应的AGV任务";
                         code = AgvResponseCode.Fail;
-
                     }
                     switch (reqDto.method)
                     {

+ 13 - 0
WCS.WorkEngineering/WebApi/Controllers/WcsController.cs

@@ -46,6 +46,19 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             return Device.All.ToList();
         }
 
+        /// <summary>
+        ///  获取设备信息
+        /// </summary>
+        /// <param name="name">设备名称</param>
+        /// <returns></returns>
+        [HttpGet]
+        public object GetDeviceInfo(string name)
+        {
+            var obj = World.GetSystemInstance<GetDeviceSystem>().Invoke(name);
+
+            return obj;
+        }
+
         /// <summary>
         ///  堆垛机测试
         /// </summary>

+ 1 - 1
WCS.WorkEngineering/WebApi/Models/AGV/Request/ContinueTaskRequest.cs

@@ -53,7 +53,7 @@
         /// <summary>
         ///  下一个位置信息,在任务类型中配置外部设置时需要传入,否则不需要设置。待现场地图部署、配置完成后可获取
         /// </summary>
-        public object nextPositionCode { get; set; }
+        public positionCodeClass nextPositionCode { get; set; }
 
         /// <summary>
         ///  根据type填写,呼叫站点/策略编号等

+ 6 - 7
WCS.WorkEngineering/WorkStart.cs

@@ -39,9 +39,9 @@ namespace WCS.WorkEngineering
                 {
                     var conv = new Device(i.ToString());
                     conv.AddFlag(DeviceFlags.输送机);
-                    conv.AddProtocol<IStation520>((i - item.Start) * 14, 520, item.IP);
+                    conv.AddProtocol<IStation523>((i - item.Start) * 14, 520, item.IP);
                     conv.AddProtocol<IStation521>((i - item.Start) * 16, 521, item.IP);
-                    conv.AddProtocol<IStation523>((i - item.Start) * 14, 523, item.IP);
+                    conv.AddProtocol<IStation523>((i - item.Start) * 12, 523, item.IP);
                 }
             }
 
@@ -50,7 +50,7 @@ namespace WCS.WorkEngineering
             #region 扫码器
 
             List<BcrInfo> bcrInfo = new List<BcrInfo>();
-            bcrInfo.Add(new BcrInfo(new int[] { 1011, 1013, 1015, 1022, 1024, 1026 }, "10.30.36.51"));
+            bcrInfo.Add(new BcrInfo(new int[] { 1011, 1013, 1015 }, "10.30.36.51"));
 
             foreach (var item in bcrInfo)
             {
@@ -58,8 +58,7 @@ namespace WCS.WorkEngineering
                 {
                     var conv = new Device("BCR" + item.DeviceNo[i]);
                     conv.AddFlag(DeviceFlags.扫码);
-                    int pos = i * 32;
-                    conv.AddProtocol<IBCR80>(pos, 80, item.IP);
+                    int pos = i * 8;
                     conv.AddProtocol<IBCR81>(pos, 81, item.IP);
                 }
             }
@@ -76,7 +75,7 @@ namespace WCS.WorkEngineering
                 for (int i = 0; i < item.DeviceNo.Length; i++)
                 {
                     var conv = Device.All.FirstOrDefault(x => x.Code == item.DeviceNo[i].ToString());
-                    conv.AddFlag(DeviceFlags.称重);
+                    conv.AddFlag(DeviceFlags.外检);
                     int pos = i * 14;
                     conv.AddProtocol<IStation91>(pos, 91, item.IP);
                 }
@@ -96,7 +95,7 @@ namespace WCS.WorkEngineering
                 //三台堆垛机IP主机位分别是 21 31 41
                 srm.AddProtocol<ISRM520>(0, 520, $"10.30.36.{(i * 10) + 10 + 1}");
                 srm.AddProtocol<ISRM521>(0, 521, $"10.30.36.{(i * 10) + 10 + 1}");
-                srm.AddProtocol<ISRM537>(0, 523, $"10.30.36.{(i * 10) + 10 + 1}");
+                srm.AddProtocol<ISRM537>(0, 537, $"10.30.36.{(i * 10) + 10 + 1}");
 
                 //增加巷道
                 var tunnel = new Device($"TY{i}");

+ 1 - 1
WCS.WorkEngineering/Worlds/DataCollectionWorld.cs

@@ -45,7 +45,7 @@ namespace WCS.Service.Worlds
 
             #endregion 日志处理
 
-            //World.GetSystemInstance<DataCollectionSysyem>().Invoke(true);
+            World.GetSystemInstance<DataCollectionSysyem>().Invoke(true);
         }
     }
 }