2 Commits e8ea609523 ... a1b0ddc286

Author SHA1 Message Date
  huangping a1b0ddc286 Merge branch 'Master_ELK02_Release_Development' of http://git.jetplasma-oa.com/Jet/FurnaceELK into Master_ELK02_Release_Development 3 weeks ago
  huangping 43c94bb775 IEventServiceCallback.SendChangedWaferModule改成oneway避免对文件读写的影响。 3 weeks ago

+ 2 - 2
FrameworkLocal/Common/Event/EventManager.cs

@@ -955,9 +955,9 @@ namespace Aitex.Core.RT.Event
             }
         }
 
-        public bool? UpdateWafers(IEnumerable<string> modules)
+        public void UpdateWafers(IEnumerable<string> modules)
         {
-           return _eventService?.UpDateWafers(modules);
+           _eventService?.UpDateWafers(modules);
         }
     }
 }

+ 5 - 10
FrameworkLocal/Common/Event/EventService.cs

@@ -24,7 +24,7 @@ namespace Aitex.Core.WCF
 
         public event Action<bool> OnLockAndUnlockEvent;
 
-        public event Func<IEnumerable<string>,bool?> OnUpdateWaferEvent;
+        public event Action<IEnumerable<string>> OnUpdateWaferEvent;
 
         private int _counter;
         public EventService()
@@ -135,29 +135,24 @@ namespace Aitex.Core.WCF
             }
         }
 
-        public bool? UpDateWafers(IEnumerable<string> modules)
+        public void UpDateWafers(IEnumerable<string> modules)
         {
-            var tasks = new List<Task<bool?>>();
             foreach (var client in _callbackClientList)
             {
-                tasks.Add(Task.Run(() =>
+                Task.Run(() =>
                  {
                      try
                      {
-                         return client.Value.SendChangedWaferModule(modules);//客户端通过回调接受事件
+                         client.Value.SendChangedWaferModule(modules);//客户端通过回调接受事件
                      }
                      catch (Exception ex)
                      {
                          LOG.Error(string.Format("给客户端{0}发送事件失败,客户端被删除.", client.Key), ex);
                          _callbackClientList.TryRemove(client.Key, out IEventServiceCallback service);
                          _isLockState.TryRemove(client.Key, out bool lockState);
-                         return null;
                      }
-                 }));
+                 });
             }
-            Task.WhenAll(tasks).Wait(TimeSpan.FromSeconds(400));
-            if (tasks.Any(r => r.Result == false)) return false;
-            return true;
         }
 
 

+ 2 - 2
FrameworkLocal/Common/Event/EventServiceCallback.cs

@@ -17,7 +17,7 @@ namespace Aitex.Core.WCF
 
         public event Action<bool> OnLockAndUnlockEvent;
 
-        public event Func<IEnumerable<string>,bool?> OnUpdateWaferEvent;//通知获取wafer更新数据
+        public event Action<IEnumerable<string>> OnUpdateWaferEvent;//通知获取wafer更新数据
         public void SendEvent(EventItem ev)
         {
             if (FireEvent != null)
@@ -33,6 +33,6 @@ namespace Aitex.Core.WCF
                 OnLockAndUnlockEvent(isLock);
             }
         }
-        public bool? SendChangedWaferModule(IEnumerable<string> changedModule)=> OnUpdateWaferEvent?.Invoke(changedModule);
+        public void SendChangedWaferModule(IEnumerable<string> changedModule)=> OnUpdateWaferEvent?.Invoke(changedModule);
     }
 }

+ 4 - 4
FrameworkLocal/Common/Event/EventServiceClient.cs

@@ -18,7 +18,7 @@ namespace Aitex.Core.WCF
         public event Action<EventItem> OnEvent;
         public event Action OnDisconnectedWithRT;
         public event Action<bool> LockAndUnlockEvent;
-        public event Func<IEnumerable<string>,bool?> OnUpdateWaferEvent;
+        public event Action<IEnumerable<string>> OnUpdateWaferEvent;
         public bool InProcess { get; set; }
 
         private IEventService _service;
@@ -53,7 +53,7 @@ namespace Aitex.Core.WCF
                 LockAndUnlockEvent(obj);
             }
         }
-        private bool? _sevice_OnUpdateWaferEvent(IEnumerable<string> modules)=> OnUpdateWaferEvent?.Invoke(modules);   
+        private void _sevice_OnUpdateWaferEvent(IEnumerable<string> modules)=> OnUpdateWaferEvent?.Invoke(modules);   
 
 
         public bool IsConnectedWithRT
@@ -174,7 +174,7 @@ namespace Aitex.Core.WCF
 
         public event Action<bool> OnLockAndUnlockEvent;
 
-        public event Func<IEnumerable<string>,bool?> OnUpdateWaferEvent;
+        public event Action<IEnumerable<string>> OnUpdateWaferEvent;
 
         public EventServiceClient(EventServiceCallback callbackInstance)
             : base(new InstanceContext(callbackInstance), "Client_IEventService", "EventService")
@@ -200,7 +200,7 @@ namespace Aitex.Core.WCF
                 OnLockAndUnlockEvent(isLock);
             }
         }
-        bool? CallbackInstance_OnUpdateWaferEvent(IEnumerable<string> modules) => OnUpdateWaferEvent?.Invoke(modules);
+        void CallbackInstance_OnUpdateWaferEvent(IEnumerable<string> modules) => OnUpdateWaferEvent?.Invoke(modules);
 
         public bool Register(Guid id)
         {

+ 1 - 1
FrameworkLocal/Common/Event/IEventService.cs

@@ -14,7 +14,7 @@ namespace Aitex.Core.WCF.Interface
 
         event Action<bool> OnLockAndUnlockEvent;
 
-        event Func<IEnumerable<string>,bool?> OnUpdateWaferEvent;
+        event Action<IEnumerable<string>> OnUpdateWaferEvent;
 
         [OperationContract]
         bool Register(Guid id);

+ 2 - 2
FrameworkLocal/Common/Event/IEventServiceCallback.cs

@@ -17,7 +17,7 @@ namespace Aitex.Core.WCF.Interface
         [OperationContract(IsOneWay = true)]
         void SendLockEvent(bool IsLock);
 
-        [OperationContract]
-        bool? SendChangedWaferModule(IEnumerable<string> modules);
+        [OperationContract(IsOneWay = true)]
+        void SendChangedWaferModule(IEnumerable<string> modules);
     }
 }

+ 3 - 4
FrameworkLocal/Common/SubstrateTrackings/WaferManager.cs

@@ -79,8 +79,8 @@ namespace MECF.Framework.Common.SubstrateTrackings
             if (NeedUpdateModule.Any(r => r.Value))
             {
                 var modules = NeedUpdateModule.Where(r => r.Value).Select(r => r.Key).ToList();
-                if (!(Singleton<EventManager>.Instance.UpdateWafers(modules) == false))
-                    NeedUpdateModule.Clear();
+                Singleton<EventManager>.Instance.UpdateWafers(modules);
+                NeedUpdateModule.Clear();
             }
             if (!_needSerialize) return true;
             _needSerialize = false;          
@@ -175,8 +175,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
                 }
             }
 
-            DATA.Subscribe(module.ToString(), "ModuleWaferList", () => _locationWafers[module].Values.ToArray());
-            NeedUpdateModule[module.ToString()] = true;
+            DATA.Subscribe(module.ToString(), "ModuleWaferList", () => _locationWafers[module].Values.ToArray());         
         }
 
         public void WaferMoved(ModuleName moduleFrom, int slotFrom, ModuleName moduleTo, int slotTo, bool needHistory = true)

+ 6 - 9
FrameworkLocal/UIClient/ClientBase/ModuleDataMonitor.cs

@@ -51,7 +51,7 @@ namespace MECF.Framework.UI.Client.ClientBase
             try
             {
                 Dictionary<string, object> data = new Dictionary<string, object>();
-                data = QueryDataClient.Instance.Service.PollData(_lstWaferDataName);
+                data = QueryDataClient.Instance.Service.PollData(_mapWaferDataModule.Keys);
                 if (data != null && Application.Current != null)
                 {
                     Application.Current.Dispatcher.Invoke(new Action(() =>
@@ -114,14 +114,14 @@ namespace MECF.Framework.UI.Client.ClientBase
 
             return true;
         }
-        private bool? OnTimer(IEnumerable<string> modules)
+        private void OnTimer(IEnumerable<string> modules)
         {
             try
             {
                 if (modules?.Any() == true)
                 {
                     var changedModule = modules.Where(r => _mapWaferDataModule.ContainsKey(r + ".ModuleWaferList"));
-                    if (!changedModule.Any()) return null;
+                    if (!changedModule.Any()) return ;
                     Dictionary<string, object> data = QueryDataClient.Instance.Service.PollData(changedModule.Select(r => $"{r}.ModuleWaferList"));
                     if (data != null && Application.Current != null)
                     {
@@ -176,15 +176,12 @@ namespace MECF.Framework.UI.Client.ClientBase
                                 }
                             }
                         }));
-                    }
-                    return true;
-                }
-                return null;
+                    } 
+                } 
             }
             catch (Exception ex)
             {
-                LOG.Error(ex.Message);
-                return false;
+                LOG.Error(ex.Message);    
             }
         }