Browse Source

添加部分efem功能

lixiang 1 year ago
parent
commit
f3bd6b016b

+ 1 - 0
Venus/Venus_Core/DeviceName.cs

@@ -45,6 +45,7 @@ namespace Venus_Core
         //WriteCarrierId,
         Grip,
         EmsStop,
+        Swap
 
     }
 

+ 24 - 0
Venus/Venus_Core/RtState.cs

@@ -162,4 +162,28 @@ namespace Venus_Core
         Ready_For_TM,
         Ready_For_EFEM,
     }
+    public enum EFEMSTATE
+    {
+        Unknown,            // 0
+        Initializing,       // 1
+        Idle,               // 2
+        Error,              // 3
+        Picking,            // 4
+        Placing,            // 5
+        Aligning,           // 6
+        Mapping,            // 7
+        Init,               // 8
+        Orgshing,           // 9
+        Lifting,            // 10
+        InitingAL,          // 11
+        InitingRB,          // 12
+        Extending,          // 13
+        Retracting,         // 14
+                            //SettingLamp,        // 15
+        Swapping,
+        Gotoing,
+        Gripping,
+        Ungripping,
+        Fliping,
+    }
 }

+ 35 - 0
Venus/Venus_MainPages/Converters/EFEMStateConverter.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Windows.Data;
+using System.Windows.Media;
+using Venus_Core;
+
+namespace Venus_MainPages.Converters
+{
+    internal class EFEMStateConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            EFEMSTATE currentState = (EFEMSTATE)Enum.Parse(typeof(EFEMSTATE), value.ToString());
+            switch (currentState)
+            {
+                case EFEMSTATE.Init:
+                    return new SolidColorBrush(Colors.Yellow);
+
+                case EFEMSTATE.Idle:
+                    return new SolidColorBrush(Colors.WhiteSmoke);
+
+                case EFEMSTATE.Error:
+                    return new SolidColorBrush(Colors.Red);
+
+                default:
+                    return new SolidColorBrush(Colors.Lime);
+
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 1 - 1
Venus/Venus_MainPages/Unity/ModuleManager.cs

@@ -13,7 +13,7 @@ namespace Venus_MainPages.Unity
         /// </summary>
         public static readonly List<string> ModulesID = new List<string>()
         {
-             "LLA","LLB","TMRobot","LP1","LP2"
+             "LLA","LLB","TMRobot","LP1","LP2","LP3","EfemRobot","Aligner1"
         };
 
         public static Dictionary<string, ModuleInfo> ModuleInfos { get; private set; } = new Dictionary<string, ModuleInfo>();

+ 1 - 0
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -123,6 +123,7 @@
     <Compile Include="Converters\AllMultiValueConverter.cs" />
     <Compile Include="Converters\AllNoneCheckboxConverter.cs" />
     <Compile Include="Converters\AnyMultiValueConverter.cs" />
+    <Compile Include="Converters\EFEMStateConverter.cs" />
     <Compile Include="Converters\EventItemToStringConverter.cs" />
     <Compile Include="Converters\HeaterToStringConverter.cs" />
     <Compile Include="Converters\LLStateConverter.cs" />

+ 494 - 3
Venus/Venus_MainPages/ViewModels/EfemViewModel.cs

@@ -1,13 +1,504 @@
-using Prism.Mvvm;
+using Aitex.Sorter.Common;
+using ExcelLibrary.BinaryFileFormat;
+using MECF.Framework.Common.CommonData;
+using MECF.Framework.Common.DataCenter;
+using MECF.Framework.Common.Equipment;
+using MECF.Framework.Common.OperationCenter;
+using MECF.Framework.Common.Schedulers;
+using OpenSEMI.ClientBase;
+using Prism.Commands;
+using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Windows.Threading;
+using Venus_Core;
+using Venus_MainPages.Unity;
 
 namespace Venus_MainPages.ViewModels
 {
+    public enum EFEMModule
+    {
+        LLA, LLB,LP1,LP2,LP3,Aligner1
+    }
+    public enum EFEMBlade
+    {
+        Blade1, Blade2
+    }
+
     internal class EfemViewModel:BindableBase
     {
+        #region 私有字段       
+        private bool m_LLAIsInstalled;
+        private bool m_LLBIsInstalled;
+        private ModuleInfo m_LLAModuleInfo;
+        private ModuleInfo m_LLBModuleInfo;
+        private ModuleInfo m_LP1ModuleInfo;
+        private ModuleInfo m_LP2ModuleInfo;
+        private ModuleInfo m_LP3ModuleInfo;
+        private List<EFEMModule> m_EFEMModules = new List<EFEMModule>();
+        private EFEMBlade m_PickSelectedBlade;
+        private EFEMBlade m_PlaceSelectedBlade;
+        private EFEMBlade m_ExtendSelectedBlade;
+        private EFEMBlade m_RetractSelectedBlade;
+        private ObservableCollection<int> m_PlaceSoltItemsSource = new ObservableCollection<int>();
+        private ObservableCollection<int> m_PickSoltItemsSource = new ObservableCollection<int>();
+        private ObservableCollection<int> m_ExtendSoltItemsSource = new ObservableCollection<int>();
+        private ObservableCollection<int> m_RetractSoltItemsSource = new ObservableCollection<int>();
+        private int m_PickSoltSelectedIndex;
+        private int m_PlaceSoltSelectedIndex;
+        private int m_ExtendSoltSelectedIndex;
+        private int m_RetractSoltSelectedIndex;
+        private EFEMModule m_PickSelectedModule;
+        private EFEMModule m_PlaceSelectedModule;
+        private EFEMModule m_ExtendSelectedModule;
+        private EFEMModule m_RetractSelectedModule;
+
+        private WaferInfo m_BladeAWafer;
+        private WaferInfo m_BladeBWafer;
+
+        private WaferInfo m_Aligner1Wafer;
+
+        #endregion
+
+        #region 属性
+        public bool LLAIsInstalled
+        {
+            get { return m_LLAIsInstalled; }
+            set { SetProperty(ref m_LLAIsInstalled, value); }
+        }
+        public bool LLBIsInstalled
+        {
+            get { return m_LLBIsInstalled; }
+            set { SetProperty(ref m_LLBIsInstalled, value); }
+        }
+        public ModuleInfo LLAModuleInfo
+        {
+            get { return m_LLAModuleInfo; }
+            set { SetProperty(ref m_LLAModuleInfo, value); }
+        }
+        public ModuleInfo LLBModuleInfo
+        {
+            get { return m_LLBModuleInfo; }
+            set { SetProperty(ref m_LLBModuleInfo, value); }
+        }
+        public ModuleInfo LP1ModuleInfo
+        {
+            get { return m_LP1ModuleInfo; }
+            set { SetProperty(ref m_LP1ModuleInfo, value); }
+        }
+        public ModuleInfo LP2ModuleInfo
+        {
+            get { return m_LP2ModuleInfo; }
+            set { SetProperty(ref m_LP2ModuleInfo, value); }
+        }
+        public ModuleInfo LP3ModuleInfo
+        {
+            get { return m_LP3ModuleInfo; }
+            set { SetProperty(ref m_LP3ModuleInfo, value); }
+        }
+        public List<EFEMModule> EFEMModules
+        {
+            get { return m_EFEMModules; }
+            set { SetProperty(ref m_EFEMModules, value); }
+        }
+        public EFEMBlade PickSelectedBlade
+        {
+            get { return m_PickSelectedBlade; }
+            set { SetProperty(ref m_PickSelectedBlade, value); }
+        }
+        public EFEMBlade PlaceSelectedBlade
+        {
+            get { return m_PlaceSelectedBlade; }
+            set { SetProperty(ref m_PlaceSelectedBlade, value); }
+        }
+        public EFEMBlade ExtendSelectedBlade
+        {
+            get { return m_ExtendSelectedBlade; }
+            set { SetProperty(ref m_ExtendSelectedBlade, value); }
+        }
+        public EFEMBlade RetractSelectedBlade
+        {
+            get { return m_RetractSelectedBlade; }
+            set { SetProperty(ref m_RetractSelectedBlade, value); }
+        }
+        public ObservableCollection<int> PickSoltItemsSource
+        {
+            get { return m_PickSoltItemsSource; }
+            set { SetProperty(ref m_PickSoltItemsSource, value); }
+        }
+        public ObservableCollection<int> PlaceSoltItemsSource
+        {
+            get { return m_PlaceSoltItemsSource; }
+            set { SetProperty(ref m_PlaceSoltItemsSource, value); }
+        }
+        public ObservableCollection<int> ExtendSoltItemsSource
+        {
+            get { return m_ExtendSoltItemsSource; }
+            set { SetProperty(ref m_ExtendSoltItemsSource, value); }
+        }
+        public ObservableCollection<int> RetractSoltItemsSource
+        {
+            get { return m_RetractSoltItemsSource; }
+            set { SetProperty(ref m_RetractSoltItemsSource, value); }
+        }
+        public int PickSoltSelectedIndex
+        {
+            get { return m_PickSoltSelectedIndex; }
+            set { SetProperty(ref m_PickSoltSelectedIndex, value); }
+        }
+        public int PlaceSoltSelectedIndex
+        {
+            get { return m_PlaceSoltSelectedIndex; }
+            set { SetProperty(ref m_PlaceSoltSelectedIndex, value); }
+        }
+        public int ExtendSoltSelectedIndex
+        {
+            get { return m_ExtendSoltSelectedIndex; }
+            set { SetProperty(ref m_ExtendSoltSelectedIndex, value); }
+        }
+        public int RetractSoltSelectedIndex
+        {
+            get { return m_RetractSoltSelectedIndex; }
+            set { SetProperty(ref m_RetractSoltSelectedIndex, value); }
+        }
+        public EFEMModule PickSelectedModule
+        {
+            get { return m_PickSelectedModule; }
+            set { SetProperty(ref m_PickSelectedModule, value); }
+        }
+        public EFEMModule PlaceSelectedModule
+        {
+            get { return m_PlaceSelectedModule; }
+            set { SetProperty(ref m_PlaceSelectedModule, value); }
+        }
+        public EFEMModule ExtendSelectedModule
+        {
+            get { return m_ExtendSelectedModule; }
+            set { SetProperty(ref m_ExtendSelectedModule, value); }
+        }
+        public EFEMModule RetractSelectedModule
+        {
+            get { return m_RetractSelectedModule; }
+            set { SetProperty(ref m_RetractSelectedModule, value); }
+        }
+        public WaferInfo BladeAWafer
+        {
+            get { return m_BladeAWafer; }
+            set { SetProperty(ref m_BladeAWafer, value); }
+        }
+        public WaferInfo BladeBWafer
+        {
+            get { return m_BladeBWafer; }
+            set { SetProperty(ref m_BladeBWafer, value); }
+        }
+        public WaferInfo Aligner1Wafer
+        {
+            get { return m_Aligner1Wafer; }
+            set { SetProperty(ref m_Aligner1Wafer, value); }
+        }
+        
+        #endregion
+
+        #region 命令
+        private DelegateCommand _ExtendCommand;
+        public DelegateCommand ExtendCommand =>
+            _ExtendCommand ?? (_ExtendCommand = new DelegateCommand(OnExtend));
+        private DelegateCommand _RetractCommand;
+        public DelegateCommand RetractCommand =>
+            _RetractCommand ?? (_RetractCommand = new DelegateCommand(OnRetract));
+
+        private DelegateCommand<object> _ModuleChangeCommand;
+        public DelegateCommand<object> ModuleChangeCommand =>
+            _ModuleChangeCommand ?? (_ModuleChangeCommand = new DelegateCommand<object>(OnModuleChange));
+
+        private DelegateCommand _PickCommand;
+        public DelegateCommand PickCommand =>
+            _PickCommand ?? (_PickCommand = new DelegateCommand(OnPick));
+
+        private DelegateCommand _PlaceCommand;
+        public DelegateCommand PlaceCommand =>
+            _PlaceCommand ?? (_PlaceCommand = new DelegateCommand(OnPlace));
+
+        private DelegateCommand _HomeAllCommand;
+        public DelegateCommand HomeAllCommand =>
+            _HomeAllCommand ?? (_HomeAllCommand = new DelegateCommand(OnHomeAll));
+
+        private DelegateCommand _ClearErrorCommand;
+        public DelegateCommand ClearErrorCommand =>
+            _ClearErrorCommand ?? (_ClearErrorCommand = new DelegateCommand(OnClearError));
+
+        private DelegateCommand _AbortCommand;
+        public DelegateCommand AbortCommand =>
+            _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort));
+
+        private DelegateCommand _Align1HomeCommand;
+        public DelegateCommand Align1HomeCommand =>
+            _Align1HomeCommand ?? (_Align1HomeCommand = new DelegateCommand(OnAlign1Home));
+
+        private DelegateCommand _Align1UpCommand;
+        public DelegateCommand Align1UpCommand =>
+            _Align1UpCommand ?? (_Align1UpCommand = new DelegateCommand(OnAlign1Up));
+        private DelegateCommand _Align1DownCommand;
+        public DelegateCommand Align1DownCommand =>
+            _Align1DownCommand ?? (_Align1DownCommand = new DelegateCommand(OnAlign1Down));
+        #endregion
+
+        #region 构造函数
+        public EfemViewModel()
+        {
+            string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
+            
+            LLAIsInstalled = allModules.Contains("LLA");
+            LLBIsInstalled = allModules.Contains("LLB");
+            DispatcherTimer timer = new DispatcherTimer();
+            timer.Interval = TimeSpan.FromSeconds(0.1);
+            timer.Tick += Timer_Tick;
+            timer.Start();
+            EFEMModules.Add(EFEMModule.LLA);
+            EFEMModules.Add(EFEMModule.LLB);
+            EFEMModules.Add(EFEMModule.LP1);
+            EFEMModules.Add(EFEMModule.LP2);
+            EFEMModules.Add(EFEMModule.Aligner1);
+            OnModuleChange("Pick");
+            OnModuleChange("Place");
+            //OnModuleChange("Extend");
+
+            //OnModuleChange("Retract");
+
+
+        }
+        #endregion
+
+        #region 命令方法
+        private void OnModuleChange(object obj)
+        {
+            var value = obj.ToString();
+            switch (value)
+            {
+                case "Pick":
+                     PickSoltItemsSource.Clear();
+                    switch (PickSelectedModule)
+                    {
+                        case EFEMModule.LLA:
+                        case EFEMModule.LLB:
+                            PickSoltItemsSource.Add(1);
+                            PickSoltItemsSource.Add(2);
+                            break;
+                        case EFEMModule.LP1:
+                        case EFEMModule.LP2:
+                        case EFEMModule.LP3:
+
+                            for (int i = 1; i < 26; i++)
+                            {
+                                PickSoltItemsSource.Add(i);
+                            }
+                            break;
+
+                        default:
+                            PickSoltItemsSource.Add(1);
+                            break;
+                    }
+                    PickSoltSelectedIndex = 0;
+
+                    break;
+
+                case "Place":
+                    PlaceSoltItemsSource.Clear();
+                    switch (PlaceSelectedModule)
+                    {
+                        case EFEMModule.LLA:
+                        case EFEMModule.LLB:
+                            PlaceSoltItemsSource.Add(1);
+                            PlaceSoltItemsSource.Add(2);
+                            break;
+                        case EFEMModule.LP1:
+                        case EFEMModule.LP2:
+                        case EFEMModule.LP3:
+
+                            for (int i = 1; i < 26; i++)
+                            {
+                                PlaceSoltItemsSource.Add(i);
+                            }
+                            break;
+
+                        default:
+                            PlaceSoltItemsSource.Add(1);
+                            break;
+                    }
+                    PlaceSoltSelectedIndex = 0;
+                    break;
+
+                //case "Extend":
+                //    ExtendSoltItemsSource.Clear();
+                //    switch (ExtendSelectedModule)
+                //    {
+                //        case EFEMModule.LLA:
+                //        case EFEMModule.LLB:
+                //            ExtendSoltItemsSource.Add(1);
+                //            ExtendSoltItemsSource.Add(2);
+                //            break;
+                //        case EFEMModule.LP1:
+                //        case EFEMModule.LP2:
+                //        case EFEMModule.LP3:
+
+                //            for (int i = 1; i < 26; i++)
+                //            {
+                //                ExtendSoltItemsSource.Add(i);
+                //            }
+                //            break;
+
+                //        default:
+                //            ExtendSoltItemsSource.Add(1);
+                //            break;
+                //    }
+                //    ExtendSoltSelectedIndex = 0;
+                //    break;
+
+                //case "Retract":
+                //    RetractSoltItemsSource.Clear();
+                //    switch (RetractSelectedModule)
+                //    {
+                //        case EFEMModule.LLA:
+                //        case EFEMModule.LLB:
+                //            RetractSoltItemsSource.Add(1);
+                //            RetractSoltItemsSource.Add(2);
+                //            break;
+                //        case EFEMModule.LP1:
+                //        case EFEMModule.LP2:
+                //        case EFEMModule.LP3:
+
+                //            for (int i = 1; i < 26; i++)
+                //            {
+                //                RetractSoltItemsSource.Add(i);
+                //            }
+                //            break;
+
+                //        default:
+                //            RetractSoltItemsSource.Add(1);
+                //            break;
+                //    }
+                //    RetractSoltSelectedIndex = 0;
+                //    break;
+            }
+
+        }
+
+        private void OnExtend()
+        {
+            var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
+            var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
+            InvokeClient.Instance.Service.DoOperation($"EFEM.{RtOperation.Extend}", moduleName, 0, selectedHand);
+        }
+        private void OnRetract()
+        {
+            var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
+            var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
+            InvokeClient.Instance.Service.DoOperation($"EFEM.{RtOperation.Retract}", moduleName, 0, selectedHand);
+        }
+        private void OnPick()
+        {
+            Queue<MoveItem> moveItems = new Queue<MoveItem>();
+
+            var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PickSelectedModule.ToString(), true);
+            var selectedHand = (Hand)Enum.Parse(typeof(Hand), PickSelectedBlade.ToString(), true);
+            MoveItem moveItem = new MoveItem(moduleName, PickSoltItemsSource[PickSoltSelectedIndex]-1, 0, 0, selectedHand);
+            moveItems.Enqueue(moveItem);
+
+            if (PickSelectedModule == EFEMModule.LLA || PickSelectedModule == EFEMModule.LLB)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Swap}", moveItems);
+
+            }
+            else
+            { 
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Pick}", moveItems);
+            }
+            //if ((int)PickSelectedModule > 3)
+            //{
+            //    InvokeClient.Instance.Service.DoOperation($"EFEM.{RtOperation.LLPick}", moveItems);
+            //}
+            //else
+            //{
+            //    InvokeClient.Instance.Service.DoOperation($"EFEM.{RtOperation.PMPick}", moveItems);
+            //}
+        }
+        private void OnPlace()
+        {
+            Queue<MoveItem> moveItems = new Queue<MoveItem>();
+            var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
+
+            var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
+            MoveItem moveItem = new MoveItem(0, 0, moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex]-1, selectedHand);
+            moveItems.Enqueue(moveItem);
+            //if ((int)PlaceSelectedModule > 3)
+            //{
+            //    InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.LLPlace}", moveItems);
+            //}
+            //else
+            //{
+            //    InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.PMPlace}", moveItems);
+            //}
+            if (PlaceSelectedModule == EFEMModule.LLA || PlaceSelectedModule == EFEMModule.LLB)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Swap}", moveItems);
+
+            }
+            else
+            { 
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Place}", moveItems);
+
+            }
+
+        }
+        private void OnHomeAll()
+        {
+            InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.Home}");
+        }
+        private void OnClearError()
+        {
+            InvokeClient.Instance.Service.DoOperation($"EFEM.{EfemOperation.ClearError}");
+        }
+        private void OnAbort()
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Abort}");            
+        }
+        private void OnAlign1Home()
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Home}");
+        }
+        private void OnAlign1Up()
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Lift}", true);
+        }
+        private void OnAlign1Down()
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Lift}", false);
+        }
+        #endregion
+
+        #region 私有方法
+        private void Timer_Tick(object sender, EventArgs e)
+        {
+            if (LLAIsInstalled == true)
+            {
+                LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
+            }
+            if (LLBIsInstalled == true)
+            {
+                LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
+            }
+            LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
+            LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
+            LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
+            BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
+            BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
+            Aligner1Wafer= ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
+
+        }
+
+        #endregion
+
     }
 }

+ 8 - 7
Venus/Venus_MainPages/ViewModels/OverVenusViewModel.cs

@@ -1316,7 +1316,7 @@ namespace Venus_MainPages.ViewModels
             CurrentModuleRecipes = GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList();
         }
 
-        private async void OnHV()
+        private  void OnHV()
         {
             if (ESCHVData.IsOn == true)
             {
@@ -1325,13 +1325,14 @@ namespace Venus_MainPages.ViewModels
             }
             else
             {
-                await Task.Run(async () =>
-                {
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetESCHVIsOn", true);
-                    await Task.Delay(1000);
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetESCHV", ESCVoltage);
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetESCHV", ESCVoltage);
+
+                //await Task.Run(async () =>
+                //{
+                //    //InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetESCHVIsOn", true);
+                //    //await Task.Delay(1000);
 
-                });
+                //});
             }
            
             

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

@@ -791,7 +791,7 @@ namespace Venus_MainPages.ViewModels
         #region 构造函数
         public TMViewModel()
         {
-            string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
+            string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
             PMAIsInstalled = allModules.Contains("PMA");
             PMBIsInstalled = allModules.Contains("PMB");
             PMCIsInstalled = allModules.Contains("PMC");

+ 85 - 27
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -30,7 +30,7 @@ namespace Venus_MainPages.ViewModels
         private List<string> m_RtDataKeys=new List<string>();
         private Dictionary<string, object> m_RtDataValues;
 
-        private string ModuleName;
+        //private string ModuleName;
 
         private ObservableCollection<EventItem> m_EventLogList = new ObservableCollection<EventItem>();
         private EventItem m_CurrentEventItem=new EventItem ();
@@ -49,6 +49,13 @@ namespace Venus_MainPages.ViewModels
         private bool m_PMBIsInstalled;
         private bool m_PMCIsInstalled;
         private bool m_PMDIsInstalled;
+        private bool m_LLAIsInstalled;
+        private bool m_LLBIsInstalled;
+        private bool m_TMIsInstalled;
+        private bool m_EFEMIsInstalled;
+
+
+
 
         #endregion
 
@@ -188,6 +195,26 @@ namespace Venus_MainPages.ViewModels
             get { return m_PMDIsInstalled; }
             set { SetProperty(ref m_PMDIsInstalled, value); }
         }
+        public bool LLAIsInstalled
+        {
+            get { return m_LLAIsInstalled; }
+            set { SetProperty(ref m_LLAIsInstalled, value); }
+        }
+        public bool LLBIsInstalled
+        {
+            get { return m_LLBIsInstalled; }
+            set { SetProperty(ref m_LLBIsInstalled, value); }
+        }
+        public bool TMIsInstalled
+        {
+            get { return m_TMIsInstalled; }
+            set { SetProperty(ref m_TMIsInstalled, value); }
+        }
+        public bool EFEMIsInstalled
+        {
+            get { return m_EFEMIsInstalled; }
+            set { SetProperty(ref m_EFEMIsInstalled, value); }
+        }
         #endregion
 
         #region 命令
@@ -207,9 +234,9 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand SkipCommand =>
                  _SkipCommand ?? (_SkipCommand = new DelegateCommand(OnSkip));
 
-        private DelegateCommand _BuzzerOffCommand;
-        public DelegateCommand BuzzerOffCommand =>
-                 _BuzzerOffCommand ?? (_BuzzerOffCommand = new DelegateCommand(OnBuzzerOff));
+        //private DelegateCommand _BuzzerOffCommand;
+        //public DelegateCommand BuzzerOffCommand =>
+        //         _BuzzerOffCommand ?? (_BuzzerOffCommand = new DelegateCommand(OnBuzzerOff));
 
         private DelegateCommand _FADisableCommand;
         public DelegateCommand FADisableCommand =>
@@ -235,7 +262,19 @@ namespace Venus_MainPages.ViewModels
             //Title = selectedChamber.ToString();
             m_SoftwareVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
 
-            ModuleName = "PMA";
+            string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
+
+            PMAIsInstalled = allModules.Contains("PMA");
+            PMBIsInstalled = allModules.Contains("PMB");
+            PMCIsInstalled = allModules.Contains("PMC");
+            PMDIsInstalled = allModules.Contains("PMD");
+            LLAIsInstalled = allModules.Contains("LLA");
+            LLBIsInstalled = allModules.Contains("LLB");
+            TMIsInstalled = allModules.Contains("TM");
+            EFEMIsInstalled = allModules.Contains("EFEM");
+
+
+            //ModuleName = "PMA";
             addDataKeys();
 
             DispatcherTimer timer = new DispatcherTimer();
@@ -245,11 +284,10 @@ namespace Venus_MainPages.ViewModels
             
             EventClient.Instance.OnEvent += Instance_OnEvent;
             EventClient.Instance.Start();
-            string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
-            PMAIsInstalled = allModules.Contains("PMA");
-            PMBIsInstalled = allModules.Contains("PMB");
-            PMCIsInstalled = allModules.Contains("PMC");
-            PMDIsInstalled = allModules.Contains("PMD");
+           
+
+
+
         }
         #endregion
 
@@ -268,8 +306,7 @@ namespace Venus_MainPages.ViewModels
         }
 
         private void OnSwitchLanguage()
-        {
-            
+        {            
             List<ResourceDictionary> dictionaryList = new List<ResourceDictionary>();
             foreach (ResourceDictionary dictionary in Application.Current.Resources.MergedDictionaries)
             {
@@ -299,20 +336,41 @@ namespace Venus_MainPages.ViewModels
         }
         private void addDataKeys()
         {
-            m_RtDataKeys.Add("PMA.FsmState");
-            m_RtDataKeys.Add("PMB.FsmState");
-            m_RtDataKeys.Add("PMC.FsmState");
-            m_RtDataKeys.Add("PMD.FsmState");
-            m_RtDataKeys.Add("TM.FsmState");
-            m_RtDataKeys.Add("LLA.FsmState");
-            m_RtDataKeys.Add("LLB.FsmState");
-            
-
-            m_RtDataKeys.Add("EFEM.FsmState");
+            if (PMAIsInstalled == true)
+            {
+                m_RtDataKeys.Add("PMA.FsmState");
+            }
+            if (PMBIsInstalled == true)
+            {
+                m_RtDataKeys.Add("PMB.FsmState");
+            }
+            if (PMCIsInstalled == true)
+            {
+                m_RtDataKeys.Add("PMC.FsmState");
+            }
+            if (PMDIsInstalled == true)
+            {
+                m_RtDataKeys.Add("PMD.FsmState");
+            }
+            if (TMIsInstalled == true)
+            {
+                m_RtDataKeys.Add("TM.FsmState");
+            }
+            if (LLAIsInstalled == true)
+            {
+                m_RtDataKeys.Add("LLA.FsmState");
+            }
+            if (LLBIsInstalled == true)
+            {
+                m_RtDataKeys.Add("LLB.FsmState");
+            }
+            if (EFEMIsInstalled == true)
+            {
+                m_RtDataKeys.Add("EFEM.FsmState");
+            }
 
             m_RtDataKeys.Add("SYSTEM.FsmState");
 
-            m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
             m_RtDataKeys.Add($"System.SignalTower.DeviceData");
             m_RtDataKeys.Add("System.CommunicationStatus");
         }
@@ -384,10 +442,10 @@ namespace Venus_MainPages.ViewModels
                 }
             }
         }
-        private void OnBuzzerOff()
-        {
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SignalTower.SwitchOffBuzzer");
-        }
+        //private void OnBuzzerOff()
+        //{
+        //    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SignalTower.SwitchOffBuzzer");
+        //}
         public void FaDisable()
         {
             InvokeClient.Instance.Service.DoOperation($"System.FACommand", "FADisable");

+ 233 - 6
Venus/Venus_MainPages/Views/EfemView.xaml

@@ -6,11 +6,32 @@
              xmlns:local="clr-namespace:Venus_MainPages.Views"
              xmlns:customControls="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
              xmlns:userControls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
+             xmlns:prism="http://prismlibrary.com/"
+             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:unity="clr-namespace:Venus_MainPages.Unity"
              mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+             d:DesignHeight="450" d:DesignWidth="1920">
     <Canvas>
-        <Canvas >
-            <Viewbox Width="700" Height="700" Canvas.Top="100" Stretch="Fill">
+        <Border BorderThickness="0,0,0,1" BorderBrush="Black" Canvas.Top="20" Canvas.Left="40">
+            <StackPanel Orientation="Horizontal" Margin="0,0,0,5">
+                <RadioButton Content="Connect"    FontSize="15"   Width="120" Height="28" Margin="20 5 5 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding TMIsOFFline,Converter={StaticResource BoolToBool},Mode=TwoWay}" GroupName="IsConnect"/>
+                <RadioButton Content="DisConnect" FontSize="15"   Width="120" Height="28" Margin="5 5 0 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding TMIsOFFline,Mode=TwoWay}" GroupName="IsConnect"/>
+                <customControls:PathButton Content="Home All" FontSize="15"   Width="120" Height="28" Margin="80 5 5 0" Command="{Binding HomeAllCommand}"/>
+                <customControls:PathButton Content="Clear Error" FontSize="15"   Width="120" Height="28" Margin="5 5 0 0" Command="{Binding ClearErrorCommand}"/>
+                <customControls:PathButton Content="Abort" FontSize="15"   Width="120" Height="28" Margin="5 5 0 0" Command="{Binding AbortCommand}"/>
+
+                <RadioButton Content="Online"    FontSize="15"   Width="120" Height="28" Margin="80 5 5 5" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding TMIsOFFline,Converter={StaticResource BoolToBool},Mode=TwoWay}" GroupName="IsOnline"/>
+                <RadioButton Content="Offline"   FontSize="15"   Width="120" Height="28" Margin="5 5 0 5" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding TMIsOFFline,Mode=TwoWay}" GroupName="IsOnline"/>
+            </StackPanel>
+        </Border>
+            <userControls:FOUPFrontView UnitData="{Binding LP1ModuleInfo}"  Canvas.Top="120" Canvas.Left="10"/>
+            <userControls:FOUPFrontView UnitData="{Binding LP2ModuleInfo}"  Canvas.Top="120" Canvas.Left="150"/>
+            <userControls:FOUPFrontView UnitData="{Binding LP3ModuleInfo}"  Canvas.Top="120" Canvas.Left="300"/>
+
+            <userControls:FOUPFrontView UnitData="{Binding LLAModuleInfo}" VerticalAlignment="Top" Canvas.Top="260" Canvas.Left="460" Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+            <userControls:FOUPFrontView UnitData="{Binding LLBModuleInfo}" VerticalAlignment="Top" Canvas.Top="260" Canvas.Left="920" Visibility="{Binding LLBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+            <Viewbox Width="700" Height="700" Canvas.Top="50" Canvas.Left="400" Stretch="Fill">
                 <Canvas Width="1000" Height="1000">
                     <userControls:MainTM Width="300" Height="250" Canvas.Left="380" Canvas.Top="90"/>
 
@@ -26,8 +47,8 @@
                     <userControls:TMChamber x:Name="PMB" Canvas.Top="28"   Canvas.Left="315" Width="140" Height="140" RotateTransformValue="-28"  DoorIsOpen="{Binding RtDataValues[PMB.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMBWafer}" />
                     <userControls:TMChamber x:Name="PMC" Canvas.Top="-38"  Canvas.Left="588" Width="140" Height="140" RotateTransformValue="30"   DoorIsOpen="{Binding RtDataValues[PMC.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMCWafer}" />
                     <userControls:TMChamber x:Name="PMD" Canvas.Top="160"  Canvas.Left="788" Width="140" Height="140" RotateTransformValue="90"   DoorIsOpen="{Binding RtDataValues[PMD.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMDWafer}" />-->
-                    
-                    <userControls:EFEM Width="600" Height="300" Canvas.Left="200" Canvas.Top="476"/>
+
+                <userControls:EFEM Width="600" Height="300" Canvas.Left="200" Canvas.Top="476" ZuoShangWafer="{Binding Aligner1Wafer}"/>
 
                     <customControls:WaferRobotControl OriginT="PMA"    Canvas.Left="400" Canvas.Top="473"   Width="200" Height="300"    RobotTAction="{Binding Robot1TAction}" RobotXAction="{Binding Robot1XAction}" RobotWafer="{Binding BladeAWafer}"/>
                     <customControls:WaferRobotControl OriginT="PMD"    Canvas.Left="400" Canvas.Top="473"   Width="200" Height="300"    RobotTAction="{Binding Robot2TAction}" RobotXAction="{Binding Robot2XAction}"  RobotWafer="{Binding BladeBWafer}"/>
@@ -35,7 +56,213 @@
                
             </Viewbox>
            
-        </Canvas>
+
+        <Grid      Canvas.Top="40" Canvas.Right="20" Width="550">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="30"/>
+                <RowDefinition Height="Auto"/>
+            </Grid.RowDefinitions>
+            <Border  BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_FirstTitle}" Padding="5,1">
+                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
+                    <Path Data="M0,0 L5,0 5,5 z" Fill="White" HorizontalAlignment="Left" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Width="5" Height="5">
+                        <Path.RenderTransform>
+                            <TransformGroup>
+                                <ScaleTransform/>
+                                <SkewTransform/>
+                                <RotateTransform Angle="45"/>
+                                <TranslateTransform/>
+                            </TransformGroup>
+                        </Path.RenderTransform>
+                    </Path>
+                    <TextBlock  Margin="5,0,0,0" Text="EFEM Robot Operation" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_White}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+                </StackPanel>
+            </Border>
+
+            <!--<Border  Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" Background="{DynamicResource Table_BG_Content}"   >-->
+            <Grid Height="100" unity:GridOptions.ShowBorder="True" unity:GridOptions.LineBrush="Black" Grid.Row="1" Background="{DynamicResource Table_BG_Content}">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="25"/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <!--<RowDefinition/>
+                    <RowDefinition/>-->
+                    <!--<RowDefinition/>-->
+                </Grid.RowDefinitions>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition/>
+                    <ColumnDefinition/>
+                    <ColumnDefinition/>
+                    <ColumnDefinition/>
+                </Grid.ColumnDefinitions>
+
+                <TextBlock Text="Module"                    HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14" />
+                <TextBlock Text="Slot" Grid.Column="1"      HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14"/>
+                <TextBlock Text="Blada" Grid.Column="2"       HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/>
+                <TextBlock Text="Operation" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14"/>
+
+                <ComboBox Grid.Row="1"                 Margin="5" SelectedItem="{Binding PickSelectedModule}" ItemsSource="{Binding EFEMModules}">
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="SelectionChanged">
+                            <i:InvokeCommandAction Command="{Binding ModuleChangeCommand}" CommandParameter="Pick"/>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </ComboBox>
+                <ComboBox Grid.Row="1" Grid.Column="1"   Margin="5" ItemsSource="{Binding PickSoltItemsSource}" SelectedIndex="{Binding PickSoltSelectedIndex}"/>
+                <ComboBox Grid.Row="1" Grid.Column="2"   Margin="5"  SelectedItem="{Binding PickSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
+                <Button   Grid.Row="1" Grid.Column="3"     Content="Pick" Command="{Binding PickCommand}"/>
+
+                <ComboBox Grid.Row="2"                 Margin="5" SelectedItem="{Binding PlaceSelectedModule}" ItemsSource="{Binding EFEMModules}">
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="SelectionChanged">
+                            <i:InvokeCommandAction Command="{Binding ModuleChangeCommand}" CommandParameter="Place" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </ComboBox>
+                <ComboBox Grid.Row="2" Grid.Column="1" Margin="5" ItemsSource="{Binding PlaceSoltItemsSource}" SelectedIndex="{Binding PlaceSoltSelectedIndex}"/>
+                <ComboBox Grid.Row="2" Grid.Column="2" Margin="5" SelectedItem="{Binding PlaceSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
+                <Button   Grid.Row="2" Grid.Column="3"  Content="Place"  Command="{Binding PlaceCommand}"/>
+
+
+                <!--<ComboBox Grid.Row="3"                 Margin="5" SelectedItem="{Binding ExtendSelectedModule}" ItemsSource="{Binding EFEMModules}">
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="SelectionChanged">
+                            <i:InvokeCommandAction Command="{Binding ModuleChangeCommand}" CommandParameter="Extend" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </ComboBox>
+                <ComboBox Grid.Row="3" Grid.Column="1" Margin="5" ItemsSource="{Binding ExtendSoltItemsSource}" SelectedIndex="{Binding ExtendSoltSelectedIndex}"/>
+                <ComboBox Grid.Row="3" Grid.Column="2" Margin="5" SelectedItem="{Binding ExtendSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
+                <Button   Grid.Row="3" Grid.Column="3"  Content="Extend" Command="{Binding ExtendCommand}"/>
+
+                <ComboBox Grid.Row="4"                 Margin="5" SelectedItem="{Binding RetractSelectedModule}" ItemsSource="{Binding EFEMModules}">
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="SelectionChanged">
+                            <i:InvokeCommandAction Command="{Binding ModuleChangeCommand}" CommandParameter="Retract" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </ComboBox>
+                <ComboBox Grid.Row="4" Grid.Column="1" Margin="5" ItemsSource="{Binding RetractSoltItemsSource}" SelectedIndex="{Binding RetractSoltSelectedIndex}"/>
+                <ComboBox Grid.Row="4" Grid.Column="2" Margin="5" SelectedItem="{Binding RetractSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
+                <Button   Grid.Row="4" Grid.Column="3"  Content="Retract" Command="{Binding RetractCommand}"/>-->
+
+                <!--<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>
+        </Grid>
+
+
+        <StackPanel Canvas.Top="520" Canvas.Left="1400"  Width="520">
+                <Grid>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="30"/>
+                        <RowDefinition Height="Auto"/>
+                        <RowDefinition />
+                    </Grid.RowDefinitions>
+                    <Border  BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_FirstTitle}" Padding="5,1">
+                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
+                            <Path Data="M0,0 L5,0 5,5 z" Fill="White" HorizontalAlignment="Left" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Width="5" Height="5">
+                                <Path.RenderTransform>
+                                    <TransformGroup>
+                                        <ScaleTransform/>
+                                        <SkewTransform/>
+                                        <RotateTransform Angle="45"/>
+                                        <TranslateTransform/>
+                                    </TransformGroup>
+                                </Path.RenderTransform>
+                            </Path>
+                            <TextBlock  Margin="5,0,0,0" Text="LoadPort Operation" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_White}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+                        </StackPanel>
+                    </Border>
+                    <Border  Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" Background="{DynamicResource Table_BG_Content}" BorderThickness="1,0,1,0" Padding="5,1">
+                        <WrapPanel Margin="10,10,10,0" Orientation="Horizontal" HorizontalAlignment="Center">
+                            <RadioButton Content="LP1"  Width="80" Margin="2 0 0 10" IsChecked="True">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding ModuleCheckedCommand}" CommandParameter="TM"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+                            <RadioButton Content="LP2" Width="80" Margin="2 0 0 10" Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding ModuleCheckedCommand}" CommandParameter="LLA"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+                            <RadioButton Content="LP3" Width="80" Margin="2 0 0 10" Visibility="{Binding LLBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding ModuleCheckedCommand}" CommandParameter="LLB"/>
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                        </WrapPanel>
+                    </Border>
+                    <!--<Border  Grid.Row="2" BorderBrush="{DynamicResource Table_BD}" Background="{DynamicResource Table_BG_Content}" BorderThickness="1,0,1,1" >-->
+                    <Grid Grid.Row="2" unity:GridOptions.ShowBorder="True" unity:GridOptions.LineBrush="Black"   Background="{DynamicResource Table_BG_Content}">
+                        <Grid.RowDefinitions>
+                            <RowDefinition/>
+                            <RowDefinition/>
+                            <RowDefinition/>
+
+                        </Grid.RowDefinitions>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+                            <ColumnDefinition/>
+
+                        </Grid.ColumnDefinitions>
+                        <TextBlock Text="Base Pressure"   Padding="6,7,0,5" Background="#D0D8E8"/>
+                        <TextBox  Grid.Column="1" BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Text="{Binding RobotAction2,UpdateSourceTrigger=PropertyChanged}"/>
+                        <TextBlock Text="Pump Time"        Grid.Column="2"  Padding="15,7,0,5" Background="#D0D8E8"/>
+                        <TextBox  Grid.Column="3" BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Text="{Binding RobotArm,UpdateSourceTrigger=PropertyChanged}"/>
+                        <TextBlock Text="Hold Time"        Grid.Column="4"  Padding="15,7,0,5" Background="#D0D8E8"/>
+                        <TextBox  Grid.Column="5" BorderThickness="0"  VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Text="{Binding RobotTarget,UpdateSourceTrigger=PropertyChanged}"/>
+                        <customControls:PathButton Content="Start"  Width="80" Height="28" VerticalAlignment="Center"  Grid.Column="6" />
+
+                       
+                    </Grid>
+                    <!--</Border>-->
+                </Grid>
+            </StackPanel>
+
+        <StackPanel     Canvas.Left="980"  Canvas.Top="390" Width="340">
+
+            <Border  BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_FirstTitle}" Padding="5,1" Height="30">
+                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
+                    <Path Data="M0,0 L5,0 5,5 z" Fill="White" HorizontalAlignment="Left" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Width="5" Height="5">
+                        <Path.RenderTransform>
+                            <TransformGroup>
+                                <ScaleTransform/>
+                                <SkewTransform/>
+                                <RotateTransform Angle="45"/>
+                                <TranslateTransform/>
+                            </TransformGroup>
+                        </Path.RenderTransform>
+                    </Path>
+                    <TextBlock  Margin="5,0,0,0" Text="Aligner1 Operation" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_White}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+                </StackPanel>
+            </Border>
+            <Border   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="#D0D8E8" Height="40">
+                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
+                    <customControls:PathButton Content="Home" Width="80"  Height="33" Command="{Binding Align1HomeCommand}"/>
+                    <customControls:PathButton Content="Up"  Width="80"   Height="33" Command="{Binding Align1UpCommand}"/>
+                    <customControls:PathButton Content="Down" Width="80"  Height="33" Command="{Binding Align1DownCommand}"/>
+                    <customControls:PathButton Content="Align" Width="80" Height="33" Command="{Binding Align1AlignCommand}"/>
+                </StackPanel>
+            </Border>
+
+        </StackPanel>
+
+
     </Canvas>
+
   
 </UserControl>

+ 2 - 2
Venus/Venus_MainPages/Views/OperationOverView.xaml

@@ -42,8 +42,8 @@
 
                     <userControls:EFEM Width="600" Height="300" Canvas.Left="200" Canvas.Top="480"/>
 
-                    <customControls:WaferRobotControl OriginT="PMA"    Canvas.Left="407" Canvas.Top="470"   Width="200" Height="300"    RobotTAction="{Binding Robot3TAction}" RobotXAction="{Binding Robot3XAction}"  RobotWafer="{Binding BladeCWafer}"/>
-                    <customControls:WaferRobotControl OriginT="PMD"    Canvas.Left="407" Canvas.Top="470"   Width="200" Height="300"    RobotTAction="{Binding Robot4TAction}" RobotXAction="{Binding Robot4XAction}"  RobotWafer="{Binding BladeDWafer}"/>
+                    <customControls:WaferRobotControl OriginT="PMA"    Canvas.Left="400" Canvas.Top="473"   Width="200" Height="300"    RobotTAction="{Binding Robot3TAction}" RobotXAction="{Binding Robot3XAction}"  RobotWafer="{Binding BladeCWafer}"/>
+                    <customControls:WaferRobotControl OriginT="PMD"    Canvas.Left="400" Canvas.Top="473"   Width="200" Height="300"    RobotTAction="{Binding Robot4TAction}" RobotXAction="{Binding Robot4XAction}"  RobotWafer="{Binding BladeDWafer}"/>
                 </Canvas>
 
             </Viewbox>

+ 7 - 4
Venus/Venus_MainPages/Views/TopView.xaml

@@ -21,6 +21,9 @@
         <converters2:TMStateConverter x:Key="TMStateConverter"/>
         <converters2:LLStateConverter x:Key="LLStateConverter"/>
         <converters2:SystemStateConverter x:Key="SystemStateConverter"/>
+        <converters2:EFEMStateConverter x:Key="EFEMStateConverter"/>
+
+        
     </UserControl.Resources>
 
     <Canvas Background="{StaticResource Login_BG}">
@@ -42,10 +45,10 @@
 
 
             </Grid.ColumnDefinitions>
-            <userControls:StateTitle Title="System"  TextBoxValue="{Binding RtDataValues[SYSTEM.FsmState]}" TextBoxColor="{Binding RtDataValues[SYSTEM.FsmState],Converter={StaticResource SystemStateConverter}}" Canvas.Left="220"  Canvas.Top="5"/>
-            <userControls:StateTitle Title="EFEM"  Grid.Column="1"  TextBoxValue="{Binding RtDataValues[EFEM.FsmState]}"    Canvas.Left="520"   Canvas.Top="5"/>
-            <userControls:StateTitle Title="LLA"   Grid.Column="2"   TextBoxValue="{Binding RtDataValues[LLA.FsmState]}"    TextBoxColor="{Binding RtDataValues[LLA.FsmState],Converter={StaticResource LLStateConverter}}"  Canvas.Left="820"   Canvas.Top="5"/>
-            <userControls:StateTitle Title="LLB"   Grid.Column="3"  TextBoxValue="{Binding RtDataValues[LLB.FsmState]}"    TextBoxColor="{Binding RtDataValues[LLB.FsmState],Converter={StaticResource LLStateConverter}}"  Canvas.Left="1120"  Canvas.Top="5"/>
+            <userControls:StateTitle Title="System"  TextBoxValue="{Binding RtDataValues[SYSTEM.FsmState]}" TextBoxColor="{Binding RtDataValues[SYSTEM.FsmState],Converter={StaticResource SystemStateConverter}}" />
+            <userControls:StateTitle Title="EFEM"  Grid.Column="3"  TextBoxValue="{Binding RtDataValues[EFEM.FsmState]}" TextBoxColor="{Binding RtDataValues[EFEM.FsmState],Converter={StaticResource EFEMStateConverter}}"   Visibility="{Binding EFEMIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+            <userControls:StateTitle Title="LLA"   Grid.Column="1"   TextBoxValue="{Binding RtDataValues[LLA.FsmState]}"    TextBoxColor="{Binding RtDataValues[LLA.FsmState],Converter={StaticResource LLStateConverter}}" Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
+            <userControls:StateTitle Title="LLB"   Grid.Column="2"  TextBoxValue="{Binding RtDataValues[LLB.FsmState]}"    TextBoxColor="{Binding RtDataValues[LLB.FsmState],Converter={StaticResource LLStateConverter}}" Visibility="{Binding LLBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
 
 
             <userControls:StateTitle Title="PMA"   Grid.Column="0"  Grid.Row="1"  TextBoxValue="{Binding RtDataValues[PMA.FsmState]}"    TextBoxColor="{Binding RtDataValues[PMA.FsmState],Converter={StaticResource PMStateConverter}}"  Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />

BIN
Venus/Venus_RT/Config/PM/Venus/VenusDeviceModel.xml


+ 4 - 0
Venus/Venus_RT/Devices/EFEM/EfemBase.cs

@@ -84,6 +84,10 @@ namespace Venus_RT.Devices.EFEM
         public virtual RState Status { get; }
         public virtual RobotMoveInfo TMRobotMoveInfo { get; }
         public virtual bool IsHomed { get; }
+
+        public virtual bool LiftIsUp { get; }
+        public virtual bool LiftIsDown { get; }
+
         public abstract bool HomeAll();
         public abstract bool Home(ModuleName mod);
         public abstract bool OriginalSearch(ModuleName mod);

+ 31 - 3
Venus/Venus_RT/Devices/EFEM/JetEfem.cs

@@ -32,6 +32,8 @@ namespace Venus_RT.Devices.EFEM
         private EfemMessage _currentMsg;
         private EfemMessage _backroundMsg;
         private EfemMessage _revMsg;
+        private bool _LiftIsUp = false;
+        private bool _LiftIsDown = false;
 
         public override RState Status { get { return _status; } }
         public override bool IsHomed { get { return _IsHomed; } }
@@ -46,6 +48,12 @@ namespace Venus_RT.Devices.EFEM
                 return _LPMs[mod - ModuleName.LP1];
             }
         }
+
+        public override bool LiftIsUp { get { return _LiftIsUp; } }
+        public override bool LiftIsDown { get { return _LiftIsDown; } }
+
+
+
         public JetEfem()
         {
             _socket = new AsyncSocket("");
@@ -68,9 +76,11 @@ namespace Venus_RT.Devices.EFEM
                     WaferManager.Instance.SubscribeLocation(module, waferCount);
                 }
             };
+            WaferManager.Instance.SubscribeLocation(ModuleName.EfemRobot, 2);
+            WaferManager.Instance.SubscribeLocation(ModuleName.Aligner1, 1);
 
-            _subscribeLoc(ModuleName.EfemRobot, 2);
-            _subscribeLoc(ModuleName.Aligner1, 1);
+            // _subscribeLoc(ModuleName.EfemRobot, 2);
+            //_subscribeLoc(ModuleName.Aligner1, 1);
             _subscribeLoc(ModuleName.Aligner2, 1);
             _subscribeLoc(ModuleName.Cooling1, 1);
             _subscribeLoc(ModuleName.Cooling2, 1);
@@ -833,7 +843,25 @@ namespace Venus_RT.Devices.EFEM
                     {
                         Singleton<RouteManager>.Instance.EFEM.PostMsg(EfemEntity.MSG.CommReady);
                     }
-                    break; 
+                    break;
+
+                case EfemOperation.Lift:
+                    {
+                        if (_currentMsg.Parameters[1] == "UP")
+                        {
+                            _LiftIsUp = true;
+                            _LiftIsDown = false;
+                            _status = RState.End;
+
+                        }
+                        else if (_currentMsg.Parameters[1] == "DOWN")
+                        {
+                            _LiftIsUp = false;
+                            _LiftIsDown = true;
+                            _status = RState.End;
+                        }
+                    }
+                    break;
             }
         }
 

+ 2 - 2
Venus/Venus_RT/Devices/EPD/EPDClient.cs

@@ -38,8 +38,8 @@ namespace Venus_RT.Devices.EPD
         private List<string> _cfgFileList;
         public override List<string> CFGFileList { get { return _cfgFileList; }  }
 
-        public new string Module { get; set; }
-        public new string Name { get; set; }
+        //public new string Module { get; set; }
+        //public new string Name { get; set; }
         public string EPDVersion { get; private set; }
         public string EPDState { get; private set; }
         public string SensorStatus { get; private set; }

+ 4 - 0
Venus/Venus_RT/Devices/ESC5HighVoltage.cs

@@ -318,6 +318,10 @@ namespace Venus_RT.Devices
 
         public bool SetOutputVoltage(int voltage)
         {
+            if (voltage > 0)
+            {
+                SetPowerOnOff(true);
+            }
             return SendCommand(Operation.SetOutputVoltage, voltage);
         }
 

+ 18 - 1
Venus/Venus_RT/Devices/IODevices/IoBacksideHe.cs

@@ -16,6 +16,10 @@ namespace Venus_RT.Devices
     {
         private readonly MfcBase1 _mfc;
         private readonly IoValve _DownValve;
+        private readonly IoValve _UpValve;
+        private readonly IoValve _Up2Valve;
+
+
         private AOAccessor _aoPressure;
         private AOAccessor _aoCtrlMode;
         private eEvent _lastEvent;
@@ -34,7 +38,11 @@ namespace Venus_RT.Devices
             base.DeviceID = node.GetAttribute("schematicId");
 
             _DownValve  = ParseDeviceNode<IoValve>(Module, "downvalve", node);
-            _mfc        = ParseDeviceNode<MfcBase1>(Module, "mfc", node);
+            _UpValve = ParseDeviceNode<IoValve>(Module, "upvalve", node);
+            _Up2Valve = ParseDeviceNode<IoValve>(Module, "up2valve", node);
+
+
+            _mfc = ParseDeviceNode<MfcBase1>(Module, "mfc", node);
             _aoPressure = ParseAoNode("aoPressureSP", node, ioModule);
             _aoCtrlMode = ParseAoNode("aoControlMode", node, ioModule);
         }
@@ -79,11 +87,20 @@ namespace Venus_RT.Devices
             if (mTorr >= 0.01)
             {
                 _DownValve.TurnValve(true, out _);
+                _UpValve.TurnValve(true, out _);
+                _Up2Valve.TurnValve(true, out _);
+
+
+
                 //this.FlowSP = setpoint;
             }
             else
             {
                 _DownValve.TurnValve(false, out _);
+                _UpValve.TurnValve(false, out _);
+                _Up2Valve.TurnValve(false, out _);
+
+
             }
             SetESCHeControlMode(true);
             return true;

+ 24 - 8
Venus/Venus_RT/Modules/EFEM/EfemEntity.cs

@@ -131,6 +131,7 @@ namespace Venus_RT.Modules
         private readonly EfemPlaceRoutine _placeRoutine;
         private readonly EfemSwapRoutine _swapRoutine;
         private readonly EfemHomeRoutine _homeRoutine;
+        private string LiftMessage;
 
         // Constructor
         //
@@ -173,8 +174,10 @@ namespace Venus_RT.Modules
             OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.TurnOffBuzzer}",    (cmd, args) => { PostMsg(MSG.TurnOffBuzzer); return true; });
             //OP.Subscribe($"{ModuleName.EFEM}.{EfemOperation.SwitchOnBuzzerAndRed}", (cmd, args) => { PostMsg(MSG.SwitchOnBuzzerAndRed); return true; });
             OP.Subscribe($"{ModuleName.EFEM}.Online",                           (cmd, args) => { PostMsg(MSG.Online); return true; });
-            OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Pick}",        (cmd, args) => { PostMsg(MSG.Pick, args[0], args[1], args[3], args[2]); return true; });
-            OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Place}",       (cmd, args) => { PostMsg(MSG.Place, args[0], args[1], args[3], args[2]); return true; });
+            OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Pick}",        (cmd, args) => { PostMsg(MSG.Pick, args[0]); return true; });
+            OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Place}",       (cmd, args) => { PostMsg(MSG.Place, args[0]); return true; });
+            OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Swap}",        (cmd, args) => { PostMsg(MSG.Swap, args[0]); return true; });
+
             OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Abort}",       (cmd, args) => { PostMsg(MSG.Abort); return true; });
             OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Home}",        (cmd, args) => { PostMsg(MSG.HomeRB); return true; });
             OP.Subscribe($"{ModuleName.EfemRobot}.{EfemOperation.Grip}",        (cmd, args) =>
@@ -196,14 +199,14 @@ namespace Venus_RT.Modules
             OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Align}",    (cmd, args) => { PostMsg(MSG.Align, ModuleName.Aligner2, args[0]); return true; });
             OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Align}",    (cmd, args) => { PostMsg(MSG.Align, ModuleName.Cooling1, args[0]); return true; });
             OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Align}",    (cmd, args) => { PostMsg(MSG.Align, ModuleName.Cooling2, args[0]); return true; });
-            OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Lift}",     (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner1); return true; });
+            OP.Subscribe($"{ModuleName.Aligner1}.{EfemOperation.Lift}",     (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner1, args[0]); return true; });
             OP.Subscribe($"{ModuleName.Aligner2}.{EfemOperation.Lift}",     (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Aligner2); return true; });
             OP.Subscribe($"{ModuleName.Cooling1}.{EfemOperation.Lift}",     (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Cooling1); return true; });
             OP.Subscribe($"{ModuleName.Cooling2}.{EfemOperation.Lift}",     (cmd, args) => { PostMsg(MSG.Lift, ModuleName.Cooling2); return true; });
 
-            DATA.Subscribe($"{Name}.FsmState",          () => ((STATE)fsm.State).ToString());
-            DATA.Subscribe($"{Name}.FsmPrevState",      () => ((STATE)fsm.PrevState).ToString());
-            DATA.Subscribe($"{Name}.FsmLastMessage",    GetFsmLastMessage);
+            DATA.Subscribe($"{Name}.FsmState", () => ((STATE)fsm.State).ToString());
+            DATA.Subscribe($"{Name}.FsmPrevState", () => ((STATE)fsm.PrevState).ToString());
+            DATA.Subscribe($"{Name}.FsmLastMessage", GetFsmLastMessage);
 
             return true;
         }
@@ -276,7 +279,8 @@ namespace Venus_RT.Modules
 
             // Aligner
             Transition(STATE.Idle,          MSG.Lift,               fnLift,             STATE.Lifting);
-            Transition(STATE.Lifting,       MSG.LiftActionDone,     fnActionDone,       STATE.Idle);
+            //Transition(STATE.Lifting,       MSG.LiftActionDone,     fnActionDone,       STATE.Idle);
+            Transition(STATE.Lifting,       FSM_MSG.TIMER,          fnLiftTimeout,    STATE.Idle);
             Transition(STATE.Idle,          MSG.Align,              fnAlign,            STATE.Aligning);
             Transition(STATE.Aligning,      MSG.ActionDone,         fnActionDone,       STATE.Idle);
 
@@ -508,7 +512,6 @@ namespace Venus_RT.Modules
                 throw new ArgumentException("Argument error");
 
             bool isUp = true;
-
             if (param.Length > 1)
             {
                 isUp = (bool) param[1];
@@ -524,10 +527,23 @@ namespace Venus_RT.Modules
                 if (!_efem.SetPinDown(unit))
                     return false;
             }
+            LiftMessage = isUp ? "Up" : "Down";
 
             return true;
         }
+        private bool fnLiftTimeout(object[] param)
+        {
+            if (LiftMessage == "Up")
+            {
+                return _efem.LiftIsDown == false && _efem.LiftIsUp == true;
+            }
+            else if (LiftMessage == "Down")
+            { 
+                return _efem.LiftIsDown == true && _efem.LiftIsUp == false;
 
+            }
+            return false;
+        }
         private bool fnAlign(object[] param)
         {
             // module

+ 3 - 1
Venus/Venus_RT/Modules/PMs/ProcessDefine.cs

@@ -270,8 +270,10 @@ namespace Venus_RT.Modules.PMs
         private RState ESCHVUnit_Start(ProcessUnitBase unit, RecipeStep step)
         {
             var ProcessUnit = unit as ESCHVUnit;
+            
             Chamber.SetESCClampVoltage(ProcessUnit.ESCClampValtage);
-            Chamber.SetBacksideHePressure(ProcessUnit.BacksideHelum * 1000);
+
+            Chamber.SetBacksideHePressure(ProcessUnit.BacksideHelum);
             Chamber.SetBacksideHeThreshold(ProcessUnit.MinHeFlow, ProcessUnit.MaxHeFlow);
             return RState.Running;
         }

+ 5 - 2
Venus/Venus_Themes/UserControls/EFEM.xaml

@@ -4,8 +4,9 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:Venus_Themes.UserControls"
+             xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
              mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+             d:DesignHeight="450" d:DesignWidth="800" Name="efem">
     <Viewbox Stretch="Fill">
    
         <Border BorderThickness="0" BorderBrush="Gray">
@@ -59,8 +60,10 @@
                         </Canvas>
                     </Canvas>
                 </Viewbox>
+                <Viewbox Width="180" Height="180"  Canvas.Left="50" Canvas.Top="70">
+                    <local:WaferCtrl WaferData="{Binding ElementName=efem, Path=ZuoShangWafer}"/>
+                </Viewbox>
 
-               
 
 
                 <local:Loadport Canvas.Left="10"  Canvas.Top="610" Width="300" Height="300"/>

+ 8 - 7
Venus/Venus_Themes/UserControls/EFEM.xaml.cs

@@ -5,13 +5,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
+using OpenSEMI.ClientBase;
 
 namespace Venus_Themes.UserControls
 {
@@ -24,5 +18,12 @@ namespace Venus_Themes.UserControls
         {
             InitializeComponent();
         }
+        public static readonly DependencyProperty ZuoShangWaferProperty = DependencyProperty.Register(
+     "ZuoShangWafer", typeof(WaferInfo), typeof(EFEM));
+        public WaferInfo ZuoShangWafer
+        {
+            get => (WaferInfo)GetValue(ZuoShangWaferProperty);
+            set => SetValue(ZuoShangWaferProperty, value);
+        }
     }
 }