Browse Source

新增设备离线逻辑处理

oyq28 2 years ago
parent
commit
37493156d7
1 changed files with 10 additions and 0 deletions
  1. 10 0
      IMCS_CCS/Service/Impl/TaskJobService.cs

+ 10 - 0
IMCS_CCS/Service/Impl/TaskJobService.cs

@@ -98,6 +98,7 @@ namespace IMCS.CCS.Service.Impl
             syncStatusMap.Add("报警", 3);
             //在线状态默认传参后台空闲状态
             syncStatusMap.Add("在线", 1);
+            syncStatusMap.Add("掉线", -1);
         }
 
         /// <summary>
@@ -1275,6 +1276,15 @@ namespace IMCS.CCS.Service.Impl
 
                         continue;
                     }
+                    else if (device != null && device.State && !device.UseState)
+                    {
+                        if (equipment.Status != "离线")
+                        {
+                            equipment.Status = "离线";
+                            changeEquipmentMonitors.Add(equipment);
+                        }
+                        continue;
+                    }
                     else if (device != null && equipment.Name == "机械手")
                     {
                         //缓存取PLCagvalue 值