Browse Source

1.优化UI界面性能
2.pump 开关功能放在配置文件
3.优化Counter功能
4.去除编译过程异常

lixiang 10 months ago
parent
commit
e29f6e8e46
31 changed files with 713 additions and 402 deletions
  1. 1 1
      Venus/Framework/Common/DataCenter/StatsDataManager.cs
  2. 115 12
      Venus/Framework/Common/DataCollection/DataCollectionManager.cs
  3. 49 0
      Venus/Venus_MainPages/ViewModels/DataHistoryViewModel.cs
  4. 4 4
      Venus/Venus_MainPages/ViewModels/EventViewModel.cs
  5. 71 16
      Venus/Venus_MainPages/ViewModels/OperationOverViewModel.cs
  6. 9 1
      Venus/Venus_MainPages/ViewModels/OverKepler2200AViewModel.cs
  7. 9 1
      Venus/Venus_MainPages/ViewModels/OverKepler2200BViewModel.cs
  8. 1 1
      Venus/Venus_MainPages/ViewModels/PartialPressureViewModel.cs
  9. 101 17
      Venus/Venus_MainPages/ViewModels/ProcessHistoryViewModel.cs
  10. 18 100
      Venus/Venus_MainPages/ViewModels/StatisticsViewModel.cs
  11. 0 3
      Venus/Venus_MainPages/ViewModels/TMOperationViewModel.cs
  12. 64 48
      Venus/Venus_MainPages/ViewModels/TMViewModel.cs
  13. 66 12
      Venus/Venus_MainPages/ViewModels/TopViewModel.cs
  14. 5 3
      Venus/Venus_MainPages/Views/DataHistoryView.xaml
  15. 10 10
      Venus/Venus_MainPages/Views/OperationOverView.xaml
  16. 7 1
      Venus/Venus_MainPages/Views/OverKepler2200AView.xaml
  17. 7 1
      Venus/Venus_MainPages/Views/OverKepler2200BView.xaml
  18. 3 3
      Venus/Venus_MainPages/Views/ProcessHistoryView.xaml
  19. 117 118
      Venus/Venus_MainPages/Views/ProcessHistoryView.xaml.cs
  20. 6 6
      Venus/Venus_MainPages/Views/StatisticsView.xaml
  21. 1 1
      Venus/Venus_MainPages/Views/TMOperationView.xaml
  22. 24 17
      Venus/Venus_MainPages/Views/TopView.xaml
  23. 2 14
      Venus/Venus_MainPages/Views/TopView.xaml.cs
  24. 9 0
      Venus/Venus_RT/Config/System_Kepler2200.sccfg
  25. 2 2
      Venus/Venus_RT/Devices/AdTecRF.cs
  26. 4 2
      Venus/Venus_RT/Modules/PMs/PMEntity.cs
  27. 3 3
      Venus/Venus_Themes/Styles/CustomWindowStyle.xaml
  28. 1 1
      Venus/Venus_Themes/UserControls/Chamber.xaml
  29. 2 2
      Venus/Venus_Themes/UserControls/ChamberWithHeater.xaml
  30. 1 1
      Venus/Venus_Themes/UserControls/WPFMessageBox.xaml
  31. 1 1
      Venus/Venus_UI/Views/ShellView.xaml.cs

+ 1 - 1
Venus/Framework/Common/DataCenter/StatsDataManager.cs

@@ -259,7 +259,7 @@ namespace MECF.Framework.Common.DataCenter
                 DB.Insert(sql);
 
                 EV.PostInfoLog("System", $"{name} stats warning value changed from {preValue} to {value}");
-
+                
                 return preValue;
             }
         }

+ 115 - 12
Venus/Framework/Common/DataCollection/DataCollectionManager.cs

@@ -14,6 +14,7 @@ using Aitex.Core.RT.DataCenter;
 using System.Collections.Concurrent;
 using MECF.Framework.Common.Communications;
 using Aitex.Core.RT.SCCore;
+using System.Threading.Tasks;
 
 namespace Aitex.Core.RT.DataCollection
 {
@@ -268,7 +269,6 @@ namespace Aitex.Core.RT.DataCollection
                     StringBuilder sb = new StringBuilder(10000);
                     while (_bAlive)
                     {
-                        //Thread.Sleep(990);
                         Thread.Sleep((int)(dataCollectionInterval * 0.99)); //for time delay in sleep function
                         foreach (var module in _modules)
                         {
@@ -318,14 +318,6 @@ namespace Aitex.Core.RT.DataCollection
 
                                 Connect();
                             }
-
-                            //try
-                            //{
-                            //}
-                            //catch (Exception ex)
-                            //{
-                            //    LOG.WriteExeption("数据记录发生异常" + moduleInsertSql[module], ex);
-                            //}
                         }
 
                         //if alert to another day, create a new table 
@@ -348,10 +340,121 @@ namespace Aitex.Core.RT.DataCollection
                 }
             }
         }
+        public void ManualInsertData()
+        {
+            Task.Run(() => 
+            {
+            try
+            {
+                var moduleDataItem = new Dictionary<string, Dictionary<string, Func<object>>>();
+                var moduleInsertSql = new Dictionary<string, string>();
+
+                foreach (var module in _modules)
+                {
+                    moduleDataItem[module] = new Dictionary<string, Func<object>>();
+                }
+
+                string defaultModule = _modules.Contains("System") ? "System" : (_modules.Contains("Data") ? "Data" : (_modules[0]));
+                if (_subscribedRecordedData.Count > 0)
+                {
+                    lock (_lock)
+                    {
+                        bool foundModule;
+                        foreach (var dataName in _subscribedRecordedData.Keys)
+                        {
+                            foundModule = false;
+                            foreach (var module in _modules)
+                            {
+                                if (dataName.StartsWith(module + "."))
+                                {
+                                    moduleDataItem[module][dataName] = _subscribedRecordedData[dataName];
+                                    foundModule = true;
+                                    break;
+                                }
+                            }
+
+                            if (!foundModule)
+                            {
+                                moduleDataItem[defaultModule][dataName] = _subscribedRecordedData[dataName];
+                            }
+                        }
+                        _preSubscribedRecordedData.Clear();
+                    }
+                }
+
+                DateTime dtToday = DateTime.Now.Date;
+
+                foreach (var module in _modules)
+                {
+                    string tableName = $"{dtToday:yyyyMMdd}.{module}";
+                    UpdateTableSchema(tableName, moduleDataItem[module]);
+
+                    string preCreatedInsertSQL = string.Format("INSERT INTO \"{0}\"(\"time\" ", tableName);
+                    foreach (var dataName in moduleDataItem[module].Keys)
+                    {
+                        preCreatedInsertSQL += string.Format(",\"{0}\"", dataName);
+                    }
+                    preCreatedInsertSQL += ")";
+                    moduleInsertSql[module] = preCreatedInsertSQL;
+                }
+                StringBuilder sb = new StringBuilder(10000);
+
+                foreach (var module in _modules)
+                {
+                    sb.Remove(0, sb.Length);
+                    sb.Append("Values(");
+                    sb.Append(DateTime.Now.Ticks.ToString());
+                    foreach (var dataName in moduleDataItem[module].Keys)
+                    {
+                        sb.Append(",");
+                        var v1 = moduleDataItem[module][dataName].Invoke();
+                        if (v1 == null)
+                        {
+                            sb.Append("0");
+                        }
+                        else
+                        {
+                            if (v1 is double || v1 is float)
+                            {
+                                double v2 = Convert.ToDouble(v1);
+                                if (double.IsNaN(v2))
+                                    v2 = 0;
+                                sb.Append(v2.ToString());
+                            }
+                            else
+                            {
+                                sb.Append(v1.ToString());
+                            }
+                        }
+                    }
+
+                    sb.Append(");");
+
+                    try
+                    {
+                        if (_conn.State == System.Data.ConnectionState.Open)
+                        {
+                            NpgsqlCommand cmd = new NpgsqlCommand(moduleInsertSql[module] + sb.ToString(), _conn);
+                            cmd.ExecuteNonQuery();
+                        }
+                        else
+                        {
+                            Connect();
+                        }
+                    }
+                    catch
+                    {
+
+                        Connect();
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                LOG.WriteExeption("数据库操作记录发生异常", ex);
+            }
 
-        public void InserData()
-        { 
-        
+            });
         }
         private string UpdateTableSchema(string tblName, Dictionary<string, Func<object>> dataItem)
         {

+ 49 - 0
Venus/Venus_MainPages/ViewModels/DataHistoryViewModel.cs

@@ -148,6 +148,10 @@ namespace Venus_MainPages.ViewModels
         private DelegateCommand _StopRealTimeCommand;
         public DelegateCommand StopRealTimeCommand =>
             _StopRealTimeCommand ?? (_StopRealTimeCommand = new DelegateCommand(OnStopRealTime));
+
+        private DelegateCommand _ExportCommand;
+        public DelegateCommand ExportCommand =>
+            _ExportCommand ?? (_ExportCommand = new DelegateCommand(OnExport));
         #endregion
 
         #region 构造函数
@@ -377,6 +381,51 @@ namespace Venus_MainPages.ViewModels
             Keys.Clear();
             this.DataHistoryView.MyDrawGraphicsControl.InitPens();
         }
+
+        private void OnExport()
+        {
+            Task.Run(() => 
+            {
+            try
+            {
+               
+                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+                dlg.DefaultExt = ".xls"; // Default file extension 
+                dlg.Filter = "数据表格文件|*.xls"; // Filter files by extension 
+                
+                Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
+                if (result != true) // Process open file dialog box results
+                    return;
+
+                System.Data.DataSet ds = new System.Data.DataSet();
+                ds.Tables.Add(new System.Data.DataTable("Data"));
+                //var item = ProcessData;
+                ds.Tables[0].Columns.Add("Name");
+                ds.Tables[0].Columns.Add("Time");
+                ds.Tables[0].Columns.Add("Value");
+                var result2 = GetData(Keys.Distinct().ToList(), this.DataHistoryView.wfTimeFrom.Value, this.DataHistoryView.wfTimeTo.Value);
+                foreach (var item in result2.Values)
+                {
+                    item.ForEach(x => 
+                    {
+                        var row = ds.Tables[0].NewRow();
+                        row[0] = x.dbName;
+                        row[1] = x.dateTime;
+                        row[2] = x.value;
+
+                        ds.Tables[0].Rows.Add(row);
+                    });
+                    
+
+                }
+                ds.WriteXml(dlg.FileName);
+            }
+            catch (Exception ex)
+            {
+                WPFMessageBox.ShowError($"导出系统日志发生错误{ex.Message}");
+            }
+            });
+        }
         #endregion
 
         #region 私有方法

+ 4 - 4
Venus/Venus_MainPages/ViewModels/EventViewModel.cs

@@ -248,8 +248,8 @@ namespace Venus_MainPages.ViewModels
                     ds.Tables.Add(new System.Data.DataTable("系统运行日志"));
                     ds.Tables[0].Columns.Add("类型");
                     ds.Tables[0].Columns.Add("时间");
-                    ds.Tables[0].Columns.Add("腔体");
-                    ds.Tables[0].Columns.Add("发起源");
+                    ds.Tables[0].Columns.Add("模块");
+                    //ds.Tables[0].Columns.Add("发起源");
                     ds.Tables[0].Columns.Add("内容描述");
                     foreach (var item in SearchedResult)
                     {
@@ -257,8 +257,8 @@ namespace Venus_MainPages.ViewModels
                         row[0] = item.LogType;
                         row[1] = item.Time;
                         row[2] = item.TargetChamber;
-                        row[3] = item.Initiator;
-                        row[4] = item.Detail;
+                        //row[2] = item.Initiator;
+                        row[3] = item.Detail;
                         ds.Tables[0].Rows.Add(row);
                     }
                     ds.WriteXml(dlg.FileName);

+ 71 - 16
Venus/Venus_MainPages/ViewModels/OperationOverViewModel.cs

@@ -1,8 +1,6 @@
 using Aitex.Core.RT.Log;
-using ExcelLibrary.BinaryFileFormat;
 using MECF.Framework.Common.CommonData;
 using MECF.Framework.Common.DataCenter;
-using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.Jobs;
 using MECF.Framework.Common.OperationCenter;
 using OpenSEMI.ClientBase;
@@ -12,14 +10,11 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
-using System.Windows;
 using System.Windows.Threading;
 using Venus_Core;
 using Venus_MainPages.Unity;
 using Venus_MainPages.Views;
-using Venus_Themes.CustomControls;
 using static Venus_Core.NiceRobotAction;
-//using static Venus_Themes.UserControls.EFEM;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -125,6 +120,7 @@ namespace Venus_MainPages.ViewModels
         private bool m_LP2Loaded;
         private bool m_LP3Loaded;
 
+        private OperationOverView m_View;
         #endregion
 
         #region  属性
@@ -132,37 +128,37 @@ namespace Venus_MainPages.ViewModels
         public bool LP1Loaded
         {
             get { return m_LP1Loaded; }
-            set 
+            set
             {
                 if (m_LP1Loaded != value)
                 {
                     InvokeClient.Instance.Service.DoOperation($"LP1.ReadCarrierId");
                 }
-                SetProperty(ref m_LP1Loaded, value); 
+                SetProperty(ref m_LP1Loaded, value);
             }
         }
         public bool LP2Loaded
         {
             get { return m_LP2Loaded; }
-            set 
+            set
             {
                 if (m_LP2Loaded != value)
                 {
                     InvokeClient.Instance.Service.DoOperation($"LP2.ReadCarrierId");
                 }
-                SetProperty(ref m_LP2Loaded, value); 
+                SetProperty(ref m_LP2Loaded, value);
             }
         }
         public bool LP3Loaded
         {
             get { return m_LP3Loaded; }
-            set 
+            set
             {
                 if (m_LP3Loaded != value)
                 {
                     InvokeClient.Instance.Service.DoOperation($"LP3.ReadCarrierId");
                 }
-                SetProperty(ref m_LP3Loaded, value); 
+                SetProperty(ref m_LP3Loaded, value);
             }
         }
         public string PMAChamberType
@@ -682,7 +678,7 @@ namespace Venus_MainPages.ViewModels
             _GotFocusCommand ?? (_GotFocusCommand = new DelegateCommand(OnGotFocus));
 
 
-        public bool SwitchFlag;
+        public bool m_firstLoadFlag = true;
 
         #endregion
 
@@ -723,7 +719,6 @@ namespace Venus_MainPages.ViewModels
             {
                 PMDChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMD.ChamberType")).ToString().Substring(6);
             }
-            SwitchFlag = false;
 
             ATMModeIsOn = Convert.ToBoolean(QueryDataClient.Instance.Service.GetConfig("System.IsATMMode"));
 
@@ -736,18 +731,78 @@ namespace Venus_MainPages.ViewModels
         #region 命令方法
         private void OnLoad(object obj)
         {
-            if (!SwitchFlag)
+            if (m_firstLoadFlag)
             {
-                //var t = (obj as OperationOverView);
+                m_View = (obj as OperationOverView);
                 LP1WaferAssociation = new WaferAssociationInfo();
                 LP3WaferAssociation = new WaferAssociationInfo();
                 LP2WaferAssociation = new WaferAssociationInfo();
                 LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
                 LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
                 LP3WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP3"];
-                SwitchFlag = true;
+                m_firstLoadFlag = false;
 
                 PressureType = (PressureType)Convert.ToInt32(QueryDataClient.Instance.Service.GetData("System.PressureUnitType"));
+                if (!PMAIsInstalled)
+                {
+                    m_View.moduleCanvas.Children.Remove(m_View.pmaChamber);
+                    m_View.pmaChamber = null;
+
+                    m_View.operationCanvas.Children.Remove(m_View.pmaGrid);
+                    for (int i = 0; i < m_View.pmaGrid.Children.Count; i++)
+                    {
+                        m_View.pmaGrid.Children[i] = null;
+                    }
+                    m_View.pmaGrid.Children.Clear();
+
+                    m_View.pmaGrid = null;
+                }
+                if (!PMBIsInstalled)
+                {
+                    m_View.moduleCanvas.Children.Remove(m_View.pmbChamber);
+                    m_View.pmbChamber = null;
+
+                    m_View.operationCanvas.Children.Remove(m_View.pmbGrid);
+
+                    for (int i = 0; i < m_View.pmbGrid.Children.Count; i++)
+                    {
+                        m_View.pmbGrid.Children[i] = null;
+                    }
+                    m_View.pmbGrid.Children.Clear();
+
+
+                    m_View.pmbGrid = null;
+                }
+                if (!PMCIsInstalled)
+                {
+                    m_View.moduleCanvas.Children.Remove(m_View.pmcChamber);
+                    m_View.pmcChamber = null;
+                    m_View.operationCanvas.Children.Remove(m_View.pmcGrid);
+
+                    for (int i = 0; i < m_View.pmcGrid.Children.Count; i++)
+                    {
+                        var item = m_View.pmcGrid.Children[i];
+                        item = null;
+                    }
+                    m_View.pmcGrid.Children.Clear();
+                    m_View.pmcGrid = null;
+                }
+                if (!PMDIsInstalled)
+                {
+                    m_View.moduleCanvas.Children.Remove(m_View.pmdChamber);
+                    m_View.pmdChamber = null;
+                    m_View.operationCanvas.Children.Remove(m_View.pmdGrid);
+                    for (int i = 0; i < m_View.pmdGrid.Children.Count; i++)
+                    {
+                       var item= m_View.pmdGrid.Children[i];
+                        item = null;
+                    }
+                    m_View.pmdGrid.Children.Clear();
+                    m_View.pmdGrid = null;
+                }
+                GC.Collect(); // This should pick up the control removed at a previous MouseDown
+                GC.WaitForPendingFinalizers(); // Doesn't help either
+
             }
 
         }

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

@@ -224,9 +224,15 @@ namespace Venus_MainPages.ViewModels
         //private bool m_IsUpdateChamber;
 
         private ChamberInfo m_ChamberInfo;
+        private bool m_IsEnablePumpSwitch=false;
         #endregion
 
         #region  属性
+        public bool IsEnablePumpSwitch
+        {
+            get { return m_IsEnablePumpSwitch; }
+            set { SetProperty(ref m_IsEnablePumpSwitch, value); }
+        }
         public ChamberInfo ChamberInfo
         {
             get { return m_ChamberInfo; }
@@ -1903,7 +1909,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.IsLidClosed");
 
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Rf}.DeviceData");
-            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasRf}.DeviceData");
+            //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasRf}.DeviceData");
 
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.DeviceData");
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.RFBox}.DeviceData");
@@ -1975,6 +1981,8 @@ namespace Venus_MainPages.ViewModels
                 MFC7IsEnable = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable"));
                 MFC8IsEnable = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable"));
                 PVHeaterIsEnbale = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.PendulumHeater.IsOn"));
+
+                IsEnablePumpSwitch= (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.DryPump.EnableSwitch"));
             }
             else
             {

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

@@ -223,10 +223,16 @@ namespace Venus_MainPages.ViewModels
 
         //private bool m_IsUpdateChamber;
         private ChamberInfo m_ChamberInfo;
+        private bool m_IsEnablePumpSwitch = false;
 
         #endregion
 
         #region  属性
+        public bool IsEnablePumpSwitch
+        {
+            get { return m_IsEnablePumpSwitch; }
+            set { SetProperty(ref m_IsEnablePumpSwitch, value); }
+        }
         public ChamberInfo ChamberInfo
         {
             get { return m_ChamberInfo; }
@@ -1906,7 +1912,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.IsLidClosed");
 
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Rf}.DeviceData");
-            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasRf}.DeviceData");
+            //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasRf}.DeviceData");
 
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.DeviceData");
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.RFBox}.DeviceData");
@@ -1977,6 +1983,8 @@ namespace Venus_MainPages.ViewModels
                 MFC7IsEnable = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable"));
                 MFC8IsEnable = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable"));
                 PVHeaterIsEnbale = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.PendulumHeater.IsOn"));
+                IsEnablePumpSwitch = (bool)(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.DryPump.EnableSwitch"));
+
             }
             else
             {

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

@@ -176,7 +176,7 @@ namespace Venus_MainPages.ViewModels
         {
             CurrentGasFlows.Clear();
             GasFlows.Clear();
-            value = $"MfcGas{obj.ToString()}";
+            value = $"MfcGas{obj}";
             maxScale= Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{value}.MfcN2Scale"));
             var xishu = Convert.ToDouble(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{value}.MfcScaleFactor"));
             GasName = QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{value}.GasName").ToString();

+ 101 - 17
Venus/Venus_MainPages/ViewModels/ProcessHistoryViewModel.cs

@@ -4,9 +4,6 @@ using System.Collections.Generic;
 using System.Data;
 using System.Windows.Media;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Venus_Core;
 using Prism.Commands;
 using Prism.Mvvm;
 using Venus_MainPages.Unity;
@@ -18,22 +15,12 @@ using Aitex.Core.RT.Log;
 using Aitex.Core.UI.ControlDataContext;
 using WPF.Themes.UserControls;
 using System.IO;
-using System.Diagnostics;
-using Aitex.Core.RT.Routine;
-using System.Xml.Linq;
-using System.Windows.Forms;
-using ExcelLibrary.BinaryFileFormat;
-using Aitex.Core.UI.View.Common;
-using Aitex.Core.RT.DataCenter;
-using System.Xml;
-using System.Security.Cryptography.X509Certificates;
-using System.Reflection;
 using Newtonsoft.Json;
-using Venus_Themes.UserControls;
-using Aitex.Core.UI.Control;
-using System.Windows.Annotations;
 using System.Runtime.Serialization;
-using static System.Net.Mime.MediaTypeNames;
+using Microsoft.VisualBasic.Logging;
+using ExcelLibrary.BinaryFileFormat;
+using ExcelLibrary.SpreadSheet;
+using Venus_Themes.UserControls;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -140,6 +127,14 @@ namespace Venus_MainPages.ViewModels
         _ClearDataCommand ?? (_ClearDataCommand = new DelegateCommand(OnClearData));
 
 
+        //private DelegateCommand _ExportRecipesCommand;
+        //public DelegateCommand ExportRecipesCommand =>
+        //_ExportRecipesCommand ?? (_ExportRecipesCommand = new DelegateCommand(OnExportRecipes));
+
+
+        private DelegateCommand _RecipeDataExportCommand;
+        public DelegateCommand RecipeDataExportCommand =>
+        _RecipeDataExportCommand ?? (_RecipeDataExportCommand = new DelegateCommand(OnExportRecipeData));
         #endregion
 
         #region 构造函数
@@ -169,6 +164,7 @@ namespace Venus_MainPages.ViewModels
         {
             if (m_FirstLoadFlag)
             {
+                m_FirstLoadFlag = false;
                 this.view = (ProcessHistoryView)eventView;
                 this.view.wfTimeFrom.Value = DateTime.Today;
                 this.view.wfTimeTo.Value = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59, 999);
@@ -748,6 +744,94 @@ namespace Venus_MainPages.ViewModels
                 this.view.MyDrawGraphicsControl.m_PenCollencteions[i] = new System.Drawing.Pen(System.Drawing.Color.FromArgb(_color.A, _color.R, _color.G, _color.B), 2);
             }
         }
+
+        //private void OnExportRecipes()
+        //{
+        //    try
+        //    {
+        //        Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+        //        dlg.DefaultExt = ".xls"; // Default file extension 
+        //        dlg.Filter = "Excel数据表格文件(*.xls)|*.xls"; // Filter files by extension 
+        //        Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
+        //        if (result == true) // Process open file dialog box results
+        //        {
+        //            System.Data.DataSet ds = new System.Data.DataSet();
+        //            ds.Tables.Add(new System.Data.DataTable("Recipes"));
+        //            ds.Tables[0].Columns.Add("Start");
+        //            ds.Tables[0].Columns.Add("End");
+        //            ds.Tables[0].Columns.Add("Chamber");
+        //            ds.Tables[0].Columns.Add("Guid");
+        //            ds.Tables[0].Columns.Add("WaferID");
+        //            ds.Tables[0].Columns.Add("Recipe");
+        //            ds.Tables[0].Columns.Add("Status");
+
+
+        //            foreach (var item in Recipes)
+        //            {
+        //                var row = ds.Tables[0].NewRow();
+        //                row[0] = item.StartTime;
+        //                row[1] = item.EndTime;
+        //                row[2] = item.Chamber;
+        //                row[3] = item.Guid;
+        //                row[4] = item.LotID;
+        //                row[5] = item.Recipe;
+        //                row[6] = item.Status;
+
+
+        //                ds.Tables[0].Rows.Add(row);
+        //            }
+        //            ds.WriteXml(dlg.FileName);
+        //        }
+        //    }
+        //    catch
+        //    {
+        //        MessageBox.Show("导出系统日志发生错误", "导出失败", MessageBoxButton.OK, MessageBoxImage.Warning);
+        //    }
+        //}
+
+        private void OnExportRecipeData()
+        {
+            try
+            {
+                RecipeItem log = (this.view.dataGrid_RecipeList.SelectedItem) as RecipeItem;
+                if (log == null)
+                {
+                    WPFMessageBox.ShowError("没有数据,先从列表中选择一个批次");
+                    return;
+                }
+                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+                dlg.DefaultExt = ".xls"; // Default file extension 
+                dlg.Filter = "数据表格文件|*.xls"; // Filter files by extension 
+                dlg.FileName = string.Format("{0}-{1}", StartDateTime.ToString("yyyyMMdd"), log.Recipe.Replace(" ", "").Replace("/", ""));
+                Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
+                if (result != true) // Process open file dialog box results
+                    return;
+
+                System.Data.DataSet ds = new System.Data.DataSet();
+                ds.Tables.Add(new System.Data.DataTable("RecipeData"));
+                //var item = ProcessData;
+                ds.Tables[0].Columns.Add("Name");
+                ds.Tables[0].Columns.Add("Time");
+                ds.Tables[0].Columns.Add("Value");
+                foreach (var item in ProcessData)
+                {
+
+                    var row = ds.Tables[0].NewRow();
+                    row[0] = item.dbName;
+                    row[1] = item.dateTime;
+                    row[2] = item.value;
+
+                    ds.Tables[0].Rows.Add(row);
+
+                }
+                ds.WriteXml(dlg.FileName);
+            }
+            catch (Exception ex)
+            {
+                WPFMessageBox.ShowError($"导出系统日志发生错误{ex.Message}");
+            }
+        }
+
     }
     #endregion
 

+ 18 - 100
Venus/Venus_MainPages/ViewModels/StatisticsViewModel.cs

@@ -3,22 +3,14 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Data;
 using System.Linq;
-using System.Windows;
-using System.Windows.Data;
 using Aitex.Core.RT.Log;
-using Aitex.Core.Util;
 using Prism.Commands;
 using Prism.Mvvm;
-using MECF.Framework.Common.CommonData;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.OperationCenter;
 using OpenSEMI.ClientBase;
-using Venus_Core;
 using System.Windows.Threading;
-using Aitex.Core.RT.OperationCenter;
-using System.Reflection;
-//using SciChart.Core.Extensions;
-//using VirgoUI.Client.Models.Sys;
+
 
 namespace Venus_MainPages.ViewModels
 {
@@ -212,19 +204,19 @@ namespace Venus_MainPages.ViewModels
             //}
             get; set;
         }
-        protected bool OnTimer()
-        {
-            try
-            {
-                //PollData();
-            }
-            catch (Exception ex)
-            {
-                LOG.Error(ex.Message);
-            }
-
-            return true;
-        }
+        //protected bool OnTimer()
+        //{
+        //    try
+        //    {
+        //        PollData();
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        LOG.Error(ex.Message);
+        //    }
+
+        //    return true;
+        //}
         public ObservableCollection<StatsDataListItem> StatData
         {
             get { return _StatData; }
@@ -236,25 +228,7 @@ namespace Venus_MainPages.ViewModels
             get { return _StatDataRFAndPump; }
             set { SetProperty(ref _StatDataRFAndPump, value); }
         }
-        //private PeriodicJob _timer;
-        //protected override void OnInitialize()
-        //{
-        //    StatData = new ObservableCollection<StatsDataListItem>();
-        //    StatDataRFAndPump = new ObservableCollection<StatsDataListItemRFAndPump>();
-
-        //    base.OnInitialize();
-        //}
-
-        //protected override void OnActivate()
-        //{
-        //    base.OnActivate();
 
-        //}
-
-        //protected override void OnDeactivate(bool close)
-        //{
-        //    base.OnDeactivate(close);
-        //}
 
         public void PollData()
         {
@@ -262,11 +236,6 @@ namespace Venus_MainPages.ViewModels
             try
             {
 
-                //Application.Current.Dispatcher.BeginInvoke(new Action(() =>
-                //{
-                //    StatData.Clear();
-                //    StatDataRFAndPump.Clear();
-                //}));
                 string sql = $"SELECT * FROM \"stats_data\" order by \"name\" ASC;";
 
                 DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
@@ -328,22 +297,8 @@ namespace Venus_MainPages.ViewModels
                     if (!dbData.Rows[i]["last_total_reset_time"].Equals(DBNull.Value))
                         item.LastResetTotalTime = ((DateTime)dbData.Rows[i]["last_total_reset_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
 
-                    //item.InvokePropertyChanged(nameof(item.AlarmValue));
-                    //item.InvokePropertyChanged(nameof(item.WarningValue));
-                    //item.InvokePropertyChanged(nameof(item.Value));
-                    //item.InvokePropertyChanged(nameof(item.Total));
-                    //item.InvokePropertyChanged(nameof(item.LastUpdateTime));
-                    //item.InvokePropertyChanged(nameof(item.LastResetTime));
-                    //item.InvokePropertyChanged(nameof(item.LastResetTotalTime));
                 }
 
-                //foreach (var name in removableList)
-                //{
-                //    StatsDataListItem item = StatData.FirstOrDefault(x => x.Name == name);
-                //    if (item != null)
-                //        StatData.Remove(item); 
-                //}
-
 
 
 
@@ -353,11 +308,6 @@ namespace Venus_MainPages.ViewModels
 
                 if (dbDataRFPump == null || dbDataRFPump.Rows.Count == 0)
                     return;
-                //string[] clearedNameList = Array.ConvertAll<StatsDataListItemRFAndPump, string>(StatDataRFAndPump.ToArray(), x => x.Name);
-
-                //List<string> removableList = new List<string>();
-                //if (clearedNameList.Length > 0)
-                //    removableList = clearedNameList.ToList();
 
                 for (int i = 0; i < dbDataRFPump.Rows.Count; i++)
                 {
@@ -388,38 +338,8 @@ namespace Venus_MainPages.ViewModels
                     if (!dbDataRFPump.Rows[i]["last_pm_time"].Equals(DBNull.Value))
                         item.LastPMTime = ((DateTime)dbDataRFPump.Rows[i]["last_pm_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
 
-
-                    //if (item.Description.Contains("Follow => "))
-                    //{
-                    //    string findmodule = item.Description.Replace("Follow => ", "");
-                    //    for (int j = 0; j < dbDataRFPump.Rows.Count; j++)
-                    //    {
-                    //        if (dbDataRFPump.Rows[j]["name"].ToString() == findmodule)
-                    //        {
-                    //            item.fromLastPM = ((float)dbDataRFPump.Rows[j]["from_last_pm"]
-                    //            + (float)dbDataRFPump.Rows[i]["from_last_pm"]).ToString();
-                    //            item.Total = ((float)dbDataRFPump.Rows[j]["total"]
-                    //            + (float)dbDataRFPump.Rows[i]["total"]).ToString();
-                    //            item.LastPMTime = ((DateTime)dbDataRFPump.Rows[i]["last_pm_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
-                    //        }
-                    //    }
-                    //}
-                    //item.InvokePropertyChanged(nameof(item.Name));
-                    //item.InvokePropertyChanged(nameof(item.AlarmEnable));
-                    //item.InvokePropertyChanged(nameof(item.Description));
-                    //item.InvokePropertyChanged(nameof(item.Total));
-                    //item.InvokePropertyChanged(nameof(item.fromLastPM));
-                    //item.InvokePropertyChanged(nameof(item.PMInterval));
-                    //item.InvokePropertyChanged(nameof(item.LastPMTime));
                 }
 
-                //foreach (var name in removableList)
-                //{
-                //    StatsDataListItemRFAndPump item = StatDataRFAndPump.FirstOrDefault(x => x.Name == name);
-                //    if (item != null)
-                //        StatDataRFAndPump.Remove(item);
-                //}
-
 
             }
             catch
@@ -443,12 +363,12 @@ namespace Venus_MainPages.ViewModels
         }
         public void ResetEnableAlarm(StatsDataListItem item)
         {
-            //InvokeClient.Instance.Service.DoOperation("System.Stats.EnableAlarm", item.Name, item.AlarmEnable);
+            InvokeClient.Instance.Service.DoOperation("System.Stats.EnableAlarm", item.Name, item.AlarmEnable);
         }
 
         public void ResetEnableWarning(StatsDataListItem item)
         {
-            //InvokeClient.Instance.Service.DoOperation("System.Stats.EnableWarning", item.Name, item.WarningEnable);
+            InvokeClient.Instance.Service.DoOperation("System.Stats.EnableWarning", item.Name, item.WarningEnable);
         }
 
         public void SetAlarmValue(StatsDataListItem item)
@@ -460,10 +380,9 @@ namespace Venus_MainPages.ViewModels
                 return;
             }
 
-            //InvokeClient.Instance.Service.DoOperation("System.Stats.SetAlarmValue", item.Name, setValue);
+            InvokeClient.Instance.Service.DoOperation("System.Stats.SetAlarmValue", item.Name, setValue);
 
             item.AlarmTextSaved = true;
-            //item.InvokePropertyChanged(nameof(item.AlarmTextSaved));
         }
 
         public void SetWarningValue(StatsDataListItem item)
@@ -475,10 +394,9 @@ namespace Venus_MainPages.ViewModels
                 return;
             }
 
-            //InvokeClient.Instance.Service.DoOperation("System.Stats.SetWarningValue", item.Name, setValue);
+            InvokeClient.Instance.Service.DoOperation("System.Stats.SetWarningValue", item.Name, setValue,item.WarningEnable);
 
             item.WarningTextSaved = true;
-            //item.InvokePropertyChanged(nameof(item.WarningTextSaved));
         }
         public void ResetTotalValue(StatsDataListItem item)
         {

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

@@ -1,6 +1,5 @@
 using Aitex.Core.Common.DeviceData;
 using Aitex.Core.RT.Log;
-using ExcelLibrary.BinaryFileFormat;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.OperationCenter;
@@ -10,11 +9,9 @@ using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Linq;
-using System.Reflection;
 using System.Windows.Threading;
 using Venus_Core;
 using Venus_MainPages.Unity;
-using Venus_MainPages.Views;
 using Venus_Themes.CustomControls;
 
 namespace Venus_MainPages.ViewModels

+ 64 - 48
Venus/Venus_MainPages/ViewModels/TMViewModel.cs

@@ -21,7 +21,7 @@ using static Venus_Core.NiceRobotAction;
 
 namespace Venus_MainPages.ViewModels
 {
-    
+
     public enum TMModule
     {
         PMA, PMB, PMC, PMD, LLA, LLB
@@ -30,7 +30,7 @@ namespace Venus_MainPages.ViewModels
     {
         Blade1, Blade2
     }
-   
+
     internal class TMViewModel : BindableBase
     {
         #region 私有字段
@@ -42,8 +42,8 @@ namespace Venus_MainPages.ViewModels
         private bool m_TMIsOFFline;
         private bool m_LLIsOFFline;
         private WaferInfo m_PMAWafer;
-        private WaferInfo m_PMBWafer; 
-        private WaferInfo m_PMCWafer; 
+        private WaferInfo m_PMBWafer;
+        private WaferInfo m_PMCWafer;
         private WaferInfo m_PMDWafer;
         private WaferInfo m_LLAWafer;
         private WaferInfo m_LLBWafer;
@@ -82,10 +82,10 @@ namespace Venus_MainPages.ViewModels
         private int m_PlaceSoltSelectedIndex;
         private int m_ExtendSoltSelectedIndex;
         private int m_RetractSoltSelectedIndex;
-        private List<string> m_RtDataKeys=new List<string> ();
+        private List<string> m_RtDataKeys = new List<string>();
         private Dictionary<string, object> m_RtDataValues;
 
-        private string m_ModuleCheckedName="TM";
+        private string m_ModuleCheckedName = "TM";
         private string m_RobotAction;
         private string m_RobotTarget;
 
@@ -100,10 +100,10 @@ namespace Venus_MainPages.ViewModels
         private bool m_TMIsInstalled;
 
 
-        private List<string> m_OriginalCycle=new List<string> ();
+        private List<string> m_OriginalCycle = new List<string>();
         private List<string> m_ToCycle = new List<string>();
 
-        private List<TMModule> m_TMModules= new List<TMModule>();
+        private List<TMModule> m_TMModules = new List<TMModule>();
 
         private bool m_CycleEnable;
         private string m_OriginalCycleSelectedItem;
@@ -145,10 +145,10 @@ namespace Venus_MainPages.ViewModels
         public string RobotAction2
         {
             get { return m_RobotAction; }
-            set 
+            set
             {
                 //RobotActiont(m_RobotAction, value);
-                
+
                 SetProperty(ref m_RobotAction, value);
             }
         }
@@ -157,7 +157,7 @@ namespace Venus_MainPages.ViewModels
         public RobotMoveInfo RobotMoveInfo
         {
             get { return m_robotMoveInfo; }
-            set 
+            set
             {
                 TMRobotMoveInfoChanged(m_robotMoveInfo, value);
                 SetProperty(ref m_robotMoveInfo, value);
@@ -175,7 +175,7 @@ namespace Venus_MainPages.ViewModels
         {
             get { return m_RobotArm; }
             set
-            { 
+            {
                 SetProperty(ref m_RobotArm, value);
             }
         }
@@ -405,7 +405,7 @@ namespace Venus_MainPages.ViewModels
 
         //private async void RobotActiont(string oldValue,string newValue)
         //{
-            
+
         //    if (oldValue == "None" && newValue == "Placing" && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus==1)
         //    {
         //        var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
@@ -474,7 +474,7 @@ namespace Venus_MainPages.ViewModels
         //    {
         //        Robot2XAction = WaferRobotXAction.Retract;
         //    }
-           
+
         //    if (oldValue == "None" && newValue == "Picking" && ModuleManager.ModuleInfos["TM"].WaferManager.Wafers[1].WaferStatus == 0)
         //    {
         //        var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
@@ -501,7 +501,7 @@ namespace Venus_MainPages.ViewModels
         //            await Task.Delay(1500);
         //            Robot2XAction = WaferRobotXAction.Extend;
         //        }
-                      
+
         //    }
 
 
@@ -791,7 +791,7 @@ namespace Venus_MainPages.ViewModels
             get { return m_TMIsInstalled; }
             set { SetProperty(ref m_TMIsInstalled, value); }
         }
-        
+
         public List<TMModule> TMModules
         {
             get { return m_TMModules; }
@@ -927,7 +927,7 @@ namespace Venus_MainPages.ViewModels
             PMDIsInstalled = allModules.Contains("PMD");
             LLAIsInstalled = allModules.Contains("LLA");
             LLBIsInstalled = allModules.Contains("LLB");
-            TMIsInstalled= allModules.Contains("TM");
+            TMIsInstalled = allModules.Contains("TM");
             if (PMAIsInstalled == true)
             {
                 TMModules.Add(TMModule.PMA);
@@ -964,22 +964,22 @@ namespace Venus_MainPages.ViewModels
             timer = new DispatcherTimer();
             timer.Interval = TimeSpan.FromSeconds(0.1);
             timer.Tick += Timer_Tick;
-            timer.Start();
+            //timer.Start();
 
             PickSoltItemsSource.Add(1);
             PlaceSoltItemsSource.Add(1);
             ExtendSoltItemsSource.Add(1);
             RetractSoltItemsSource.Add(1);
-           
+
         }
 
-       
+
 
         private void Timer_Tick(object sender, EventArgs e)
         {
             if (LLAIsInstalled == true)
             {
-                LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x=>x.WaferStatus!=0);
+                LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
                 LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
             }
             if (LLBIsInstalled == true)
@@ -1011,7 +1011,7 @@ namespace Venus_MainPages.ViewModels
                 BladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
                 TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
             }
-            
+
 
             RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
 
@@ -1025,7 +1025,7 @@ namespace Venus_MainPages.ViewModels
 
             var TMRobotMoveActionBladeTarget = QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction.BladeTarget");
             if (TMRobotMoveActionBladeTarget != null)
-            { 
+            {
                 RobotTarget = TMRobotMoveActionBladeTarget.ToString();
             }
 
@@ -1046,19 +1046,19 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"TM.RobotHome", "TMRobot");
         }
         private void OnGoto()
-        {          
+        {
             var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), BladeNiceXinSongWaferRobotTAction.ToString(), true);
             var selectedHand = (Hand)Enum.Parse(typeof(Hand), GoToSelectedBlade.ToString(), true);
             InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.Goto}", moduleName, selectedHand, selectedHand);
         }
         private void OnExtend()
-        {          
+        {
             var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), ExtendSelectedModule.ToString(), true);
             var selectedHand = (Hand)Enum.Parse(typeof(Hand), ExtendSelectedBlade.ToString(), true);
             InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.Extend}", moduleName, selectedHand, selectedHand);
         }
         private void OnRetract()
-        {          
+        {
             var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), RetractSelectedModule.ToString(), true);
             var selectedHand = (Hand)Enum.Parse(typeof(Hand), RetractSelectedBlade.ToString(), true);
             InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.Retract}", moduleName, selectedHand, selectedHand);
@@ -1071,7 +1071,7 @@ namespace Venus_MainPages.ViewModels
                 case "Pick":
                     PickSoltItemsSource.Clear();
                     if ((int)PickSelectedModule == 4)
-                    {                       
+                    {
                         for (int i = 1; i <= LLAModuleInfo.WaferManager.Wafers.Count; i++)
                         {
                             PickSoltItemsSource.Add(i);
@@ -1164,18 +1164,18 @@ namespace Venus_MainPages.ViewModels
                     RetractSoltSelectedIndex = 0;
                     break;
             }
-         
+
         }
-        private  void OnPick()
+        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);
+
+            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 ((int)PickSelectedModule > 3)
-            {           
+            {
                 InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.LLPick}", moveItems);
             }
             else
@@ -1183,13 +1183,13 @@ namespace Venus_MainPages.ViewModels
                 InvokeClient.Instance.Service.DoOperation($"TM.{RtOperation.PMPick}", moveItems);
             }
         }
-        private  void OnPlace()
+        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);
+            MoveItem moveItem = new MoveItem(0, 0, moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex] - 1, selectedHand);
             moveItems.Enqueue(moveItem);
             if ((int)PlaceSelectedModule > 3)
             {
@@ -1218,7 +1218,7 @@ namespace Venus_MainPages.ViewModels
         }
         private void OnModuleChecked(object obj)
         {
-            m_ModuleCheckedName=obj.ToString();
+            m_ModuleCheckedName = obj.ToString();
         }
         private void OnAbort()
         {
@@ -1239,8 +1239,8 @@ namespace Venus_MainPages.ViewModels
             {
                 return;
             }
-           
-            if (PMAIsCycle==true)
+
+            if (PMAIsCycle == true)
             {
                 strings.Add("PMA");
             }
@@ -1264,7 +1264,7 @@ namespace Venus_MainPages.ViewModels
             {
                 return;
             }
-            InvokeClient.Instance.Service.DoOperation("TMCycle.Start", strings.ToArray(),CycleCount);
+            InvokeClient.Instance.Service.DoOperation("TMCycle.Start", strings.ToArray(), CycleCount);
 
         }
 
@@ -1275,7 +1275,7 @@ namespace Venus_MainPages.ViewModels
 
         }
         private void OnSystemHome()
-        { 
+        {
             InvokeClient.Instance.Service.DoOperation("System.Home");
 
         }
@@ -1303,10 +1303,30 @@ namespace Venus_MainPages.ViewModels
         #region 私有方法
         private void addDataKeys()
         {
-            m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
-            m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
-            m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
-            m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
+            if (PMAIsInstalled)
+            {
+                m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
+                m_RtDataKeys.Add("PMA.CalculationPressure");
+
+            }
+            if (PMBIsInstalled)
+            {
+                m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
+                m_RtDataKeys.Add("PMB.CalculationPressure");
+
+            }
+            if (PMCIsInstalled)
+            {
+                m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
+                m_RtDataKeys.Add("PMC.CalculationPressure");
+
+            }
+            if (PMDIsInstalled)
+            {
+                m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
+                m_RtDataKeys.Add("PMD.CalculationPressure");
+
+            }
 
             m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
             m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
@@ -1315,10 +1335,6 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
 
             m_RtDataKeys.Add("TMCycle.CycleIndex");
-            m_RtDataKeys.Add("PMA.CalculationPressure");
-            m_RtDataKeys.Add("PMB.CalculationPressure");
-            m_RtDataKeys.Add("PMC.CalculationPressure");
-            m_RtDataKeys.Add("PMD.CalculationPressure");
 
             m_RtDataKeys.Add("TM.PMASlitDoor.IsClosed");
             m_RtDataKeys.Add("TM.PMBSlitDoor.IsClosed");

+ 66 - 12
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -14,7 +14,6 @@ using System.Linq;
 using System.Windows;
 using System.Windows.Media;
 using System.Windows.Threading;
-using Venus_Core;
 using Venus_MainPages.Unity;
 using Venus_MainPages.Views;
 
@@ -39,7 +38,7 @@ namespace Venus_MainPages.ViewModels
         private int m_EventLogListSelectedIndex;
         private Queue<EventItem> alarmQuery = new Queue<EventItem>();//控制alarm log 在 top UI显示
 
-        private readonly int  logMaxCount = 50;//log在ui最多显示数量
+        private readonly int logMaxCount = 50;//log在ui最多显示数量
         private AITSignalTowerData m_SignalTowerData;
         private string m_HostCommunicationStatus;
         private string m_TimeTick;
@@ -69,6 +68,7 @@ namespace Venus_MainPages.ViewModels
         //private PressureType m_PressureType;
         //private ConfigType m_ConfigType;
         private bool m_IsExcludeInfoType;
+        private TopView view;
         #endregion
 
         #region  属性
@@ -321,6 +321,10 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand SwitchBuzzerCommand =>
                  _SwitchBuzzerCommand ?? (_SwitchBuzzerCommand = new DelegateCommand(OnSwitchBuzzer));
 
+        private DelegateCommand<object> _LoadCommand;
+        public DelegateCommand<object> LoadCommand =>
+            _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
+
         #endregion
 
         #region 构造函数
@@ -352,20 +356,70 @@ namespace Venus_MainPages.ViewModels
             EventClient.Instance.OnEvent += Instance_OnEvent;
             EventClient.Instance.Start();
             Title = QueryDataClient.Instance.Service.GetConfig($"System.Name").ToString();
-            UserName=GlobalUser.Instance.User.Name;
-            //object obj = QueryDataClient.Instance.Service.GetData("System.PressureUnitType");
-            //m_PressureType = (PressureType)Convert.ToInt32(obj);
-            //m_ConfigType = (ConfigType)Enum.Parse(typeof(ConfigType), QueryDataClient.Instance.Service.GetData("System.ConfigType").ToString());
-            //var islog= QueryDataClient.Instance.Service.GetConfig("System.IsLogExcludeInfoType");
-            //if (m_ConfigType==ConfigType.Kepler2200)
-            //{
-            //    isExcludeInfoType= (bool)QueryDataClient.Instance.Service.GetConfig("System.IsLogExcludeInfoType"); 
-            //}
+            UserName = GlobalUser.Instance.User.Name;
         }
         #endregion
 
         #region 方法
+        private void OnLoad(object obj)
+        {
+
+            view = obj as TopView;
+
+            if (!VCE1IsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.vce1Title);
+                this.view.vce1Title = null;
+            }
+            if (!VCEAIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.vceATitle);
+                this.view.vceATitle = null;
+            }
+            if (!VCEBIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.vceBTitle);
+                this.view.vceBTitle = null;
+            }
+            if (!PMAIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.pmaTitle);
+                this.view.pmaTitle = null;
+            }
+            if (!PMBIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.pmbTitle);
+                this.view.pmbTitle = null;
+            }
+            if (!PMCIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.pmcTitle);
+                this.view.pmcTitle = null;
+            }
+            if (!PMDIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.pmdTitle);
+                this.view.pmdTitle = null;
+            }
+            if (!SETMIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.seTmTitle);
+                this.view.seTmTitle = null;
+            }
+            if (!DETMIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.deTmTitle);
+                this.view.deTmTitle = null;
+            }
+            if (!TMIsInstalled)
+            {
+                this.view.moduleGrid.Children.Remove(this.view.tmTitle);
+                this.view.tmTitle = null;
+            }
+            GC.Collect(); // This should pick up the control removed at a previous MouseDown
+            GC.WaitForPendingFinalizers(); // Doesn't help either
 
+        }
         void timer_Tick(object sender, EventArgs e)
         {
             TimeTick = DateTime.Now.ToString();
@@ -467,7 +521,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add("LLB.FsmState");
             m_RtDataKeys.Add("LLB.IsOnline");
             m_RtDataKeys.Add("LLB.IsInclude");
-   
+
             m_RtDataKeys.Add("SYSTEM.FsmState");
             m_RtDataKeys.Add("System.IsAutoMode");
 

+ 5 - 3
Venus/Venus_MainPages/Views/DataHistoryView.xaml

@@ -31,22 +31,24 @@
 
                     <TextBlock Text="Start Time:" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" Margin="5,0,0,0"/>
 
-                    <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="40" HorizontalAlignment="Left">
+                    <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="250" Height="40" HorizontalAlignment="Left">
                         <wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
                     </wfi:WindowsFormsHost>
 
 
                     <TextBlock Text="End Time:" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" Margin="5,0,0,0"/>
-                    <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" HorizontalAlignment="Left">
+                    <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="250" Height="22" HorizontalAlignment="Left">
                         <wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
                     </wfi:WindowsFormsHost>
 
                     <StackPanel Orientation="Horizontal">
                         <Button x:Name="searchButton" Content="Search" Command="{Binding StartCommand}" Width="80" Height="20" HorizontalAlignment="Left" Margin="5,10,0,0" IsEnabled="{Binding ElementName=TimeDataCheckBox,Path=IsChecked,Converter={StaticResource BoolToBool}}"/>
                         <Button  Content="Clear" Command="{Binding  ClearCommand}" Width="80" Height="20" HorizontalAlignment="Left" Margin="5,10,0,0"/>
+                        <Button Content="Export" Command="{Binding ExportCommand}" Width="80" Height="20" Margin="5,10,0,0"/>
+
                     </StackPanel>
                 </StackPanel>
-                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Margin="0 8 0 0">
                     <TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ParameterNodes}"  Canvas.Top="100" Height="450" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling">
                     <TreeView.ItemTemplate>
                         <HierarchicalDataTemplate  ItemsSource="{Binding ChildNodes}">

File diff suppressed because it is too large
+ 10 - 10
Venus/Venus_MainPages/Views/OperationOverView.xaml


+ 7 - 1
Venus/Venus_MainPages/Views/OverKepler2200AView.xaml

@@ -746,7 +746,13 @@
 
                     </ctrls:FlowPipe>
 
-                    <ctrls:Pump Canvas.Top="692"  Canvas.Left="1240.6" Width="45" Height="40" IsOpen="{Binding PumpIsOpen,Mode=TwoWay}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}">
+                    <ctrls:Pump Canvas.Top="692"  Canvas.Left="1240.6" Width="45" Height="40" IsOpen="{Binding PumpIsOpen,Mode=TwoWay}">
+                        <ctrls:Pump.IsEnabled>
+                            <MultiBinding Converter="{StaticResource toBoolMultiValueConverter}">
+                                <Binding Path="IsAutoMode" Converter="{StaticResource BoolToBool}"></Binding>
+                                <Binding Path="IsEnablePumpSwitch"></Binding>
+                            </MultiBinding>
+                        </ctrls:Pump.IsEnabled>
                         <ctrls:Pump.ContextMenu>
                             <ContextMenu>
                                 <MenuItem Header="ON"  Command="{Binding OpenPumpCommand}" IsChecked="{Binding PumpIsOpen,Mode=OneWay}" IsEnabled="{Binding PumpIsOpen,Converter={StaticResource BoolToBool},Mode=OneWay}"/>

+ 7 - 1
Venus/Venus_MainPages/Views/OverKepler2200BView.xaml

@@ -746,7 +746,13 @@
 
                     </ctrls:FlowPipe>
 
-                    <ctrls:Pump Canvas.Top="692"  Canvas.Left="1240.6" Width="45" Height="40" IsOpen="{Binding PumpIsOpen,Mode=TwoWay}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}">
+                    <ctrls:Pump Canvas.Top="692"  Canvas.Left="1240.6" Width="45" Height="40" IsOpen="{Binding PumpIsOpen,Mode=TwoWay}">
+                        <ctrls:Pump.IsEnabled>
+                            <MultiBinding Converter="{StaticResource toBoolMultiValueConverter}">
+                                <Binding Path="IsAutoMode" Converter="{StaticResource BoolToBool}"></Binding>
+                                <Binding Path="IsEnablePumpSwitch"></Binding>
+                            </MultiBinding>
+                        </ctrls:Pump.IsEnabled>
                         <ctrls:Pump.ContextMenu>
                             <ContextMenu>
                                 <MenuItem Header="ON"  Command="{Binding OpenPumpCommand}" IsChecked="{Binding PumpIsOpen,Mode=OneWay}" IsEnabled="{Binding PumpIsOpen,Converter={StaticResource BoolToBool},Mode=OneWay}"/>

+ 3 - 3
Venus/Venus_MainPages/Views/ProcessHistoryView.xaml

@@ -92,7 +92,7 @@
                 <RowDefinition Height="20"/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
-            <Button Grid.Row="0" Content="导出列表" FontSize="10" Height="18" Margin="0,5,12,0" x:Name="ButtonExportList"  VerticalAlignment="Top" IsEnabled="True" HorizontalAlignment="Right" Width="106"  Grid.ColumnSpan="3" Grid.Column="7" Click="buttonLotListExport_Click"/>
+            <!--<Button Grid.Row="0" Content="Export" FontSize="10" Height="20" Margin="0,0,12,0" x:Name="ButtonExportList"  VerticalAlignment="Top" IsEnabled="True" HorizontalAlignment="Right" Width="106"  Grid.ColumnSpan="3" Grid.Column="7" Command="{Binding ExportRecipesCommand}"/>-->
             <DataGrid Grid.Row="1" 
                       ItemsSource="{Binding Recipes}" 
                       AutoGenerateColumns="False" 
@@ -191,7 +191,7 @@
                 <CheckBox    HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Canvas.Top="8" Canvas.Left="400" Content="AutoX Zoom"     x:Name="AutoXCheckBox"/>
                 <CheckBox    HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Canvas.Top="8" Canvas.Left="600" Content="AutoY Zoom"     x:Name="AutoYCheckBox"/>
                 <CheckBox    HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Canvas.Top="8" Canvas.Left="800" Content="Show Step"      IsChecked="{Binding IsShowStep}"/>
-                <Button Grid.Row="0" Content="导出数据" FontSize="10" Height="18" Canvas.Top="5" Canvas.Right="12"  x:Name="ButtonExportData" IsEnabled="True"  VerticalAlignment="Top" HorizontalAlignment="Right" Width="106"  Click="buttonLotDetailsExport_Click"  />
+                <Button Grid.Row="0" Content="Export" FontSize="10" Height="20" Canvas.Top="5" Canvas.Right="12"  x:Name="ButtonExportData" IsEnabled="True"  VerticalAlignment="Top" HorizontalAlignment="Right" Width="106"  Command="{Binding RecipeDataExportCommand}" />
             </Canvas>
             <Grid Grid.Row="1" Margin="10,5,10,5">
                 <Grid.ColumnDefinitions>
@@ -204,7 +204,7 @@
                             <Button Width="100" Content="Search"                   Command="{Binding SearchDataCommand}"/>
                             <Button Width="100" Content="Clear" Margin="10,0,0,0"  Command="{Binding ClearDataCommand}"/>
                         </StackPanel>
-                        <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
+                        <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Margin="0 5 0 0">
                             <TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ParameterNodes,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Canvas.Top="100" Height="300" >
                                 <TreeView.ItemTemplate>
                                     <HierarchicalDataTemplate  ItemsSource="{Binding ChildNodes,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">

+ 117 - 118
Venus/Venus_MainPages/Views/ProcessHistoryView.xaml.cs

@@ -46,64 +46,64 @@ namespace Venus_MainPages.Views
             _viewModel.UpdateData(item);
 
             ButtonExportData.IsEnabled = item != null;
-            ButtonExportList.IsEnabled = item != null;
-        }
-        private void buttonLotListExport_Click(object sender, System.Windows.RoutedEventArgs e)
-        {
-            try
-            {
-                _viewModel = (ProcessHistoryViewModel)DataContext;
-                ObservableCollection<RecipeItem> DataRecipeList = _viewModel.Recipes;
-
-                if (DataRecipeList == null || DataRecipeList.Count == 0) return;
-
-                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
-                dlg.DefaultExt = ".xls"; // Default file extension 
-                dlg.Filter = "数据表格文件|*.xls"; // Filter files by extension 
-                dlg.FileName = string.Format("RecipeList{0}", _viewModel.StartDateTime.ToString("yyyyMMdd"));
-                Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
-                if (result != true) // Process open file dialog box results
-                    return;
-
-
-                if (File.Exists(dlg.FileName))
-                {
-                    File.Delete(dlg.FileName);
-                }
-
-                Workbook workbook = new Workbook();
-                Worksheet worksheet = new Worksheet(_viewModel.StartDateTime.ToString("yyyyMMdd"));
-
-                int col = 0;
-                worksheet.Cells[0, col++] = new Cell("Start");
-                worksheet.Cells[0, col++] = new Cell("End");
-                worksheet.Cells[0, col++] = new Cell("Chamber");
-                worksheet.Cells[0, col++] = new Cell("Guid");
-                worksheet.Cells[0, col++] = new Cell("WaferID");
-                worksheet.Cells[0, col++] = new Cell("Recipe");
-                worksheet.Cells[0, col++] = new Cell("Status");
-
-                for (int i = 0; i < DataRecipeList.Count; i++)
-                {
-                    int colCount = 0;
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].StartTime);
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].EndTime);
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Chamber);
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Guid);
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].RecipeRunGuid);
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Recipe);
-                    worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Status);
-
-                }
-                workbook.Worksheets.Add(worksheet);
-                workbook.Save(dlg.FileName);
-            }
-            catch (Exception ex)
-            {
-                LOG.WriteExeption(ex.Message, ex);
-            }
-
+            //ButtonExportList.IsEnabled = item != null;
         }
+        //private void buttonLotListExport_Click(object sender, System.Windows.RoutedEventArgs e)
+        //{
+        //    try
+        //    {
+        //        _viewModel = (ProcessHistoryViewModel)DataContext;
+        //        ObservableCollection<RecipeItem> DataRecipeList = _viewModel.Recipes;
+
+        //        if (DataRecipeList == null || DataRecipeList.Count == 0) return;
+
+        //        Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+        //        dlg.DefaultExt = ".xls"; // Default file extension 
+        //        dlg.Filter = "数据表格文件|*.xls"; // Filter files by extension 
+        //        dlg.FileName = string.Format("RecipeList{0}", _viewModel.StartDateTime.ToString("yyyyMMdd"));
+        //        Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
+        //        if (result != true) // Process open file dialog box results
+        //            return;
+
+
+        //        if (File.Exists(dlg.FileName))
+        //        {
+        //            File.Delete(dlg.FileName);
+        //        }
+
+        //        Workbook workbook = new Workbook();
+        //        Worksheet worksheet = new Worksheet(_viewModel.StartDateTime.ToString("yyyyMMdd"));
+
+        //        int col = 0;
+        //        worksheet.Cells[0, col++] = new Cell("Start");
+        //        worksheet.Cells[0, col++] = new Cell("End");
+        //        worksheet.Cells[0, col++] = new Cell("Chamber");
+        //        worksheet.Cells[0, col++] = new Cell("Guid");
+        //        worksheet.Cells[0, col++] = new Cell("WaferID");
+        //        worksheet.Cells[0, col++] = new Cell("Recipe");
+        //        worksheet.Cells[0, col++] = new Cell("Status");
+
+        //        for (int i = 0; i < DataRecipeList.Count; i++)
+        //        {
+        //            int colCount = 0;
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].StartTime);
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].EndTime);
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Chamber);
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Guid);
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].RecipeRunGuid);
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Recipe);
+        //            worksheet.Cells[i + 1, colCount++] = new Cell(DataRecipeList[i].Status);
+
+        //        }
+        //        workbook.Worksheets.Add(worksheet);
+        //        workbook.Save(dlg.FileName);
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        LOG.WriteExeption(ex.Message, ex);
+        //    }
+
+        //}
         private void OnChangeLineColor(object sender, RoutedEventArgs e)
         {
             var btn = (Button)sender;
@@ -118,73 +118,72 @@ namespace Venus_MainPages.Views
                     _viewModel = (ProcessHistoryViewModel)DataContext;
                     var item = _viewModel.PdKeyDataCollection.ToList().Find(t => t.UniqueId == dataId);
                     item.Color = new SolidColorBrush(newColor);
-                    //_viewModel.OnSearchData();
                     _viewModel.ColorChanged();
 
                 }
             }
         }
-        private void buttonLotDetailsExport_Click(object sender, System.Windows.RoutedEventArgs e)
-        {
-            try
-            {
-                RecipeItem log = (dataGrid_RecipeList.SelectedItem) as RecipeItem;
-                if (log == null)
-                {
-                    MessageBox.Show("没有数据,先从列表中选择一个批次");
-                    return;
-                }
-                _viewModel = (ProcessHistoryViewModel)DataContext;
-                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
-                dlg.DefaultExt = ".xls"; // Default file extension 
-                dlg.Filter = "数据表格文件|*.xls"; // Filter files by extension 
-                dlg.FileName = string.Format("{0}-{1}", _viewModel.StartDateTime.ToString("yyyyMMdd"), log.Recipe.Replace(" ","").Replace("/", ""));
-                Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
-                if (result != true) // Process open file dialog box results
-                    return;
-
-
-                if (File.Exists(dlg.FileName))
-                {
-                    File.Delete(dlg.FileName);
-                }
-
-                Workbook workbook = new Workbook();
-                Worksheet worksheet = new Worksheet(log.Recipe);
-
-                Dictionary<string, int> colIndex = new Dictionary<string, int>();
-                Dictionary<string, int> rowIndex = new Dictionary<string, int>();
-
-                int colCount = 0;
-                int rowCount = 0;
-                foreach (var item in _viewModel.ProcessData)
-                { 
-
-                    if (!rowIndex.ContainsKey(item.dateTime.ToString("G")))
-                    {
-                        rowCount++;
-                        rowIndex[item.dateTime.ToString("G")] = rowCount;
-                        worksheet.Cells[rowCount, 0] = new Cell(item.dateTime.ToString("G"));
-                    }
-
-                    if (!colIndex.ContainsKey(item.dbName))
-                    {
-                        colCount++;
-                        colIndex[item.dbName] = colCount;
-                        worksheet.Cells[0, colCount] = new Cell(item.dbName);
-                    }
-
-                    worksheet.Cells[rowIndex[item.dateTime.ToString("G")], colIndex[item.dbName]] = new Cell(item.value);
-                }
-                workbook.Worksheets.Add(worksheet);
-                workbook.Save(dlg.FileName);
-            }
-            catch (Exception ex)
-            {
+        //private void buttonLotDetailsExport_Click(object sender, System.Windows.RoutedEventArgs e)
+        //{
+        //    try
+        //    {
+        //        RecipeItem log = (dataGrid_RecipeList.SelectedItem) as RecipeItem;
+        //        if (log == null)
+        //        {
+        //            MessageBox.Show("没有数据,先从列表中选择一个批次");
+        //            return;
+        //        }
+        //        _viewModel = (ProcessHistoryViewModel)DataContext;
+        //        Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+        //        dlg.DefaultExt = ".xls"; // Default file extension 
+        //        dlg.Filter = "数据表格文件|*.xls"; // Filter files by extension 
+        //        dlg.FileName = string.Format("{0}-{1}", _viewModel.StartDateTime.ToString("yyyyMMdd"), log.Recipe.Replace(" ","").Replace("/", ""));
+        //        Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
+        //        if (result != true) // Process open file dialog box results
+        //            return;
+
+
+        //        if (File.Exists(dlg.FileName))
+        //        {
+        //            File.Delete(dlg.FileName);
+        //        }
+
+        //        Workbook workbook = new Workbook();
+        //        Worksheet worksheet = new Worksheet(log.Recipe);
+
+        //        Dictionary<string, int> colIndex = new Dictionary<string, int>();
+        //        Dictionary<string, int> rowIndex = new Dictionary<string, int>();
+
+        //        int colCount = 0;
+        //        int rowCount = 0;
+        //        foreach (var item in _viewModel.ProcessData)
+        //        { 
+
+        //            if (!rowIndex.ContainsKey(item.dateTime.ToString("G")))
+        //            {
+        //                rowCount++;
+        //                rowIndex[item.dateTime.ToString("G")] = rowCount;
+        //                worksheet.Cells[rowCount, 0] = new Cell(item.dateTime.ToString("G"));
+        //            }
+
+        //            if (!colIndex.ContainsKey(item.dbName))
+        //            {
+        //                colCount++;
+        //                colIndex[item.dbName] = colCount;
+        //                worksheet.Cells[0, colCount] = new Cell(item.dbName);
+        //            }
+
+        //            worksheet.Cells[rowIndex[item.dateTime.ToString("G")], colIndex[item.dbName]] = new Cell(item.value);
+        //        }
+        //        workbook.Worksheets.Add(worksheet);
+        //        workbook.Save(dlg.FileName);
+        //    }
+        //    catch (Exception ex)
+        //    {
                 
-                LOG.WriteExeption(ex.Message, ex);
-            }
+        //        LOG.WriteExeption(ex.Message, ex);
+        //    }
 
-        }
+        //}
     }
 }

+ 6 - 6
Venus/Venus_MainPages/Views/StatisticsView.xaml

@@ -22,8 +22,8 @@
         <TabControl Grid.Row="0">
             <TabItem Header="Statistic Item List ">
 
-                <DataGrid Grid.Row="1" AlternationCount="2" HorizontalAlignment="Left" CanUserAddRows="True" AutoGenerateColumns="False" RowHeaderWidth="0"               
-                  ItemsSource="{Binding StatData, Mode=TwoWay}" Margin="0,5,0,0">
+                <DataGrid Grid.Row="1" AlternationCount="2" HorizontalAlignment="Left" CanUserAddRows="False"  AutoGenerateColumns="False" RowHeaderWidth="0"               
+                  ItemsSource="{Binding StatData, Mode=TwoWay}" Margin="0,5,0,0" >
 
                     <DataGrid.Columns>
                         <DataGridTemplateColumn Header="Name" Width="220">
@@ -195,13 +195,13 @@
                     <TextBlock Text="Name" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" Background="#6a82ad" Height="24"  Width="200" Padding="3" Foreground="White"/>
                     <TextBlock Text="Follow" Grid.Column="2" TextAlignment="Center" VerticalAlignment="Center" Background="#6a82ad" Height="24" Width="200" Padding="3" Foreground="White"/>
 
-                    <ComboBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding ModuleList}" SelectedItem="{Binding AddItemModule}"></ComboBox>
-                    <TextBox Grid.Row="1" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding AddItemName}" Padding="0,3,0,0" Height="22"/>
-                    <ComboBox Grid.Row="1" Grid.Column="2" ItemsSource="{Binding FollowRFList}" SelectedItem="{Binding AddItemFollowRF}"></ComboBox>
+                    <ComboBox Style="{StaticResource customeComboBoxStyle}" Grid.Row="1" Grid.Column="0" ItemsSource="{Binding ModuleList}" SelectedItem="{Binding AddItemModule}" BorderThickness="1" BorderBrush="Black"></ComboBox>
+                    <TextBox  Grid.Row="1" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding AddItemName}" Padding="0,3,0,0" Height="25" BorderBrush="Black" BorderThickness="0 1 0 1"/>
+                    <ComboBox Style="{StaticResource customeComboBoxStyle}" Grid.Row="1" Grid.Column="2" ItemsSource="{Binding FollowRFList}" SelectedItem="{Binding AddItemFollowRF}" BorderThickness="1" BorderBrush="Black"></ComboBox>
                 </Grid>
             </StackPanel>
             <StackPanel Orientation="Horizontal">
-                <Button Content="Add Item" Padding="20,5" Margin="5" Command="{Binding SubscribeItem}" Width="200"/>
+                <Button Content="Add Item" Padding="20,5" Margin="5" Command="{Binding SubscribeItem}" Width="120" Height="33"/>
             </StackPanel>
         </StackPanel>
         <TabControl Grid.Row="2">

File diff suppressed because it is too large
+ 1 - 1
Venus/Venus_MainPages/Views/TMOperationView.xaml


File diff suppressed because it is too large
+ 24 - 17
Venus/Venus_MainPages/Views/TopView.xaml


+ 2 - 14
Venus/Venus_MainPages/Views/TopView.xaml.cs

@@ -1,17 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-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 System.Windows.Controls;
+
 
 namespace Venus_MainPages.Views
 {

+ 9 - 0
Venus/Venus_RT/Config/System_Kepler2200.sccfg

@@ -186,6 +186,7 @@
 			<config default="COM24" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="10000" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+			<config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />
 		</configs>
 		<configs name="PreRotation" nameView="Pre Rotation definition">
 			<config default="PMA" name="PMA" nameView="PMA" description="Pre Rotation Station of PMA" max="" min="" paramter="" tag="" visible="true" unit="N/A" type="String" />
@@ -233,6 +234,7 @@
 			<config default="COM26" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="10000" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+			<config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />
 		</configs>
 		<configs name="LLA_MFC1" nameView="MFC1" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 1 or not" tag="" unit="N/A" type="Bool" />
@@ -283,6 +285,7 @@
 			<config default="COM26" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="10000" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+			<config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />
 		</configs>
 		<configs name="LLB_MFC1" nameView="MFC1" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 1 or not" tag="" unit="N/A" type="Bool" />
@@ -368,6 +371,7 @@
 			<config default="COM22" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="1300" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+		    <config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />		
 		</configs>
 		<configs name="Rf" nameView="Source RF" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:AdTec; 2:Comet" max="10" min="0" paramter="" tag="" unit="N/A" type="Integer" />
@@ -713,6 +717,7 @@
 			<config default="COM22" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="1300" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+			<config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />
 		</configs>
 		<configs name="Rf" nameView="Source RF" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:AdTec; 2:Comet" max="10" min="0" paramter="" tag="" unit="N/A" type="Integer" />
@@ -1041,6 +1046,8 @@
 			<config default="COM22" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="1300" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+			<config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />
+
 		</configs>
 		<configs name="Rf" nameView="Source RF" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:AdTec; 2:Comet" max="10" min="0" paramter="" tag="" unit="N/A" type="Integer" />
@@ -1368,6 +1375,8 @@
 			<config default="COM22" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="N/A" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="1300" min="0" paramter="" tag="" unit="Pa" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
+			<config default="false" name="EnableSwitch" nameView="Enable Pump Switch Function" description="" max="10" min="0" paramter="" tag="" unit="N/A" type="Bool" />
+
 		</configs>
 		<configs name="Rf" nameView="Source RF" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:AdTec; 2:Comet" max="10" min="0" paramter="" tag="" unit="N/A" type="Integer" />

+ 2 - 2
Venus/Venus_RT/Devices/AdTecRF.cs

@@ -853,7 +853,7 @@ namespace Venus_RT.Devices
         {
             if (string.IsNullOrWhiteSpace(strOrg))
             {
-                LOG.Write(eEvent.ERR_RF, Module, "收到 Match 数据为空");
+                LOG.Write(eEvent.ERR_MATCH, Module, "收到 Match 数据为空");
                 return;
             }
 
@@ -897,7 +897,7 @@ namespace Venus_RT.Devices
 
         private void SerialPortErrorOccurred(string str)
         {
-            LOG.Write(eEvent.ERR_RF, Module, $"AdTec Match error [{str}]");
+            LOG.Write(eEvent.ERR_MATCH, Module, $"AdTec Match error [{str}]");
         }
 
         private void SendCmd(string str)

+ 4 - 2
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -17,6 +17,7 @@ using Venus_RT.Devices;
 using Aitex.Core.RT.Log;
 using Aitex.Core.UI.DeviceControl;
 using MECF.Framework.Common.DataCenter;
+using Aitex.Core.RT.DataCollection;
 
 namespace Venus_RT.Modules.PMs
 {
@@ -441,7 +442,7 @@ namespace Venus_RT.Modules.PMs
             eEvent.ERR_PENDULUM_VALVE,
             eEvent.ERR_DEVICE_INFO,
             eEvent.ERR_DRY_PUMP,
-            eEvent.ERR_HighTemperatureHeater
+            eEvent.ERR_HighTemperatureHeater,         
         };
         public PMEntity(ModuleName module)
         {
@@ -771,7 +772,7 @@ namespace Venus_RT.Modules.PMs
 
         private void PMErrorInterrupt(ModuleName pmname, eEvent eEventid)
         {
-            if ( pmname == Module && stopEntityId.Contains(eEventid))
+            if ( pmname == Module && stopEntityId.Contains(eEventid) && fsm.State != (int)PMState.Error)
             {
                 CheckToPostMessage((int)MSG.Error);
             }
@@ -790,6 +791,7 @@ namespace Venus_RT.Modules.PMs
 
         private bool fEnterError(object[] objs)
         {
+            DataCollectionManager.Instance.ManualInsertData();
             return true;
         }
 

+ 3 - 3
Venus/Venus_Themes/Styles/CustomWindowStyle.xaml

@@ -22,9 +22,9 @@
                                         <TextBlock Text="{TemplateBinding Title}" Foreground="Gray" Margin="5 2" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="12"></TextBlock>
                                     </StackPanel>
                                     <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
-                                        
-                                        <ui:WindowButtonMin Background="Transparent" BorderThickness="0">
-                                            <TextBlock Text="➖" Foreground="Silver"  Width="16" Height="16" Cursor="Hand"/>
+
+                                        <ui:WindowButtonMin Background="Transparent" BorderThickness="0" Cursor="Hand">
+                                            <TextBlock Text="➖" Foreground="Silver"  Width="16" Height="16" />
                                         </ui:WindowButtonMin>
                                         <!--<ui:WindowButtonClose>
                                             <TextBlock Text="✖" Foreground="Silver"  Width="16" Height="16"/>

+ 1 - 1
Venus/Venus_Themes/UserControls/Chamber.xaml

@@ -107,7 +107,7 @@
                     </LinearGradientBrush>
                 </Rectangle.Fill>
             </Rectangle>
-            <Rectangle x:Name="BG_Status" Margin="9,19" Visibility="{Binding BiasRfPowerOnChamberVisibility}" Cursor="Hand">
+            <Rectangle x:Name="BG_Status" Margin="9,19"  Cursor="Hand">
                 <Rectangle.ContextMenu >
                     <ContextMenu>
                         <MenuItem Header="Create Wafer"  Click="CreateWafer_Click"     IsChecked="{Binding IsHasWafer}" IsEnabled="{Binding IsHasWafer,Converter={StaticResource BoolToBool}}"/>

+ 2 - 2
Venus/Venus_Themes/UserControls/ChamberWithHeater.xaml

@@ -193,7 +193,7 @@
                     </LinearGradientBrush>
                 </Rectangle.Fill>
             </Rectangle>
-            <Rectangle x:Name="BG_Status" Margin="9,19" Visibility="{Binding BiasRfPowerOnChamberVisibility}" Cursor="Hand">
+            <Rectangle x:Name="BG_Status" Margin="9,19"  Cursor="Hand">
                 <Rectangle.ContextMenu >
                     <ContextMenu>
                         <MenuItem Header="Create Wafer"  Click="CreateWafer_Click"     IsChecked="{Binding IsHasWafer}" IsEnabled="{Binding IsHasWafer,Converter={StaticResource BoolToBool}}"/>
@@ -268,7 +268,7 @@
                 <Rectangle  Stroke="Gray" Fill="{StaticResource doorColor}" Margin="42,-101,130,0" Width="8" VerticalAlignment="Top" Height="102" />
                 <Rectangle  Stroke="Gray" Fill="{StaticResource doorColor2}" Margin="42,-106,42,0" VerticalAlignment="Top" Height="7" />
                 <Rectangle  Fill="White" Margin="50,-101,50,0" Width="80" Height="118" />
-                <Rectangle  x:Name="BG_Status1"  Margin="50,-101,50,0" Width="80" Height="118" Visibility="{Binding RfPowerOnChamberVisibility}" >
+                <Rectangle  x:Name="BG_Status1"  Margin="50,-101,50,0" Width="80" Height="118">
                     <Rectangle.Style>
                         <Style>
                             <Setter Property="Rectangle.Fill" Value="{StaticResource chambercolor}"/>

+ 1 - 1
Venus/Venus_Themes/UserControls/WPFMessageBox.xaml

@@ -5,7 +5,7 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:WPF.Themes.UserControls"
-            MaxWidth="500"
+            MaxWidth="1500"
         AllowsTransparency="True"
         Background="Transparent"
         Closing="MessageBoxWindow_Closing"

+ 1 - 1
Venus/Venus_UI/Views/ShellView.xaml.cs

@@ -762,7 +762,7 @@ namespace Venus_UI.Views
         }
         #endregion
 
-        private async void Window_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        private  void Window_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
         {
             //this.buttonList[1].IsChecked = true;
             //await System.Threading.Tasks.Task.Delay(1);