Browse Source

efem动画优化

lixiang 1 year ago
parent
commit
00d42e8c17

+ 39 - 7
Venus/Venus_MainPages/ViewModels/EfemViewModel.cs

@@ -19,6 +19,7 @@ using Venus_Core;
 using Venus_MainPages.Unity;
 using Venus_Themes.CustomControls;
 using Venus_Themes.Unity;
+using static Venus_Themes.UserControls.EFEM;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -83,6 +84,8 @@ namespace Venus_MainPages.ViewModels
         private WaferRobotXAction m_Robot2XAction;
         int arm1oldWaferStatus = 100;
         int arm2oldWaferStatus = 100;
+        private RobotPosition m_CurrentRobotPosition;
+
         #endregion
 
         #region 属性
@@ -301,6 +304,11 @@ namespace Venus_MainPages.ViewModels
                 m_robotMoveInfo = value;
             }
         }
+        public RobotPosition CurrentRobotPosition
+        {
+            get { return m_CurrentRobotPosition; }
+            set { SetProperty(ref m_CurrentRobotPosition, value); }
+        }
         #endregion
 
         #region 命令
@@ -426,11 +434,12 @@ namespace Venus_MainPages.ViewModels
             //OnModuleChange("Extend");
 
             //OnModuleChange("Retract");
-            UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
 
-            UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
+            //UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
+
+            //UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
 
-            UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
+            //UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
 
         }
         #endregion
@@ -802,7 +811,9 @@ namespace Venus_MainPages.ViewModels
 
                 if (arm == "ArmA")
                 {
-                    Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    var robot1Robot1TAction= (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    await ChangePosition(robot1Robot1TAction);
+                    Robot1TAction = robot1Robot1TAction;
                     await Task.Delay(1500);
                     Robot1XAction = WaferRobotXAction.Extend;
                     await Task.Delay(3000);
@@ -810,7 +821,10 @@ namespace Venus_MainPages.ViewModels
                 }
                 else if (arm == "ArmB")
                 {
-                    Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    var robot2Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+
+                    await ChangePosition(robot2Robot1TAction);
+                    Robot2TAction = robot2Robot1TAction;
                     await Task.Delay(1500);
                     Robot2XAction = WaferRobotXAction.Extend;
                     await Task.Delay(3000);
@@ -873,8 +887,26 @@ namespace Venus_MainPages.ViewModels
 
             }
             #endregion
-            arm1oldWaferStatus = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus;
-            arm2oldWaferStatus = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus;
+            //arm1oldWaferStatus = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus;
+            //arm2oldWaferStatus = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus;
+        }
+        private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
+        {
+            //CurrentRobotPosition = RobotPosition.Origin;
+            //await Task.Delay(1000);
+            if (waferRobotTAction == WaferRobotTAction.LP1)
+            {
+                CurrentRobotPosition = RobotPosition.Left;
+            }
+            else if (waferRobotTAction == WaferRobotTAction.LP3)
+            {
+                CurrentRobotPosition = RobotPosition.Right;
+            }
+            else
+            { 
+                CurrentRobotPosition = RobotPosition.Origin;
+            }
+            await Task.Delay(1500);
         }
         #endregion
 

+ 15 - 7
Venus/Venus_MainPages/ViewModels/OperationOverViewModel.cs

@@ -793,7 +793,9 @@ namespace Venus_MainPages.ViewModels
 
                 if (arm == "ArmA")
                 {
-                    Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    var robot3Robot3TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    await ChangePosition(robot3Robot3TAction);
+                    Robot3TAction = robot3Robot3TAction;
                     await Task.Delay(1500);
 
                     //ChangePosition(Robot3TAction);
@@ -805,7 +807,9 @@ namespace Venus_MainPages.ViewModels
                 }
                 else if (arm == "ArmB")
                 {
-                    Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    var robot4Robot4TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    await ChangePosition(robot4Robot4TAction);
+                    Robot4TAction = robot4Robot4TAction;
                     await Task.Delay(1500);
                     //ChangePosition(Robot4TAction);
                     //await Task.Delay(2000);
@@ -986,19 +990,23 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}ESlitDoor.{obj?.IsOpen}");
         }
 
-        private async void ChangePosition(WaferRobotTAction waferRobotTAction)
+        private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
         {
-            CurrentRobotPosition = RobotPosition.Origin;
-            await Task.Delay(1000);
+            //CurrentRobotPosition = RobotPosition.Origin;
+            //await Task.Delay(1000);
             if (waferRobotTAction == WaferRobotTAction.LP1)
             {
-                
                 CurrentRobotPosition = RobotPosition.Left;
             }
-            else if (Robot3TAction == WaferRobotTAction.LP3)
+            else if (waferRobotTAction == WaferRobotTAction.LP3)
             {
                 CurrentRobotPosition = RobotPosition.Right;
             }
+            else
+            {
+                CurrentRobotPosition = RobotPosition.Origin;
+            }
+            await Task.Delay(1500);
         }
         #endregion
     }

+ 3 - 3
Venus/Venus_MainPages/ViewModels/TMOperationViewModel.cs

@@ -378,11 +378,11 @@ namespace Venus_MainPages.ViewModels
             timer.Tick += timer_Tick;
             timer.Start();
 
-            UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
+            //UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
 
-            UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
+            //UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
 
-            UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
+            //UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
             HomeAllSteps.Add("Lid");
             HomeAllSteps.Add("Robot");
             HomeAllSteps.Add("Slit Door");

+ 3 - 3
Venus/Venus_MainPages/ViewModels/TMViewModel.cs

@@ -851,11 +851,11 @@ namespace Venus_MainPages.ViewModels
             RetractSoltItemsSource.Add(1);
             //Robot1TAction = WaferRobotTAction.PMA;
             //Robot2TAction = WaferRobotTAction.PMD;
-            UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
+            //UIEvents.PMDoorRaiseChangedEvent += UIEvents_PMDoorRaiseChangedEvent;
 
-            UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
+            //UIEvents.LLTDoorRaiseChangedEvent += UIEvents_LLTDoorRaiseChangedEvent;
 
-            UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
+            //UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
         }
 
        

+ 2 - 0
Venus/Venus_RT/Devices/EFEM/JetEfem.cs

@@ -627,6 +627,8 @@ namespace Venus_RT.Devices.EFEM
                         _revMsg = rec_msg;
 
                         OnCommandUpdated(rec_msg);
+                        SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.EfemRobot);
+
                         break;
 
                     case EfemMessage.MsgHead.EVT: