瀏覽代碼

add robot cycle

chenzk 3 天之前
父節點
當前提交
f26ddacf34

+ 9 - 1
Framework/Common/Device/ModuleName.cs

@@ -252,7 +252,15 @@ namespace MECF.Framework.Common.Equipment
         [EnumMember]
         VPW9,
         [EnumMember]
-        VPW10
+        VPW10,
+        [EnumMember]
+        PlatingCell1,
+        [EnumMember]
+        PlatingCell2,
+        [EnumMember]
+        PlatingCell3,
+        [EnumMember]
+        PlatingCell4,
     }
 
     /// <summary>

+ 186 - 192
PunkHPX8_MainPages/ViewModels/RobotCycleViewModel.cs

@@ -1,14 +1,17 @@
 using Aitex.Core.UI.MVVM;
-using PunkHPX8_Core;
-using PunkHPX8_MainPages.Roles;
-using PunkHPX8_MainPages.Views;
+using Aitex.Sorter.Common;
+using MECF.Framework.Common.CommonData;
 using MECF.Framework.Common.ControlDataContext;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.OperationCenter;
 using MECF.Framework.Common.Utilities;
+using Newtonsoft.Json;
 using OpenSEMI.ClientBase.Command;
 using Prism.Mvvm;
+using PunkHPX8_Core;
+using PunkHPX8_MainPages.Roles;
+using PunkHPX8_MainPages.Views;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -17,10 +20,9 @@ using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using System.Windows.Forms.VisualStyles;
 using System.Windows.Input;
 using System.Windows.Threading;
-using MECF.Framework.Common.CommonData;
-using Newtonsoft.Json;
 
 namespace PunkHPX8_MainPages.ViewModels
 {
@@ -29,45 +31,21 @@ namespace PunkHPX8_MainPages.ViewModels
 
         #region 内部变量
         /// <summary>
-        /// 选择的LP
-        /// </summary>
-        private ModuleName _selectedLPName = ModuleName.LP1;
-        private ModuleName _selectedAlignerName = ModuleName.Aligner1;
-        /// <summary>
-        /// 选择的Dummy
-        /// </summary>
-        private ModuleName _selectedDummyName = ModuleName.Dummy1;
-        private ModuleName _selectedSrdName = ModuleName.SRD1;
-        private ModuleName _selectedPufName = ModuleName.PUF1;
-        /// <summary>
         /// 输入的Cycle次数
         /// </summary>
         private int _inPutCycleTimes = 1;
         /// <summary>
-        /// Align调整角度度数
+        /// Aligner旋转的角度
         /// </summary>
-        private int _inPutAlignDegree = 0;
+        private int _alignerAngle = 0;
         /// <summary>
         /// 当前正在执行第几次Cycle
         /// </summary>
         private int _currentCycle;
         /// <summary>
-        /// 是否选中dummy
-        /// </summary>
-        private bool _isDummySelected = false;
-        /// <summary>
-        /// 是否选中srd
-        /// </summary>
-        private bool _isSrdSelected = false ;
-        /// <summary>
-        /// 是否选中puf
+        /// 是否可以输入参数
         /// </summary>
-        private bool _isPufSelected = false;
-
-        private bool _isSrd1Checked = true;
-        private bool _isSrd2Checked = false;
-        private bool _isDummy1Checked = true;
-        private bool _isDummy2Checked = false;
+        private bool _isInputParameterEnable;
         #region 系统数据
         /// <summary>
         /// 定时器
@@ -85,235 +63,247 @@ namespace PunkHPX8_MainPages.ViewModels
         #endregion
 
         #region 属性
-        public ModuleName SelectedLPName
-        {
-            get { return _selectedLPName; }
-            set { SetProperty(ref _selectedLPName, value); }
-        }
-        public ModuleName SelectedAlignerName
-        {
-            get { return _selectedAlignerName; }
-            set { SetProperty(ref _selectedAlignerName, value); }
-        }
-        public ModuleName SelectedDummyName
-        {
-            get { return _selectedDummyName; }
-            set { SetProperty(ref _selectedDummyName, value); }
-        }
-        public ModuleName SelectedSrdName
-        {
-            get { return _selectedSrdName; }
-            set { SetProperty(ref _selectedSrdName, value); }
-        }
-        public ModuleName SelectedPufName
-        {
-            get { return _selectedPufName; }
-            set { SetProperty(ref _selectedPufName, value); }
-        }
+
         public int InPutCycleTimes
         {
             get { return _inPutCycleTimes; }
             set { SetProperty(ref _inPutCycleTimes, value); }
         }
+        public int AlignerAngle
+        {
+            get { return _alignerAngle; }
+            set { SetProperty(ref _alignerAngle, value); }
+        }
         public int CurrentCycle
         {
             get { return _currentCycle; }
             set { SetProperty(ref _currentCycle, value); }
         }
-        public int InPutAlignDegree
+        public bool IsInputParameterEnable
         {
-            get { return _inPutAlignDegree; }
-            set { SetProperty(ref _inPutAlignDegree, value); }
+            get { return _isInputParameterEnable; }
+            set { SetProperty(ref _isInputParameterEnable, value); }
         }
 
-        public bool IsDummySelected
+        #endregion
+
+        public class PositionItem
         {
-            get { return _isDummySelected; }
-            set { SetProperty(ref _isDummySelected, value); }
+            public string ModuleType { get; set; }
+            public ModuleName ModuleName { get; set; }
+            public string Parameter { get; set; }
+            public Hand RobotHand { get; set; }
+            public Flip RobotFlip { get; set; }
         }
-        public bool IsSrdSelected
+
+        private ObservableCollection<PositionItem> _positions = new ObservableCollection<PositionItem>();
+        public ObservableCollection<PositionItem> Positions
         {
-            get { return _isSrdSelected; }
-            set { SetProperty(ref _isSrdSelected, value); }
+            get { return _positions; }
+            set { SetProperty(ref _positions, value); }
         }
-        public bool IsPufSelected
+
+        public ObservableCollection<string> PositionTypes { get; } = new ObservableCollection<string>
+        {
+                "LP", "Aligner", "Dummy", "SRD", "VPW","PlatingCell"
+        };
+
+        public ObservableCollection<string> HandsTypes { get; } = new ObservableCollection<string>
         {
-            get { return _isPufSelected; }
-            set { SetProperty(ref _isPufSelected, value); }
+                "Blade1", "Blade2"
+        };
+        public ObservableCollection<string> FlipTypes { get; } = new ObservableCollection<string>
+        {
+                "NoFlip", "Flip"
+        };
+
+        private string _selectedPositionType;
+        public string SelectedPositionType
+        {
+            get { return _selectedPositionType; }
+            set
+            {
+                SetProperty(ref _selectedPositionType, value);
+                UpdateAvailableSelections();
+            }
+
         }
 
-        public bool IsSrd1Checkd
+        public ObservableCollection<ModuleName> AvailableSelections { get; } = new ObservableCollection<ModuleName>();
+
+        private ModuleName _selectedSelection;
+        public ModuleName SelectedSelection
         {
-            get { return _isSrd1Checked; }
-            set { SetProperty(ref _isSrd1Checked, value); }
+            get { return _selectedSelection; }
+            set { SetProperty(ref _selectedSelection, value); }
         }
-        public bool IsSrd2Checkd
+
+        private string _parameter;
+        public string Parameter
         {
-            get { return _isSrd2Checked; }
-            set { SetProperty(ref _isSrd2Checked, value); }
+            get { return _parameter; }
+            set { SetProperty(ref _parameter, value); }
         }
-        public bool IsDummy1Checkd
+
+        private Hand _robotHand;
+        public Hand RobotHand
         {
-            get { return _isDummy1Checked; }
-            set { SetProperty(ref _isDummy1Checked, value); }
+            get { return _robotHand; }
+            set { SetProperty(ref _robotHand, value); }
         }
-        public bool IsDummy2Checkd
+
+        private Flip _robotFlip;
+        public Flip RobotFlip
         {
-            get { return _isDummy2Checked; }
-            set { SetProperty(ref _isDummy2Checked, value); }
+            get { return _robotFlip; }
+            set { SetProperty(ref _robotFlip, value); }
         }
-        #endregion
 
         #region 命令
 
         public ICommand RobotCycleStartCommand { get; set; }
-  
+
         public ICommand RobotCycleAbortCommand { get; set; }
 
-        public ICommand LPChangeCommand { get; set; }
- 
-        public ICommand AlignerChangeCommand { get; set; }
-        
-        public ICommand PufChangeCommand { get; set; }
-   
-        public ICommand DummyChangeCommand { get; set; }
-        
-        public ICommand SrdChangeCommand { get; set; }
-        #endregion
+        public ICommand AddPositionCommand { get; set; }
+
+        public ICommand MoveUpCommand { get; set; }
+
+        public ICommand MoveDownCommand { get; set; }
 
+        public ICommand RemoveCommand { get; set; }
+        #endregion
         /// <summary>
         /// 构造器
         /// </summary>
-        public RobotCycleViewModel() 
+        public RobotCycleViewModel()
         {
             RobotCycleStartCommand = new DelegateCommand<object>(RobotCycleStartAction);
             RobotCycleAbortCommand = new DelegateCommand<object>(RobotCycleAbortAction);
-            LPChangeCommand = new DelegateCommand<object>(LPChangeAction);
-            AlignerChangeCommand = new DelegateCommand<object>(AlignerChangeAction);
-            //PufChangeCommand = new DelegateCommand<object>(PufChangeAction);
-            //DummyChangeCommand = new DelegateCommand<object>(DummyChangeAction);
-            //SrdChangeCommand = new DelegateCommand<object>(SrdChangeAction);
+
+            AddPositionCommand = new DelegateCommand<object>(AddPosition);
+            MoveUpCommand = new DelegateCommand<object>(MovePositionUp);
+            MoveDownCommand = new DelegateCommand<object>(MovePositionDown);
+            RemoveCommand = new DelegateCommand<object>(RemovePosition);
+            SelectedPositionType = PositionTypes.FirstOrDefault();
+            RobotHand = Hand.Blade1;
+            RobotFlip = Flip.NoFlip;
         }
 
-        private void RobotCycleStartAction(object param)
+        private void UpdateAvailableSelections()
         {
-            if (!IsDummySelected)
+            AvailableSelections.Clear();
+            switch (SelectedPositionType)
             {
-                SelectedDummyName = ModuleName.Unknown;
-            }
-            else
-            {
-                if (IsDummy1Checkd)
-                {
-                    SelectedDummyName = ModuleName.Dummy1;
-                }
-                else
-                {
-                    SelectedDummyName = ModuleName.Dummy2;
-                }
+                case "LP":
+                    AvailableSelections.Add(ModuleName.LP1);
+                    AvailableSelections.Add(ModuleName.LP2);
+                    break;
+                case "Aligner":
+                    AvailableSelections.Add(ModuleName.Aligner1);
+                    Parameter = "0"; // 默认角度
+                    break;
+                case "Dummy":
+                    AvailableSelections.Add(ModuleName.Dummy1);
+                    AvailableSelections.Add(ModuleName.Dummy2);
+                    break;
+                case "SRD":
+                    AvailableSelections.Add(ModuleName.SRD1);
+                    AvailableSelections.Add(ModuleName.SRD2);
+                    break;
+                case "VPW":
+                    AvailableSelections.Add(ModuleName.VPW1);
+                    AvailableSelections.Add(ModuleName.VPW2);
+                    break;
+                case "PlatingCell":
+                    AvailableSelections.Add(ModuleName.PlatingCell1);
+                    AvailableSelections.Add(ModuleName.PlatingCell2);
+                    AvailableSelections.Add(ModuleName.PlatingCell3);
+                    AvailableSelections.Add(ModuleName.PlatingCell4);
+                    break;
             }
+            SelectedSelection = AvailableSelections.FirstOrDefault();
+            RobotHand = Hand.Blade1;
+            RobotFlip = Flip.NoFlip;
+        }
 
-            if (!IsSrdSelected)
+        private void AddPosition(object obj)
+        {
+            if ("Aligner".Equals(SelectedPositionType))  //目前就aligner的条目需要参数
             {
-                SelectedSrdName = ModuleName.Unknown;
+                Positions.Add(new PositionItem
+                {
+                    ModuleType = SelectedPositionType,
+                    ModuleName = SelectedSelection,
+                    Parameter = Parameter,
+                    RobotHand = RobotHand,
+                    RobotFlip = RobotFlip
+                });
             }
             else
             {
-                if (IsSrd1Checkd)
-                {
-                    SelectedSrdName = ModuleName.SRD1;
-                }
-                else
+                Positions.Add(new PositionItem
                 {
-                    SelectedSrdName = ModuleName.SRD2;
-                }
+                    ModuleType = SelectedPositionType,
+                    ModuleName = SelectedSelection,
+                    RobotHand = RobotHand,
+                    RobotFlip = RobotFlip
+                });
             }
+            
+        }
 
-            if (!IsPufSelected)
-            {
-                SelectedPufName = ModuleName.Unknown;
-            }
-            else
+        private void MovePositionUp(object obj)
+        {
+            if (obj is PositionItem item)
             {
-                SelectedPufName = ModuleName.PUF1;
+                int index = Positions.IndexOf(item);
+                if (index > 0)
+                {
+                    Positions.Move(index, index - 1);
+                }
             }
+        }
 
-
-            if (!IsDummySelected && !IsSrdSelected)
-            {
-                MessageBox.Show("Selected at least on module between srd and dummy!");
-                return;
-            }
-            List<string> sequences = new List<string>();
-            sequences.Add(SelectedLPName.ToString());
-            sequences.Add(SelectedAlignerName.ToString());
-            if (SelectedPufName != ModuleName.Unknown)
-            {
-                sequences.Add(SelectedPufName.ToString());
-            }
-            if (SelectedSrdName != ModuleName.Unknown)
-            {
-                sequences.Add(SelectedSrdName.ToString());
-            }
-            if (SelectedDummyName != ModuleName.Unknown)
+        private void MovePositionDown(object obj)
+        {
+            if (obj is PositionItem item)
             {
-                sequences.Add(SelectedDummyName.ToString());
+                int index = Positions.IndexOf(item);
+                if (index < Positions.Count - 1)
+                {
+                    Positions.Move(index, index + 1);
+                }
             }
-            List<RobotCycleParameter> parameters = new List<RobotCycleParameter>();
-            RobotCycleParameter lpParameter = new RobotCycleParameter();
-            lpParameter.ModuleName = SelectedLPName;
-            parameters.Add(lpParameter);
-            InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.RobotCycle}",JsonConvert.SerializeObject(parameters), InPutCycleTimes, InPutAlignDegree);
         }
-        private void RobotCycleAbortAction(object param)
-        {
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");
-        }
-        private void LPChangeAction(object param)
+
+        private void RemovePosition(object obj)
         {
-            if ("LP1".Equals((string)param))
+            if (obj is PositionItem item)
             {
-                SelectedLPName = ModuleName.LP1;
+                Positions.Remove(item);
             }
-            else if ("LP2".Equals((string)param))
-            {
-                SelectedLPName = ModuleName.LP2;
-            }
-            else
-            {
-                SelectedLPName = ModuleName.LP3;
-            }
-            
         }
-        private void AlignerChangeAction(object param)
-        {
-            
-        }
-        private void PufChangeAction(object param)
-        {
 
-        }
-        private void DummyChangeAction(object param)
+
+
+        private void RobotCycleStartAction(object param)
         {
-            if ("Dummy1".Equals((string)param))
-            {
-                SelectedDummyName = ModuleName.Dummy1;
-            }
-            else
+            List<RobotCycleParameter> parameters = new List<RobotCycleParameter>();
+            foreach(var parameter in Positions) 
             {
-                SelectedDummyName = ModuleName.Dummy2;
+                RobotCycleParameter robotCycleParameter = new RobotCycleParameter();
+                robotCycleParameter.ModuleName = parameter.ModuleName;
+                robotCycleParameter.RobotArm = parameter.RobotHand;
+                robotCycleParameter.RobotFlip = parameter.RobotFlip;
+                robotCycleParameter.Parameter = parameter.Parameter;
+                parameters.Add(robotCycleParameter);
             }
+            InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.RobotCycle}", JsonConvert.SerializeObject(parameters), InPutCycleTimes);
         }
-        private void SrdChangeAction(object param)
+        private void RobotCycleAbortAction(object param)
         {
-            if ("SRD1".Equals((string)param))
-            {
-                SelectedSrdName = ModuleName.SRD1;
-            }
-            else
-            {
-                SelectedSrdName = ModuleName.SRD2;
-            }
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");
         }
 
         /// <summary>
@@ -341,6 +331,10 @@ namespace PunkHPX8_MainPages.ViewModels
         {
             if (_rtDataKeys.Count != 0)
             {
+             
+                
+                IsInputParameterEnable = "Aligner".Equals(SelectedPositionType) ? true : false;
+               
                 _rtDataValueDic = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
                 if (_rtDataValueDic != null)
                 {

+ 91 - 94
PunkHPX8_MainPages/Views/RobotCycleView.xaml

@@ -13,109 +13,106 @@
              mc:Ignorable="d" 
              d:DesignHeight="1000" d:DesignWidth="2000">
     <Canvas>
-        <Grid Height="600" Canvas.Left="100" Canvas.Top="30" HorizontalAlignment="Center" VerticalAlignment="Top" Width="500">
+        <Grid Margin="10">
             <Grid.RowDefinitions>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition Height="70"/>
-                <RowDefinition />
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="Auto"/>
             </Grid.RowDefinitions>
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="1*"/>
-                <ColumnDefinition Width="1*"/>
-                <ColumnDefinition Width="1*"/>
-            </Grid.ColumnDefinitions>
-            <GroupBox Header="LP Select" FontSize="14" FontWeight="Bold"  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
-                <Grid>
-                    <RadioButton  Content="LP1"  x:Name="lp1" IsChecked="True"  FontSize="19"  Margin="52,0,0,0" VerticalContentAlignment="Center" HorizontalAlignment="Left">
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding LPChangeCommand}" CommandParameter="{Binding ElementName=lp1,Path=Content}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </RadioButton>
-                    <RadioButton  Content="LP2"  x:Name="lp2" IsChecked="False"  FontSize="19"  Margin="0,0,0,0" VerticalContentAlignment="Center" HorizontalAlignment="Center">
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding LPChangeCommand}" CommandParameter="{Binding ElementName=lp2,Path=Content}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </RadioButton>
-                    <RadioButton  Content="LP3"  x:Name="lp3" IsChecked="False"  FontSize="19"  Margin="0,0,50,0" VerticalContentAlignment="Center" HorizontalAlignment="Right">
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding LPChangeCommand}" CommandParameter="{Binding ElementName=lp3,Path=Content}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </RadioButton>
-                </Grid>
-            </GroupBox>
-            <TextBlock  Grid.Row="1" Grid.Column="0" Text="Degree:" FontSize="19" VerticalAlignment="Center" Margin="30,10,0,0"/>
-            <TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Height="35" Width="70" FontSize="15" HorizontalAlignment="Center"  Margin="0,10,30,0" Background="White" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"  Text="{Binding InPutAlignDegree,Mode=TwoWay}" />
 
-            <GroupBox Header="Aligner Select" FontSize="14" FontWeight="Bold"  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
-                <Grid>
-                    <RadioButton Content="Aligner1"  x:Name="aligner" IsChecked="True" Margin="215,0,0,0" FontSize="19" VerticalContentAlignment="Center" HorizontalAlignment="Left">
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding AlignerChangeCommand}" CommandParameter="{Binding ElementName=aligner,Path=Content}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </RadioButton>
-                </Grid>
+            <!-- 位置列表(可重新排序) -->
+            <GroupBox Grid.Row="0" Header="Robot Cycle List" Margin="0,0,0,10">
+                <ListView x:Name="PositionListView" ItemsSource="{Binding Positions}">
+                    <ListView.View>
+                        <GridView>
+                            <GridViewColumn Header="ModuleType" Width="120" DisplayMemberBinding="{Binding ModuleType}"/>
+                            <GridViewColumn Header="ModuleName" Width="120" DisplayMemberBinding="{Binding ModuleName}"/>
+                            <GridViewColumn Header="Paramater" Width="120" DisplayMemberBinding="{Binding Parameter}"/>
+                            <GridViewColumn Header="RobotHand" Width="120" DisplayMemberBinding="{Binding RobotHand}"/>
+                            <GridViewColumn Header="Flip" Width="120" DisplayMemberBinding="{Binding RobotFlip}"/>
+                            <!-- 新增的操作按钮列 -->
+                            <GridViewColumn Header="Operation" Width="220">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <StackPanel Orientation="Horizontal" Margin="2,0">
+                                            <!-- 上移按钮 -->
+                                            <Button Content="MoveUp"
+                                            Command="{Binding DataContext.MoveUpCommand,
+                                            RelativeSource={RelativeSource AncestorType=ListView}}"
+                                            CommandParameter="{Binding}"
+                                            Width="60" Margin="2,0"/>
+                                            <Button Content="MoveDown"
+                                            Command="{Binding DataContext.MoveDownCommand,
+                                            RelativeSource={RelativeSource AncestorType=ListView}}"
+                                            CommandParameter="{Binding}"
+                                            Width="70" Margin="2,0"/>
+                                            <Button Content="Delete"
+                                            Command="{Binding DataContext.RemoveCommand,
+                                            RelativeSource={RelativeSource AncestorType=ListView}}"
+                                            CommandParameter="{Binding}"
+                                            Width="60" Margin="2,0"
+                                            Background="#FFE53935" Foreground="White"/>
+                                        </StackPanel>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                        </GridView>
+                    </ListView.View>
+                </ListView>
             </GroupBox>
 
-            <GroupBox Header="Dummy Select" FontSize="14" FontWeight="Bold"  Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" IsEnabled="{Binding IsDummySelected}">
-                <Grid>
-                    <RadioButton  Content="Dummy1"  x:Name="dummy1" IsChecked="{Binding IsDummy1Checkd,Mode=TwoWay}" Margin="215,0,0,0" FontSize="19" VerticalContentAlignment="Center" HorizontalAlignment="Left">
-                
-                    </RadioButton>
-                    <RadioButton  Content="Dummy2"  x:Name="dummy2" IsChecked="{Binding IsDummy2Checkd,Mode=TwoWay}" Margin="300,0,0,0" FontSize="19" VerticalContentAlignment="Center" HorizontalAlignment="Center">
-              
-                    </RadioButton>
-                </Grid>
-            </GroupBox>
-            <CheckBox Grid.Row="2" Grid.Column="0" Margin="30,12,0,0"  VerticalAlignment="Center" HorizontalAlignment="Left" Content="DummySelect"  FontSize="16" FontWeight="Bold" 
-               IsChecked="{Binding IsDummySelected,Mode=TwoWay}"/>
-            <GroupBox Header="SRD Select" FontSize="14" FontWeight="Bold"  Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" IsEnabled="{Binding IsSrdSelected}">
-                <Grid>
-                    <RadioButton  Content="SRD1"  x:Name="srd1" IsChecked="{Binding IsSrd1Checkd,Mode=TwoWay}" Margin="215,0,0,0" FontSize="19" VerticalContentAlignment="Center" HorizontalAlignment="Left">
-             
-                    </RadioButton>
-                    <RadioButton  Content="SRD2"  x:Name="srd2" IsChecked="{Binding IsSrd2Checkd,Mode=TwoWay}" Margin="265,0,0,0" FontSize="19" VerticalContentAlignment="Center" HorizontalAlignment="Center">
-            
-                    </RadioButton>
-                </Grid>
-            </GroupBox>
-            <CheckBox Grid.Row="4" Grid.Column="0" Margin="30,12,0,0"  VerticalAlignment="Center" HorizontalAlignment="Left" Content="PufSelect"  FontSize="16" FontWeight="Bold" 
-                    IsChecked="{Binding IsPufSelected,Mode=TwoWay}"/>
-            <GroupBox Header="Puf Select" FontSize="14" FontWeight="Bold"  Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" IsEnabled="{Binding IsPufSelected}">
+            <!-- 添加新位置 -->
+            <GroupBox Grid.Row="1" Header="Add Position" Margin="0,0,0,10">
                 <Grid>
-                    <RadioButton Content="PUF1"  x:Name="puf1" IsChecked="True" Margin="215,0,0,0" FontSize="19" VerticalContentAlignment="Center" HorizontalAlignment="Left">
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding PufChangeCommand}" CommandParameter="{Binding ElementName=puf1,Path=Content}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </RadioButton>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="120"/>
+                        <ColumnDefinition Width="120"/>
+                        <ColumnDefinition Width="120"/>
+                        <ColumnDefinition Width="120"/>
+                        <ColumnDefinition Width="120"/>
+                        <ColumnDefinition Width="60"/>
+                        <ColumnDefinition Width="Auto"/>
+                    </Grid.ColumnDefinitions>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="Auto"/>
+                        <RowDefinition Height="Auto"/>
+                        <RowDefinition Height="Auto"/>
+                    </Grid.RowDefinitions>
+
+                    <ComboBox Grid.Column="0" Grid.Row="0" Margin="5,5,5,5" 
+                          ItemsSource="{Binding PositionTypes}" 
+                          SelectedItem="{Binding SelectedPositionType}"/>
+                    <ComboBox Grid.Column="1" Grid.Row="0" Margin="5,5,5,5" 
+                          ItemsSource="{Binding AvailableSelections}" 
+                          SelectedItem="{Binding SelectedSelection}" />
+                    <TextBox Grid.Column="2" Grid.Row="0" Margin="5,5,5,5" IsEnabled="{Binding IsInputParameterEnable}"
+                         Text="{Binding Parameter,Mode=TwoWay}"/>
+                    <ComboBox Grid.Column="3" Grid.Row="0" Margin="5,5,5,5" 
+                    ItemsSource="{Binding HandsTypes}" 
+                    SelectedItem="{Binding RobotHand,Mode=TwoWay}"/>
+                    <ComboBox Grid.Column="4" Grid.Row="0" Margin="5,5,5,5" 
+                    ItemsSource="{Binding FlipTypes}" 
+                    SelectedItem="{Binding RobotFlip,Mode=TwoWay}"/>
+
+                    <Button Grid.Column="5" Grid.Row="0" Margin="5,5,5,5" 
+                        Content="Add" Command="{Binding AddPositionCommand}"/>
+                    <TextBlock Grid.Column="0" Grid.Row="1" Text="Input CycleTimes:" Margin="5,5,5,5"/>
+                    <TextBox Grid.Column="1" Grid.Row="1" Margin="5,5,5,5" HorizontalAlignment="Center" Width="50" HorizontalContentAlignment="Center"
+                         Text="{Binding InPutCycleTimes,Mode=TwoWay}"/>
+
+                    <TextBlock Grid.Column="0" Grid.Row="2" Text="Current cycle:" Margin="5,5,5,5"/>
+                    <TextBlock Grid.Column="1" Grid.Row="2" Margin="5,5,5,5" HorizontalAlignment="Center"
+                           Text="{Binding CurrentCycle}"/>
                 </Grid>
             </GroupBox>
-            <CheckBox Grid.Row="3" Grid.Column="0" Margin="30,12,0,0"  VerticalAlignment="Center" HorizontalAlignment="Left" Content="SrdSelect"  FontSize="16" FontWeight="Bold" 
-                IsChecked="{Binding IsSrdSelected,Mode=TwoWay}"/>
-            <TextBlock  Grid.Row="5" Grid.Column="0" Text="Cycle :" FontSize="19" VerticalAlignment="Center" Margin="58,0,0,0"/>
-            <TextBox Grid.Row="5" Grid.Column="1" Height="35" Width="80" FontSize="15" HorizontalAlignment="Left"  Margin="0,0,0,0" Background="White" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"  Text="{Binding InPutCycleTimes,Mode=TwoWay}" />
 
-            <TextBlock  Grid.Row="6" Grid.Column="0" Text="Current :" FontSize="19" VerticalAlignment="Center" Margin="58,0,0,0"/>
-            <Border Grid.Row="6" Grid.Column="1" Margin="0,0,0,0" Background="Black" Height="35" Width="80" HorizontalAlignment="Left">
-                <TextBlock  Text="{Binding CurrentCycle}" Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center"/>
-            </Border>
-            <Button Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Content="Start" Width="120" Height="36" Command="{Binding RobotCycleStartCommand}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-            <Button Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2" Content="Aobot" Width="120" Height="36" Command="{Binding RobotCycleAbortCommand}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            <!-- 控制按钮 -->
+            <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
+                <Button Content="Start" Width="80" Height="30" Margin="5" 
+                    Command="{Binding RobotCycleStartCommand}"/>
+                <Button Content="Abort" Width="80" Height="30" Margin="5" 
+                    Command="{Binding RobotCycleAbortCommand}"/>
+            </StackPanel>
         </Grid>
     </Canvas>
 </UserControl>

+ 0 - 2
PunkHPX8_RT/Modules/EFEM/CycleRobotCycleNewRoutine.cs

@@ -44,7 +44,6 @@ namespace PunkHPX8_RT.Modules.EFEM
         private int _currentCycle;
         private RobotCycleMoveRoutine _cycleMoveRoutine;
         private List<RobotCycleParameter> _sequences;
-        private int _alignerAngle;
         private List<EfemCycleAction> _actions;
         private int _dummySlotNumber = 25; //当前cycle中的dummy slot 数量
 
@@ -63,7 +62,6 @@ namespace PunkHPX8_RT.Modules.EFEM
                 return RState.Failed;
             }
             _cycleTimes=(int)objs[1];
-            _alignerAngle = (int)objs[2];
             _actions = new List<EfemCycleAction>();
             GenerateCycleAction();
             if (_cycleTimes < 1)

+ 0 - 116
PunkHPX8_RT/Modules/EFEM/CycleRobotCycleRoutine.cs

@@ -1,116 +0,0 @@
-using Aitex.Core.RT.Log;
-using Aitex.Core.RT.Routine;
-using PunkHPX8_Core;
-using PunkHPX8_RT.Devices.EFEM;
-using MECF.Framework.Common.Equipment;
-using MECF.Framework.Common.Routine;
-using MECF.Framework.Common.Utilities;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PunkHPX8_RT.Modules.EFEM
-{
-    public class CycleRobotCycleRoutine : ModuleRoutineBase, IRoutine
-    {
-        private enum CycleRobotCycleStep
-        {
-            LoopStart,
-            LoopRunRobotCycle,
-            LoopRunRobotCycleWait,
-            LoopEnd,
-            End
-
-        }
-        /// <summary>
-        /// Cycle次数
-        /// </summary>
-        private int _cycleTimes;
-        /// <summary>
-        /// 当前处于第几次Cycle
-        /// </summary>
-        private int _currentCycle;
-        private object[] param;
-        private RobotCycleRoutine _robotCycleRoutine;
-
-        public CycleRobotCycleRoutine(EfemBase efem) : base(ModuleName.EfemRobot)
-        {
-            _robotCycleRoutine = new RobotCycleRoutine(efem);
-        }
-
-        public RState Start(params object[] objs)
-        {
-            param = objs;
-            _currentCycle = 1;//初始化当前Cycle次数
-            if (objs.Length >= 6)
-            {
-                _cycleTimes = (int)objs[4];
-                if (_cycleTimes < 1)
-                {
-                    LOG.Write(eEvent.ERR_EFEM_ROBOT, Module, $"Input Robot Cycle Times{_cycleTimes} error");
-                    return RState.Failed;
-                }
-            }
-            return Runner.Start(Module, "Start CycleRobotCycleRoutine");
-        }
-
-        public RState Monitor()
-        {
-            Runner.LoopStart(CycleRobotCycleStep.LoopStart, "Loop StartCycleRobotCycleRoutine", _cycleTimes, NullFun, _delay_1ms)
-                .LoopRun(CycleRobotCycleStep.LoopRunRobotCycle, () => _robotCycleRoutine.Start(param) == RState.Running,_delay_1ms)
-                .LoopRunWithStopStatus(CycleRobotCycleStep.LoopRunRobotCycleWait, () => { return CommonFunction.CheckRoutineEndState(_robotCycleRoutine); },
-                 () => CheckRoutineStopStatus(_robotCycleRoutine, "CycleRobotCycleRoutine failed"))
-                .LoopEnd(CycleRobotCycleStep.LoopEnd, UpdateCycleCount, _delay_1ms)
-                .End(CycleRobotCycleStep.End, AchievedCycleCount, _delay_1ms);
-            return Runner.Status;
-        }
-
-        private bool CheckRoutineStopStatus(IRoutine routine, string error)
-        {
-            bool result = CommonFunction.CheckRoutineStopState(routine);
-            if (result)
-            {
-                Stop($"{error}");
-            }
-            return result;
-        }
-        
-        /// <summary>
-        /// Abort
-        /// </summary>
-        public void Abort()
-        {
-            Runner.Stop("CycleRobotCycleRoutine Abort");
-        }
-
-        /// <summary>
-        /// 统计完成的Cycle次数
-        /// </summary>
-        /// <returns></returns>
-        private bool UpdateCycleCount()
-        {
-            _currentCycle += 1;
-            return true;
-        }
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <returns></returns>
-        private bool AchievedCycleCount()
-        {
-            _currentCycle -= 1;
-            return true;
-        }
-        /// <summary>
-        /// 获取当前Cycle次数
-        /// </summary>
-        /// <returns></returns>
-        public int GetCurrentCycle()
-        {
-            return _currentCycle;
-        }
-    }
-}
-

+ 0 - 380
PunkHPX8_RT/Modules/EFEM/RobotCycleRoutine.cs

@@ -1,380 +0,0 @@
-using Aitex.Core.Common;
-using Aitex.Core.RT.Log;
-using Aitex.Core.RT.Routine;
-using Aitex.Core.RT.SCCore;
-using Aitex.Core.Util;
-using Aitex.Sorter.Common;
-using PunkHPX8_Core;
-using PunkHPX8_RT.Devices.EFEM;
-using PunkHPX8_RT.Modules.LPs;
-using MECF.Framework.Common.Beckhoff.Station;
-using MECF.Framework.Common.Equipment;
-using MECF.Framework.Common.Schedulers;
-using MECF.Framework.Common.SubstrateTrackings;
-using MECF.Framework.Common.Utilities;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PunkHPX8_RT.Modules.EFEM
-{
-    public class RobotCycleRoutine : ModuleRoutineBase, IRoutine
-    {
-        private enum RobotCycleStep
-        {
-
-            LPCycleStrat,
-            
-            PickFromLP,
-            PickFromLPCheck,
-
-            PlaceToAligner,
-            PlaceToAlignerCheck,
-
-            AlignAction,
-            AlignCompleteCheck,
-
-            PickFromAligner,
-            PickFromAlignerCheck,
-
-            PlaceToDummy,
-            PlaceToDummyCheck,
-
-            PickFromDummy,
-            PickFromDummyCheck,
-
-            PlaceToSrd,
-            PlaceToSrdCheck,
-
-            PickFromSrd,
-            PickFromSrdCheck,
-
-            PlaceToLP,
-            PlaceToLPCheck,
-
-            LPCycleEnd,
-
-            End
-        }
-
-        EfemBase _efem;
-        /// <summary>
-        /// 当前Cycle选中的LP里面的Wafer数量
-        /// </summary>
-        private int _waferCount;
-
-        private EfemPickRoutine _efemPickRoutine;
-        private EfemPlaceRoutine _efemPlaceRoutine;
-        private EFEMAlignRoutine _efemAlignRoutine;
-
-        private ModuleName _targetLP;
-        private ModuleName _targetAligner;
-        private ModuleName _targetDummy;
-        private ModuleName _targetSrd;
-        
-        private Queue<MoveItem> _lpToAlignerMoveItem = new Queue<MoveItem>();
-        private Queue<MoveItem> _alignerToDummyMoveItem = new Queue<MoveItem>();
-        private Queue<MoveItem> _alignerToSrdMoveItem = new Queue<MoveItem>();
-        private Queue<MoveItem> _dummyToLpMoveItem = new Queue<MoveItem>();
-        private Queue<MoveItem> _dummyToSrdMoveItem = new Queue<MoveItem>();
-        private Queue<MoveItem> _srdToLpMoveItem = new Queue<MoveItem>();
-        
-        private Queue<int> _lpWaferIndex = new Queue<int>(); //记录有LP有Wafer的slot号
-     
-        private int _moveTimeout = 20 * 1000;
-        private int _dummySlotNumber = 0;
-        private object[] alignerParamater;
-
-        public RobotCycleRoutine(EfemBase efem) : base(ModuleName.EfemRobot)
-        {
-            _efem = efem;
-            _efemPickRoutine = new EfemPickRoutine(efem);
-            _efemPlaceRoutine = new EfemPlaceRoutine(efem);
-            _efemAlignRoutine = new EFEMAlignRoutine(efem);
-
-        }
-
-        public RState Start(params object[] objs)
-        {
-            _lpWaferIndex.Clear();//初始化LP 有wafer的slot号
-            _waferCount = 0; //初始化wafercount的数量
-            int platType = SC.GetValue<int>("EFEM.Aligner1.AlignerPlatType");
-            alignerParamater = new object[3];//初始化Align参数
-            alignerParamater[0] = ModuleName.Aligner1;
-            alignerParamater[1] = 0;
-            
-            if (objs.Length >= 6)
-            {
-                _targetLP = (ModuleName)objs[0];
-                _targetAligner = (ModuleName)objs[1];
-                _targetDummy = (ModuleName)objs[2];
-                _targetSrd = (ModuleName)objs[3];
-                alignerParamater[2] = (int)objs[5];
-                alignerParamater[3] = platType;
-            }
-            else
-            {
-                return RState.Failed;
-            }
-            if (!CheckPreCondition()) //检验前提条件
-            {
-                return RState.Failed;
-            }
-            _moveTimeout = SC.GetValue<int>($"EFEM.MotionTimeout") * 1000;
-            
-            MoveItem lpToAlignerMoveItem = new MoveItem   //LP To Aligner
-            {
-                SourceModule = _targetLP,
-                SourceSlot = _lpWaferIndex.Dequeue(),
-                DestinationModule = ModuleName.Aligner1,
-                DestinationSlot = 0,
-                RobotHand = 0 //表示blade1
-            };
-            _lpToAlignerMoveItem.Enqueue(lpToAlignerMoveItem);
-
-
-           MoveItem alignerToDummyMoveItem = new MoveItem //Aligner To Dummy
-            {
-                SourceModule = ModuleName.Aligner1,
-                SourceSlot = 0,
-                DestinationModule = _targetDummy,
-                DestinationSlot = 0,
-                RobotHand = 0
-            };
-            _alignerToDummyMoveItem.Enqueue(alignerToDummyMoveItem);
-            
-            MoveItem alignerToSrdMoveItem = new MoveItem //Aligner To Srd
-            {
-                SourceModule = ModuleName.Aligner1,
-                SourceSlot = 0,
-                DestinationModule = _targetSrd,
-                DestinationSlot = 0,
-                RobotHand = 0
-            };
-            _alignerToSrdMoveItem.Enqueue(alignerToSrdMoveItem);
-            
-            MoveItem dummyToLpMoveItem = new MoveItem //Dummy To LP
-            {
-                SourceModule = _targetDummy,
-                SourceSlot = 0,
-                DestinationModule = _targetLP,
-                DestinationSlot = _lpToAlignerMoveItem.Peek().SourceSlot, //放回原来LP的slot位置
-                RobotHand = 0
-            };
-            _dummyToLpMoveItem.Enqueue(dummyToLpMoveItem);
-            
-            MoveItem dummyToSrdMoveItem = new MoveItem //Dummy To Srd
-            {
-                SourceModule = _targetDummy,
-                SourceSlot = 0, 
-                DestinationModule = _targetSrd,
-                DestinationSlot = 0,
-                RobotHand = 0
-            };
-            _dummyToSrdMoveItem.Enqueue(dummyToSrdMoveItem);
-            
-            MoveItem srdToLpMoveItem = new MoveItem //SRD To LP
-            {
-                DestinationModule = _targetLP,
-                DestinationSlot = _lpToAlignerMoveItem.Peek().SourceSlot, //放回原来LP的slot位置
-                RobotHand = 0
-            };
-            _srdToLpMoveItem.Enqueue(srdToLpMoveItem);
-
-            return Runner.Start(Module, "Robot Cycle start");
-        }
-       
-        public RState Monitor()
-        {
-            Runner.LoopStart(RobotCycleStep.LPCycleStrat, "LP Cycle Start", _waferCount, NullFun, _delay_1ms)
-   
-                .LoopRun(RobotCycleStep.PickFromLP, () => { return _efemPickRoutine.Start(_lpToAlignerMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunWithStopStatus(RobotCycleStep.PickFromLPCheck, () => { return CommonFunction.CheckRoutineEndState(_efemPickRoutine); },
-                 () => CheckRoutineStopStatus(_efemPickRoutine, "Efem pick from LP failed"))
-
-                .LoopRun(RobotCycleStep.PlaceToAligner, () => { return _efemPlaceRoutine.Start(_lpToAlignerMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunWithStopStatus(RobotCycleStep.PlaceToAlignerCheck, () => { return CommonFunction.CheckRoutineEndState(_efemPlaceRoutine); },
-                 () => CheckRoutineStopStatus(_efemPlaceRoutine, "Efem place to aligner failed"))
-
-                .LoopRun(RobotCycleStep.AlignAction, () => { return _efemAlignRoutine.Start(alignerParamater) == RState.Running; }, _delay_1ms)
-                .LoopRunWithStopStatus(RobotCycleStep.AlignCompleteCheck, () => { return CommonFunction.CheckRoutineEndState(_efemAlignRoutine); },
-                 () => CheckRoutineStopStatus(_efemAlignRoutine, "Efem aligner Action failed"))
-
-                .LoopRun(RobotCycleStep.PickFromAligner, () => { return _efemPickRoutine.Start(_alignerToDummyMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunWithStopStatus(RobotCycleStep.PickFromAlignerCheck, () => { return CommonFunction.CheckRoutineEndState(_efemPickRoutine); },
-                 () => CheckRoutineStopStatus(_efemPickRoutine, "Efem pick from aligner failed"))
-
-                //从Aligner到dummy
-                .LoopRunIf(RobotCycleStep.PlaceToDummy, _targetDummy != ModuleName.Unknown, () => { return _efemPlaceRoutine.Start(_alignerToDummyMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PlaceToDummyCheck, _targetDummy != ModuleName.Unknown,() => { return CommonFunction.CheckRoutineEndState(_efemPlaceRoutine); },
-                 () => CheckRoutineStopStatus(_efemPlaceRoutine, "Efem place to dummy failed"))
-
-                .LoopRunIf(RobotCycleStep.PickFromDummy, _targetDummy != ModuleName.Unknown, () => { return _efemPickRoutine.Start(_dummyToLpMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PickFromDummyCheck, _targetDummy != ModuleName.Unknown,() => { return CommonFunction.CheckRoutineEndState(_efemPickRoutine); },
-                 () => CheckRoutineStopStatus(_efemPickRoutine, "Efem pick from dummy failed"))
-
-                //从Aligner到SRD的
-                .LoopRunIf(RobotCycleStep.PlaceToSrd, _targetSrd != ModuleName.Unknown && _targetDummy==ModuleName.Unknown, () => { return _efemPlaceRoutine.Start(_alignerToSrdMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PlaceToSrdCheck, _targetSrd != ModuleName.Unknown && _targetDummy == ModuleName.Unknown, () => { return CommonFunction.CheckRoutineEndState(_efemPlaceRoutine); },
-                 () => CheckRoutineStopStatus(_efemPlaceRoutine, "Efem place to srd failed"))
-                .LoopRunIf(RobotCycleStep.PickFromSrd, _targetSrd != ModuleName.Unknown && _targetDummy == ModuleName.Unknown, () => { return _efemPickRoutine.Start(_alignerToSrdMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PickFromSrdCheck, _targetSrd != ModuleName.Unknown && _targetDummy == ModuleName.Unknown, () => { return CommonFunction.CheckRoutineEndState(_efemPickRoutine); },
-                 () => CheckRoutineStopStatus(_efemPickRoutine, "Efem pick from srd failed"))
-
-                //从dummy到SRD的
-                .LoopRunIf(RobotCycleStep.PlaceToSrd, _targetSrd != ModuleName.Unknown && _targetDummy != ModuleName.Unknown, () => { return _efemPlaceRoutine.Start(_dummyToSrdMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PlaceToSrdCheck, _targetSrd != ModuleName.Unknown && _targetDummy != ModuleName.Unknown, () => { return CommonFunction.CheckRoutineEndState(_efemPlaceRoutine); },
-                 () => CheckRoutineStopStatus(_efemPlaceRoutine, "Efem place to srd failed"))
-                .LoopRunIf(RobotCycleStep.PickFromSrd, _targetSrd != ModuleName.Unknown && _targetDummy != ModuleName.Unknown, () => { return _efemPickRoutine.Start(_dummyToSrdMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PickFromSrdCheck, _targetSrd != ModuleName.Unknown && _targetDummy != ModuleName.Unknown, () => { return CommonFunction.CheckRoutineEndState(_efemPickRoutine); },
-                 () => CheckRoutineStopStatus(_efemPickRoutine, "Efem pick from srd failed"))
-
-                //从Dummy回LP
-                .LoopRunIf(RobotCycleStep.PlaceToLP, _targetDummy != ModuleName.Unknown && _targetSrd == ModuleName.Unknown, () => { return _efemPlaceRoutine.Start(_dummyToLpMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PlaceToLPCheck, _targetDummy != ModuleName.Unknown && _targetSrd == ModuleName.Unknown, () => { return CommonFunction.CheckRoutineEndState(_efemPlaceRoutine); },
-                 () => CheckRoutineStopStatus(_efemPlaceRoutine, "Efem place to LP failed"))
-
-                //从SRD回LP
-                .LoopRunIf(RobotCycleStep.PlaceToLP, _targetSrd != ModuleName.Unknown, () => { return _efemPlaceRoutine.Start(_srdToLpMoveItem) == RState.Running; }, _delay_1ms)
-                .LoopRunIfWithStopStatus(RobotCycleStep.PlaceToLPCheck, _targetSrd != ModuleName.Unknown, () => { return CommonFunction.CheckRoutineEndState(_efemPlaceRoutine); },
-                 () => CheckRoutineStopStatus(_efemPlaceRoutine, "Efem place to LP failed"))
-
-                .LoopEnd(RobotCycleStep.LPCycleEnd, UpdateMoveItem, _delay_1ms)
-                .End(RobotCycleStep.End, ClearMoveItem, _delay_1ms);
-
-
-            return Runner.Status;
-        }
-
-        public void Abort()
-        {
-            _efem.Halt();
-        }
-
-        #region 功能方法
-        private bool CheckPreCondition()
-        {
-            if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0))
-            {
-                Stop($"Efem robot arm already has a wafer, cannot do the RobotCycle action");
-                return false;
-            }
-            //LoadPort状态判断
-            if (ModuleHelper.IsLoadPort(_targetLP) && ModuleHelper.IsInstalled(_targetLP))
-            {
-                Loadport loadPort = GetLoadPort(_targetLP);
-                if (loadPort == null)
-                {
-                    Stop($"{_targetLP} is null");
-                    return false;
-                }
-                WaferInfo[] waferInfos = WaferManager.Instance.GetWafers(_targetLP);
-                for (int i = 0; i < waferInfos.Length; i++)
-                {
-                    if (waferInfos[i] != null && !waferInfos[i].IsEmpty)
-                    {
-                        _waferCount++;
-                        _lpWaferIndex.Enqueue(i);
-                    }
-                }
-                if (_waferCount < 1)
-                {
-                    Stop($"there is no wafer in {_targetLP}");
-                    return false;
-                }
-
-            }
-            else if(ModuleHelper.IsLoadPort(_targetLP) && !ModuleHelper.IsInstalled(_targetLP))
-            {
-                Stop($"{_targetLP} is not installed");
-                return false;
-            }
-            //Aligner状态判断
-            //if (!ModuleHelper.IsInstalled(_targetAligner))
-            //{
-            //    Stop($"{_targetAligner} is not installed");
-            //    return false;
-            //}
-            //Dummy状态判断
-            if (!ModuleHelper.IsInstalled(_targetDummy))
-            {
-                Stop($"{_targetDummy} is not installed");
-                return false;
-            }
-            //若dummy存在wafer,需要人工处理
-            DummyDevice dummyDevice = Singleton<RouteManager>.Instance.EFEM.GetDummyDevice(_targetDummy - ModuleName.Dummy1);
-            if(dummyDevice != null)
-            {
-                if (!dummyDevice.HasCassette)
-                {
-                    Stop($"{_targetDummy} dose not have cassette");
-                    return false;
-                }
-                WaferInfo[] waferInfos = WaferManager.Instance.GetWafers(_targetDummy);
-                if(waferInfos.Length > 0)
-                {
-                    _dummySlotNumber = waferInfos.Length;
-                    foreach (var item in waferInfos)
-                    {
-                        if (item != null && !item.IsEmpty)
-                        {
-                            Stop($"There are wafers inside the {_targetDummy},cannot do the RobotCycle action");
-                            return false;
-                        }
-                    }
-                }
-                
-            }
-            return true;
-        }
-
-        private Loadport GetLoadPort(ModuleName station)
-        {
-            LoadPortModule loadPortModule = Singleton<RouteManager>.Instance.EFEM.GetLoadportModule(station - ModuleName.LP1);
-            return loadPortModule.LPDevice;
-        }
-
-        private bool CheckRoutineStopStatus(IRoutine routine, string error)
-        {
-            bool result = CommonFunction.CheckRoutineStopState(routine);
-            if (result)
-            {
-                Stop( $"{error}");
-            }
-            return result;
-        }
-        //更新取放dummy的位置
-        private bool UpdateMoveItem()
-        {
-            if (_lpWaferIndex.Count > 0)
-            {
-                _lpToAlignerMoveItem.Peek().SourceSlot = _lpWaferIndex.Dequeue(); //更新从LP取片的位置
-                if (_targetDummy != ModuleName.Unknown)
-                {
-                    _alignerToDummyMoveItem.Peek().DestinationSlot = (_alignerToDummyMoveItem.Peek().DestinationSlot + 1) % _dummySlotNumber; //更新放到Dummy的位置
-                    _dummyToLpMoveItem.Peek().SourceSlot = (_dummyToLpMoveItem.Peek().SourceSlot + 1) % _dummySlotNumber; //更新从dummy取片的位置,送回LP
-                    _dummyToSrdMoveItem.Peek().SourceSlot = (_dummyToSrdMoveItem.Peek().SourceSlot + 1) % _dummySlotNumber;//更新从dummy取片的位置,送到Srd
-                }
-                _dummyToLpMoveItem.Peek().DestinationSlot = _lpToAlignerMoveItem.Peek().SourceSlot;//更新从dummy放回LP的位置。 
-                _srdToLpMoveItem.Peek().DestinationSlot = _lpToAlignerMoveItem.Peek().SourceSlot;//更新从srd放回LP的位置。 
-            }
-            return true;
-        }
-        //清除MoveItem
-        private bool ClearMoveItem()
-        {
-            _lpToAlignerMoveItem.Clear();
-            _alignerToDummyMoveItem.Clear();
-            _alignerToSrdMoveItem.Clear();
-            _dummyToLpMoveItem.Clear();
-            _dummyToSrdMoveItem.Clear();
-            _srdToLpMoveItem.Clear();
-            return true;
-        }
-
-
-        #endregion
-    }
-}

+ 2 - 2
PunkHPX8_RT/Modules/VpwCell/VpwVacuumPrewetRoutine.cs

@@ -190,8 +190,8 @@ namespace PunkHPX8_RT.Modules.VpwCell
             }
             if (DateTime.Now.Subtract(_pumpDownTime).TotalMilliseconds >= _pumpDownWarningTime)
             {
-                LOG.WriteLog(eEvent.WARN_VPW, Module, $"vacuum value {vacuumValue} is less than {_recipe.VacuumTarget} in PumpDownWarningTime");
-                //AlarmListManager.Instance.AddWarn(Module, "vacuum value", $"vacuum value {vacuumValue} is less than {_recipe.VacuumTarget}");
+                //LOG.WriteLog(eEvent.WARN_VPW, Module, $"vacuum value {vacuumValue} is less than {_recipe.VacuumTarget} in PumpDownWarningTime");
+                AlarmListManager.Instance.AddWarn(Module, "vacuum value", $"vacuum value {vacuumValue} is less than {_recipe.VacuumTarget} in PumpDownWarningTime\"" );
             }
             if (DateTime.Now.Subtract(_pumpDownTime).TotalMilliseconds >= _pumpDownTimeOut)
             {

+ 0 - 2
PunkHPX8_RT/PunkHPX8_RT.csproj

@@ -251,14 +251,12 @@
     <Compile Include="Devices\VpwMain\VpwDeviceTimer.cs" />
     <Compile Include="Devices\VpwMain\VpwMainDevice.cs" />
     <Compile Include="Modules\EFEM\CycleRobotCycleNewRoutine.cs" />
-    <Compile Include="Modules\EFEM\CycleRobotCycleRoutine.cs" />
     <Compile Include="Modules\EFEM\EfemAutoMessageProcessor.cs" />
     <Compile Include="Modules\EFEM\EfemCycleAction.cs" />
     <Compile Include="Modules\EFEM\EfemRobotMapRoutine.cs" />
     <Compile Include="Modules\EFEM\EfemSafeCloseRoutine.cs" />
     <Compile Include="Modules\EFEM\EfemSafeOpenRoutine.cs" />
     <Compile Include="Modules\EFEM\RobotCycleMoveRoutine.cs" />
-    <Compile Include="Modules\EFEM\RobotCycleRoutine.cs" />
     <Compile Include="Modules\FaModuleNotifier.cs" />
     <Compile Include="Modules\HoldoffTimeSignalMonitor.cs" />
     <Compile Include="Devices\Dose\DosingSystemInitializeRoutine.cs" />