jiangjy 3 weeks ago
parent
commit
a5a758ac0c
1 changed files with 13 additions and 7 deletions
  1. 13 7
      FrameworkLocal/Common/SubstrateTrackings/WaferManager.cs

+ 13 - 7
FrameworkLocal/Common/SubstrateTrackings/WaferManager.cs

@@ -6,6 +6,7 @@ using Aitex.Core.RT.DataCenter;
 using Aitex.Core.RT.Event;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.OperationCenter;
+using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
 using FabConnect.SecsGemInterface.Common;
 using MECF.Framework.Common.DataCenter;
@@ -69,21 +70,26 @@ namespace MECF.Framework.Common.SubstrateTrackings
         private PeriodicJob _thread;
         private bool _needSerialize;
         public Dictionary<string, bool> NeedUpdateModule = new Dictionary<string, bool>();
-
+        private bool _enableUpdateWafersNotify = false;
         public WaferManager()
         {
+            _enableUpdateWafersNotify = SC.GetValue<bool>("System.EnableUpdateWafersNotify");
         }
 
         public bool Serialize()
         {
-            if (NeedUpdateModule.Any(r => r.Value))
+            if (_enableUpdateWafersNotify)
             {
-                var modules = NeedUpdateModule.Where(r => r.Value).Select(r => r.Key).ToList();
-                Singleton<EventManager>.Instance.UpdateWafers(modules);
-                NeedUpdateModule.Clear();
+                if (NeedUpdateModule.Any(r => r.Value))
+                {
+                    var modules = NeedUpdateModule.Where(r => r.Value).Select(r => r.Key).ToList();
+                    Singleton<EventManager>.Instance.UpdateWafers(modules);
+                    NeedUpdateModule.Clear();
+                }
             }
+
             if (!_needSerialize) return true;
-            _needSerialize = false;          
+            _needSerialize = false;
             try
             {
                 if (_locationWafers != null)
@@ -175,7 +181,7 @@ namespace MECF.Framework.Common.SubstrateTrackings
                 }
             }
 
-            DATA.Subscribe(module.ToString(), "ModuleWaferList", () => _locationWafers[module].Values.ToArray());         
+            DATA.Subscribe(module.ToString(), "ModuleWaferList", () => _locationWafers[module].Values.ToArray());
         }
 
         public void WaferMoved(ModuleName moduleFrom, int slotFrom, ModuleName moduleTo, int slotTo, bool needHistory = true)