Browse Source

解决冲突

lixiang 1 year ago
parent
commit
9c33424896

+ 98 - 9
Venus/Framework/Common/IOCore/IOManager.cs

@@ -619,8 +619,14 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = accessor.BlockOffset,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{accessor.Name}", () => accessor.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                }
+                else
+                { 
                     DATA.Subscribe($"IO.{accessor.Name}", () => accessor.Value);
+                }
             }
         }
 
@@ -652,7 +658,24 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = accessor.BlockOffset,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{accessor.Name}", () => accessor.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                    DATA.Subscribe($"IO32.{accessor.Name}", () =>
+                    {
+                        if (accessor.Index < accessor.Buffer.Length - 1)
+                        {
+                            byte[] high = BitConverter.GetBytes(accessor.Buffer[accessor.Index]);
+                            byte[] low = BitConverter.GetBytes(accessor.Buffer[accessor.Index + 1]);
+                            return BitConverter.ToSingle(new[] { high[0], high[1], low[0], low[1] }, 0);
+                        }
+                        else
+                        {
+                            return accessor.Value;
+                        }
+                    }, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                }
+                else
                 {
                     DATA.Subscribe($"IO.{accessor.Name}", () => accessor.Value);
                     DATA.Subscribe($"IO32.{accessor.Name}", () =>
@@ -696,7 +719,24 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = accessor.BlockOffset,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{accessor.Name}", () => accessor.Value,SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                    DATA.Subscribe($"IO32.{accessor.Name}", () =>
+                    {
+                        if (accessor.Index < accessor.Buffer.Length - 1)
+                        {
+                            byte[] high = BitConverter.GetBytes(accessor.Buffer[accessor.Index]);
+                            byte[] low = BitConverter.GetBytes(accessor.Buffer[accessor.Index + 1]);
+                            return BitConverter.ToSingle(new[] { high[0], high[1], low[0], low[1] }, 0);
+                        }
+                        else
+                        {
+                            return accessor.Value;
+                        }
+                    }, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                }
+                else
                 {
                     DATA.Subscribe($"IO.{accessor.Name}", () => accessor.Value);
                     DATA.Subscribe($"IO32.{accessor.Name}", () =>
@@ -792,8 +832,15 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = intIndex,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{moduleName}", () => diAccessor.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+
+                }
+                else
+                { 
                     DATA.Subscribe($"IO.{moduleName}", () => diAccessor.Value);
+                }
             }
 
             XmlNodeList lstDo = xml.SelectNodes("IO_DEFINE/Dig_Out/DO_ITEM");
@@ -855,8 +902,15 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = intIndex,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{moduleName}", () => doAccessor.Value,SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                }
+                else
+                {
                     DATA.Subscribe($"IO.{moduleName}", () => doAccessor.Value);
+                }
+                    
             }
 
             XmlNodeList lstAo = xml.SelectNodes("IO_DEFINE/Ana_Out/AO_ITEM");
@@ -918,12 +972,30 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = intIndex,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{moduleName}", () => aoAccessor.Value,SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                    DATA.Subscribe($"IO32.{moduleName}", () =>
+                    {
+                        if (aoAccessor.Index < aoAccessor.Buffer.Length - 1)
+                        {
+                            byte[] high = BitConverter.GetBytes(aoAccessor.Buffer[aoAccessor.Index]);
+                            byte[] low = BitConverter.GetBytes(aoAccessor.Buffer[aoAccessor.Index + 1]);
+                            return BitConverter.ToSingle(new[] { high[0], high[1], low[0], low[1] }, 0);
+                        }
+                        else
+                        {
+                            return aoAccessor.Value;
+                        }
+
+                    },SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                }
+                else
                 {
                     DATA.Subscribe($"IO.{moduleName}", () => aoAccessor.Value);
                     DATA.Subscribe($"IO32.{moduleName}", () =>
                     {
-                        if (aoAccessor.Index < aoAccessor.Buffer.Length-1)
+                        if (aoAccessor.Index < aoAccessor.Buffer.Length - 1)
                         {
                             byte[] high = BitConverter.GetBytes(aoAccessor.Buffer[aoAccessor.Index]);
                             byte[] low = BitConverter.GetBytes(aoAccessor.Buffer[aoAccessor.Index + 1]);
@@ -997,12 +1069,29 @@ namespace MECF.Framework.Common.IOCore
                     BlockIndex = intIndex,
                 });
 
-                if (!isIgnoreSaveDB)
+                if (isIgnoreSaveDB)
+                {
+                    DATA.Subscribe($"IO.{moduleName}", () => aiAccessor.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                    DATA.Subscribe($"IO32.{moduleName}", () =>
+                    {
+                        if (aiAccessor.Index < aiAccessor.Buffer.Length - 1)
+                        {
+                            byte[] high = BitConverter.GetBytes(aiAccessor.Buffer[aiAccessor.Index]);
+                            byte[] low = BitConverter.GetBytes(aiAccessor.Buffer[aiAccessor.Index + 1]);
+                            return BitConverter.ToSingle(new[] { high[0], high[1], low[0], low[1] }, 0);
+                        }
+                        else
+                        {
+                            return aiAccessor.Value;
+                        }
+                    }, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+                }
+                else
                 {
                     DATA.Subscribe($"IO.{moduleName}", () => aiAccessor.Value);
                     DATA.Subscribe($"IO32.{moduleName}", () =>
                     {
-                        if (aiAccessor.Index < aiAccessor.Buffer.Length-1)
+                        if (aiAccessor.Index < aiAccessor.Buffer.Length - 1)
                         {
                             byte[] high = BitConverter.GetBytes(aiAccessor.Buffer[aiAccessor.Index]);
                             byte[] low = BitConverter.GetBytes(aiAccessor.Buffer[aiAccessor.Index + 1]);

+ 3 - 31
Venus/Venus_MainPages/ViewModels/OperationOverViewModel.cs

@@ -467,30 +467,14 @@ namespace Venus_MainPages.ViewModels
             EFEMIsInstalled = allModules.Contains("EFEM");
             TMIsInstalled = allModules.Contains("TM");
 
-            UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
-
-            UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
-
-            UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
-
-            UIEvents.ChamberCreateDeleteWaferEvent += UIEvents_ChamberCreateDeleteWaferEvent;
+          
 
             SwitchFlag = false;
 
             ATMModeIsOn = Convert.ToBoolean(QueryDataClient.Instance.Service.GetConfig("System.IsATMMode")) == true ? "ATM Mode On" : "ATM Mode Off";
         }
 
-        private void UIEvents_ChamberCreateDeleteWaferEvent(WaferOperation obj)
-        {
-            if (obj.IsCreate == true)
-            {
-                InvokeClient.Instance.Service.DoOperation("CreateWafer", obj.ModuleName, 0);
-            }
-            else
-            {
-                InvokeClient.Instance.Service.DoOperation("DeleteWafer", obj.ModuleName, 0);
-            }
-        }
+      
         #endregion
 
         #region 命令方法
@@ -1017,19 +1001,7 @@ namespace Venus_MainPages.ViewModels
             return true;
         }
 
-        private void UIEvents_PMDoorRaiseChangedEvent(DoorPara obj)
-        {
-            //InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SlitDoor.{obj?.IsOpen}");
-            InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SetSlitDoor",obj.IsOpen=="Open"?true:false);
-        }
-        private void UIEvents_LLTDoorRaiseChangedEvent(DoorPara obj)
-        {
-            InvokeClient.Instance.Service.DoOperation($"TM.SetMFSlitDoor",obj.ModuleName, obj.IsOpen == "Open" ? true : false);
-        }
-        private void UIEvents_LLEDoorRaiseChangedEvent(DoorPara obj)
-        {
-            InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}ESlitDoor.{obj?.IsOpen}");
-        }
+       
 
         private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
         {

+ 6 - 1
Venus/Venus_RT/Devices/TM/JetTM.cs

@@ -377,7 +377,12 @@ namespace Venus_RT.Devices
                 TurnMFSlitDoor(module, (bool)args[1], out _);
                 return true;
             });
-
+            OP.Subscribe($"TM.SetEFEMSlitDoor", (cmd, args) =>
+            {
+                var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
+                TurnEFEMSlitDoor(module, (bool)args[1], out _);
+                return true;
+            });
             _TMVacAtmMode.TurnValve(RouteManager.IsATMMode, out string _);
 
         }

+ 4 - 1
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -356,6 +356,7 @@ namespace Venus_RT.Modules.PMs
             var result = step.Run();
             if(result == RState.Failed)
             {
+                ProcessDataRecorder.RecordPrecess(Guid.NewGuid().ToString(), RecipeStartTime, DateTime.Now, CurrentRunningRecipe, "Fail", "", _chamber.Name, "", "");
                 UpdateWaferStatus(false);
                 Runner.Stop($"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
                 FaEvent.FaPostAlarm(Module.ToString(), $"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
@@ -419,7 +420,7 @@ namespace Venus_RT.Modules.PMs
 
         
 
-            ProcessDataRecorder.RecordPrecess(Guid.NewGuid().ToString(), RecipeStartTime, DateTime.Now, CurrentRunningRecipe, "", _chamber.Name, "", "");
+            ProcessDataRecorder.RecordPrecess(Guid.NewGuid().ToString(), RecipeStartTime, DateTime.Now, CurrentRunningRecipe,"Success", "", _chamber.Name, "", "");
             return true;
         }
 
@@ -450,6 +451,8 @@ namespace Venus_RT.Modules.PMs
 
         public void Abort()
         {
+            ProcessDataRecorder.RecordPrecess(Guid.NewGuid().ToString(), RecipeStartTime, DateTime.Now, CurrentRunningRecipe, "Fail", "", _chamber.Name, "", "");
+
             _chamber.GeneratorBiasPowerOn(false);
             _chamber.GeneratorPowerOn(false);
             _chamber.TurnPendulumValve(false);

+ 32 - 0
Venus/Venus_UI/Views/ShellView.xaml.cs

@@ -23,6 +23,7 @@ using MECF.Framework.Common.CommonData;
 using System.Windows.Controls.Primitives;
 using System.Timers;
 using System.Windows.Threading;
+using Venus_Themes.Unity;
 
 namespace Venus_UI.Views
 {
@@ -52,6 +53,13 @@ namespace Venus_UI.Views
             timer.Tick += timer_Tick;
             timer.Interval = TimeSpan.FromSeconds(0.5);
             timer.Start();
+            UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
+
+            UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
+
+            UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
+
+            UIEvents.ChamberCreateDeleteWaferEvent += UIEvents_ChamberCreateDeleteWaferEvent;
         }
         void timer_Tick(object sender, EventArgs e)
         {
@@ -196,5 +204,29 @@ namespace Venus_UI.Views
         {
             System.Diagnostics.Process.GetCurrentProcess().Kill();
         }
+        private void UIEvents_ChamberCreateDeleteWaferEvent(WaferOperation obj)
+        {
+            if (obj.IsCreate == true)
+            {
+                InvokeClient.Instance.Service.DoOperation("CreateWafer", obj.ModuleName, 0);
+            }
+            else
+            {
+                InvokeClient.Instance.Service.DoOperation("DeleteWafer", obj.ModuleName, 0);
+            }
+        }
+        private void UIEvents_PMDoorRaiseChangedEvent(DoorPara obj)
+        {
+            //InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SlitDoor.{obj?.IsOpen}");
+            InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SetSlitDoor", obj.IsOpen == "Open" ? true : false);
+        }
+        private void UIEvents_LLTDoorRaiseChangedEvent(DoorPara obj)
+        {
+            InvokeClient.Instance.Service.DoOperation($"TM.SetMFSlitDoor", obj.ModuleName, obj.IsOpen == "Open" ? true : false);
+        }
+        private void UIEvents_LLEDoorRaiseChangedEvent(DoorPara obj)
+        {
+            InvokeClient.Instance.Service.DoOperation($"TM.SetEFEMSlitDoor", obj.ModuleName, obj.IsOpen == "Open" ? true : false);
+        }
     }
 }