Browse Source

add TM Robot Home && delete PrefixPath of the selected recipe in sequence

zhouhr 1 year ago
parent
commit
883eb268eb

+ 1 - 0
Venus/Venus_Core/RtState.cs

@@ -106,6 +106,7 @@ namespace Venus_Core
         Unknown,
         Init,
         Initializing,
+        InitializingRB,
         Idle,
         Error,
         Pumping,

+ 2 - 1
Venus/Venus_MainPages/ViewModels/SequenceViewModel.cs

@@ -484,7 +484,8 @@ namespace Venus_MainPages.ViewModels
 
             if (dialog.ShowDialog() == true)
             {
-                param.Value = $"{param.PrefixPath}\\" + dialog.FullPath;
+                param.Value = dialog.FullPath;
+                //param.Value = $"{param.PrefixPath}\\" + dialog.FullPath;
                 param.FileName = param.Value;
                 //string path = param.Value;
                 //int index = path.LastIndexOf("\\");

+ 9 - 1
Venus/Venus_MainPages/ViewModels/TMOperationViewModel.cs

@@ -292,6 +292,10 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand HomeCommand =>
             _HomeCommand ?? (_HomeCommand = new DelegateCommand(OnHome));
 
+        private DelegateCommand _RobotHomeCommand;
+        public DelegateCommand RobotHomeCommand =>
+            _RobotHomeCommand ?? (_RobotHomeCommand = new DelegateCommand(OnHome));
+
         private DelegateCommand _VentCommand;
         public DelegateCommand VentCommand =>
             _VentCommand ?? (_VentCommand = new DelegateCommand(OnVent));
@@ -404,6 +408,10 @@ namespace Venus_MainPages.ViewModels
         {
             InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.Home");
         }
+        private void OnRobotHome()
+        {
+            InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.RobotHome");
+        }
         private void OnVent()
         {
             InvokeClient.Instance.Service.DoOperation($"{m_ModuleCheckedName}.{RtOperation.Vent}");
@@ -514,7 +522,7 @@ namespace Venus_MainPages.ViewModels
             LLBVentValveIsOpen = CommonFunction.GetValue<bool>(RtDataValues, "TM.LLBVentValve.IsOpen");
             IsOFFline= !CommonFunction.GetValue<bool>(RtDataValues, $"{m_ModuleCheckedName}.IsOnline");
             TMIsOFFline= !CommonFunction.GetValue<bool>(RtDataValues, $"TM.IsOnline");
-            TMIsHoming= (TMState)(Enum.Parse(typeof(TMState), RtDataValues[$"TM.FsmState"].ToString()))== TMState.Initializing;
+            TMIsHoming= (TMState)(Enum.Parse(typeof(TMState), RtDataValues[$"TM.FsmState"].ToString()))== TMState.Initializing || (TMState)(Enum.Parse(typeof(TMState), RtDataValues[$"TM.FsmState"].ToString())) == TMState.InitializingRB;
             if (m_TMOperationView != null)
             {
                 m_TMOperationView.stepBar.Progress= CommonFunction.GetValue<int>(RtDataValues, "TM.Home.StepNo");

+ 8 - 1
Venus/Venus_MainPages/ViewModels/TMViewModel.cs

@@ -723,10 +723,13 @@ namespace Venus_MainPages.ViewModels
             get { return m_CycleCount; }
             set { SetProperty(ref m_CycleCount, value); }
         }
-        
+
         #endregion
 
         #region 命令
+        private DelegateCommand _RobotHomeCommand;
+        public DelegateCommand RobotHomeCommand =>
+            _RobotHomeCommand ?? (_RobotHomeCommand = new DelegateCommand(OnRobotHome));
         private DelegateCommand _GotoCommand;
         public DelegateCommand GotoCommand =>
             _GotoCommand ?? (_GotoCommand = new DelegateCommand(OnGoto));
@@ -925,6 +928,10 @@ namespace Venus_MainPages.ViewModels
         #endregion
 
         #region 命令方法
+        private void OnRobotHome()
+        {
+            InvokeClient.Instance.Service.DoOperation($"TM.RobotHome", "TMRobot");
+        }
         private void OnGoto()
         {
             if (GoToSelectedBlade == TMBlade.Blade1)

+ 1 - 0
Venus/Venus_MainPages/Views/TMOperationView.xaml

@@ -554,6 +554,7 @@
 
                     <StackPanel Grid.Row="1" Grid.ColumnSpan="5" Orientation="Horizontal" HorizontalAlignment="Center" Height="35">
                         <customControls:PathButton Content="Home"              Width="110" Height="28" Margin="0,0,5,0"   Command="{Binding HomeCommand}" IsEnabled="{Binding Path=IsOFFline}"/>
+                        <!--<customControls:PathButton Content="Robot Home"              Width="120" Height="28" Margin="0,0,5,0"   Command="{Binding RobotHomeCommand}" IsEnabled="{Binding Path=IsOFFline}"/>-->
                         <customControls:PathButton Content="Vent"              Width="110" Height="28" Margin="0 0 5 0"  IsEnabled="{Binding Path=IsOFFline}" Command="{Binding VentCommand}"/>
                         <customControls:PathButton Content="Pump"              Width="110" Height="28" Margin="0 0 0 0"  IsEnabled="{Binding Path=IsOFFline}" Command="{Binding PumpCommand}"/>
                         <!--<customControls:PathButton Content="Check Load"        Width="114" Height="28" Margin="5,0,0,0" Visibility="{Binding ElementName=tmRadioButton,Path=IsChecked,Converter={StaticResource bool2VisibilityConverter}}" IsEnabled="{Binding Path=TMIsOFFline}"/>-->

+ 4 - 3
Venus/Venus_MainPages/Views/TMView.xaml

@@ -52,6 +52,7 @@
                         <RowDefinition/>
                         <RowDefinition/>
                         <RowDefinition/>
+                        <RowDefinition/>
                     </Grid.RowDefinitions>
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition/>
@@ -112,9 +113,9 @@
 
                 <ComboBox   Grid.Row="5" Grid.Column="0"  Margin="5"  SelectedItem="{Binding WaferRobotTAction}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
                 <ComboBox   Grid.Row="5" Grid.Column="2"  Margin="5"   SelectedItem="{Binding GoToSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
-                    <Button     Grid.Row="5" Grid.Column="3"  Margin="5" Height="25"  Content="Goto" IsEnabled="{Binding Path=IsManualMode}" Command="{Binding GotoCommand}"/>
-
-                </Grid>
+                <Button     Grid.Row="5" Grid.Column="3"  Margin="5" Height="25"  Content="Goto" IsEnabled="{Binding Path=IsManualMode}" Command="{Binding GotoCommand}"/>
+                <Button Grid.Row="6" Grid.Column="3"  Margin="5" Height="25" Content="Robot Home" Command="{Binding RobotHomeCommand}" />
+            </Grid>
             <!--</Border>-->
         </Grid>
 

+ 7 - 8
Venus/Venus_RT/Modules/TM/MFHomeRoutine.cs

@@ -28,6 +28,7 @@ namespace Venus_RT.Modules.TM
         private int _slitDoorHomingTimeout = 20 * 1000;
         private int _pumpHomingTimeout = 120 * 1000;
         private int _pumpDownHomingTimeout = 600 * 1000;
+        private bool _TMHomeRBFlag = false;
 
 
 
@@ -46,6 +47,8 @@ namespace Venus_RT.Modules.TM
 
         public RState Start(params object[] objs)
         {
+            if (objs.Length>0 && objs[0].ToString() == "TMRobot")
+                _TMHomeRBFlag = true;
             currentStepNo = 0;
             if (!_JetTM.CheckLidClosed(Module))
             {
@@ -76,10 +79,6 @@ namespace Venus_RT.Modules.TM
         private bool HomeRobot()
         {
             currentStepNo = 1;
-            if (_robot.Status == RState.End)
-            {
-                return true;
-            }
             return _robot.Home();
         }
 
@@ -107,7 +106,7 @@ namespace Venus_RT.Modules.TM
         }
         private bool HomePump()
         {
-            if (RouteManager.IsATMMode)
+            if (RouteManager.IsATMMode || _TMHomeRBFlag)
                 return true;
 
             currentStepNo = 3;
@@ -120,7 +119,7 @@ namespace Venus_RT.Modules.TM
 
         private bool CheckPumpReady()
         {
-            if (RouteManager.IsATMMode)
+            if (RouteManager.IsATMMode || _TMHomeRBFlag)
                 return true;
 
             if ((bool)_JetTM.TMPumpIsRunning)
@@ -134,7 +133,7 @@ namespace Venus_RT.Modules.TM
         }
         private bool HomePumpDown()
         {
-            if (RouteManager.IsATMMode)
+            if (RouteManager.IsATMMode || _TMHomeRBFlag)
                 return true;
 
             currentStepNo = 4;
@@ -143,7 +142,7 @@ namespace Venus_RT.Modules.TM
 
         private bool CheckATMSwitchReady()
         {
-            if (RouteManager.IsATMMode)
+            if (RouteManager.IsATMMode || _TMHomeRBFlag)
                 return true;
 
             var status = _pumpDownRoutine.Monitor();

+ 18 - 6
Venus/Venus_RT/Modules/TM/TMEntity.cs

@@ -27,7 +27,8 @@ namespace Venus_RT.Modules
         {
             Unknown,
             Init,
-            Initializing,  
+            Initializing,
+            InitializingRB,
             Idle,        
             Error,       
             Pumping,
@@ -51,7 +52,8 @@ namespace Venus_RT.Modules
 
         public enum MSG
         {
-            Home,  
+            Home,
+            RobotHome,
             Online,
             Offline,
             Pump,
@@ -173,7 +175,8 @@ namespace Venus_RT.Modules
 
         protected override bool Init()
         {
-            OP.Subscribe("TM.Home", (cmd, args) => CheckToPostMessage((int)MSG.Home));
+            OP.Subscribe("TM.Home", (cmd, args) => CheckToPostMessage((int)MSG.Home, args));
+            OP.Subscribe("TM.RobotHome", (cmd, args) => CheckToPostMessage((int)MSG.RobotHome, args));
             OP.Subscribe($"TM.{RtOperation.LLPick}", (cmd, args) => CheckToPostMessage((int)MSG.Pick, args));
             OP.Subscribe($"TM.{RtOperation.LLPlace}", (cmd, args) => CheckToPostMessage((int)MSG.Place, args));
             OP.Subscribe($"TM.{RtOperation.PMPick}", (cmd, args) => CheckToPostMessage((int)MSG.PMPick, args));
@@ -232,8 +235,12 @@ namespace Venus_RT.Modules
             Transition(STATE.Initializing,      FSM_MSG.TIMER,      fnHoming,           STATE.Idle);
             Transition(STATE.Initializing,      MSG.Abort,          FnAbortExtend,      STATE.Idle);
 
-            Transition(STATE.Idle,              FSM_MSG.TIMER,      fnMonitor,          STATE.Idle);
-            Transition(STATE.Init,              FSM_MSG.TIMER,      fnMonitor,          STATE.Init);
+            // Robot Home
+            Transition(STATE.Idle,              MSG.RobotHome,      fnHome,             STATE.InitializingRB);
+            Transition(STATE.InitializingRB,    FSM_MSG.TIMER,      fnHoming,           STATE.Idle);
+            Transition(STATE.InitializingRB,    MSG.Abort,          FnAbortExtend,      STATE.Idle);
+            //Transition(STATE.Idle,              FSM_MSG.TIMER,      fnMonitor,          STATE.Idle);
+            //Transition(STATE.Init,              FSM_MSG.TIMER,      fnMonitor,          STATE.Init);
 
             // Vent sequence
             Transition(STATE.Idle,              MSG.Vent,           FnStartVent,        STATE.Venting);
@@ -343,7 +350,12 @@ namespace Venus_RT.Modules
 
         private bool fnHome(object[] param)
         {
-            return _homeRoutine.Start() == RState.Running;
+            if (fsm.State == (int)STATE.Init && param.Length > 0)//带参home
+            {
+                return false;
+            }
+            else
+                return _homeRoutine.Start(param) == RState.Running;
         }
 
         private bool fnHoming(object[] param)