林豪 左 1 년 전
부모
커밋
d75d3b716d

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

@@ -8,7 +8,7 @@ namespace WCS.WorkEngineering.Extensions
     /// <summary>
     /// 堆垛机扩展
     /// </summary>
-    public class SRM : Device<ISRM520, ISRM521, ISRM537>
+    public class SRM : Device<ISRM520, ISRM521, ISRM523>
     {
         public SRM(Device device, World world) : base(device, world)
         {

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

@@ -161,10 +161,10 @@ namespace WCS.WorkEngineering.Systems
                     Time = x.Frame
                 }));
 
-                equipmentAlarms.AddRange(pack.SRM537.Where(x => x.Data.Alarm != 0).Select(x => new EquipmentAlarm()
+                equipmentAlarms.AddRange(pack.SRM523.Where(x => x.Data.Alarm1 != 0 || x.Data.Alarm2 != 0).Select(x => new EquipmentAlarm()
                 {
                     Code = x.Code,
-                    Msg = x.Data.Alarm.ToString(),
+                    Msg = $"{Convert.ToString(x.Data.Alarm1)},{Convert.ToString(x.Data.Alarm2)}",
                     Time = x.Frame
                 }));
 

+ 6 - 5
WCS.WorkEngineering/Systems/MainSysyem.cs

@@ -186,19 +186,19 @@ namespace WCS.WorkEngineering.Systems
                                 typeName = typeof(WCS_SRM521).Name;
                             }
                         }
-                        else if (ps.PropertyType == typeof(ProtocolData<WCS_SRM537>[]))
+                        else if (ps.PropertyType == typeof(ProtocolData<WCS_SRM523>[]))
                         {
-                            if (pack.SRM537.Any())
+                            if (pack.SRM523.Any())
                             {
-                                var value = pack.SRM537.Select(x => new QuestDb_SRM537()
+                                var value = pack.SRM523.Select(x => new QuestDb_SRM523()
                                 {
-                                    Alarm = Convert.ToString(x.Data.Alarm),
+                                    Alarm = $"{Convert.ToString(x.Data.Alarm1)},{Convert.ToString(x.Data.Alarm1)}",
                                     Code = x.Data.Code,
                                     Frame = x.Data.Frame
                                 }).ToList();
                                 var sql = db.Insertable(value).ToSqlString();
                                 db.Ado.ExecuteCommand(sql);
-                                typeName = typeof(WCS_SRM537).Name;
+                                typeName = typeof(WCS_SRM523).Name;
                             }
                         }
                         else if (ps.PropertyType == typeof(ProtocolData<WCS_Station520>[]))
@@ -237,6 +237,7 @@ namespace WCS.WorkEngineering.Systems
                             {
                                 var value = pack.Station524.Select(x => x.Data).ToList();
                                 var sql = db.Insertable(value).ToSqlString();
+
                                 db.Ado.ExecuteCommand(sql);
                                 typeName = typeof(WCS_Station524).Name;
                             }

+ 5 - 4
WCS.WorkEngineering/WorkStart.cs

@@ -48,7 +48,7 @@ namespace WCS.WorkEngineering
                 conv.AddFlag(DeviceFlags.RGV);
                 conv.AddProtocol<IRGV520>(0, 520, item.Ip);
                 conv.AddProtocol<IRGV521>(0, 521, item.Ip);
-                //conv.AddProtocol<IStation523>(, 523, item.IP);
+                conv.AddProtocol<IRGV523>(0, 523, item.Ip);
             }
 
             #endregion 初始化RGV相关信息
@@ -416,7 +416,7 @@ namespace WCS.WorkEngineering
                 //三台堆垛机IP主机位分别是 41、49、57、65、73、81
                 srm.AddProtocol<ISRM520>(0, 520, $"10.30.37.{ip}");
                 srm.AddProtocol<ISRM521>(0, 521, $"10.30.37.{ip}");
-                srm.AddProtocol<ISRM537>(0, 537, $"10.30.37.{ip}");
+                srm.AddProtocol<ISRM523>(0, 537, $"10.30.37.{ip}");
 
                 //增加巷道
                 var tunnel = new Device($"TY{i + 1}");
@@ -452,11 +452,12 @@ namespace WCS.WorkEngineering
 
                             SqlSugarHelper.SetPLC(connectionString.Key);
 
-                            _db.CodeFirst.InitTables<WCS_SRM520>();
+                            //_db.CodeFirst.InitTables<WCS_SRM520>();
                             _db.CodeFirst.InitTables<WCS_SRM521>();
-                            _db.CodeFirst.InitTables<QuestDb_SRM537>();
+                            _db.CodeFirst.InitTables<QuestDb_SRM523>();
                             _db.CodeFirst.InitTables<WCS_RGV520>();
                             _db.CodeFirst.InitTables<WCS_RGV521>();
+                            _db.CodeFirst.InitTables<QuestDb_RGV523>();
                             _db.CodeFirst.InitTables<WCS_BCR80>();
                             _db.CodeFirst.InitTables<WCS_BCR81>();
                             _db.CodeFirst.InitTables<WCS_BCR83>();