Browse Source

1.添加eventview分页功能

lixiang 1 year ago
parent
commit
08e85396fc

+ 7 - 0
Venus/Framework/Common/DBCore/DB.cs

@@ -41,5 +41,12 @@ namespace Aitex.Core.RT.DBCore
 
             return null;
         }
+        public static int GetAllCount(string cmdText, params object[] p)
+        {
+            if (Instance != null)
+                return Instance.GetAllCount(cmdText, p);
+
+            return 0;
+        }
     }
 }

+ 5 - 1
Venus/Framework/Common/DBCore/DatabaseManager.cs

@@ -78,7 +78,7 @@ namespace Aitex.Core.RT.DBCore
                 }
                 catch (Exception ex)
                 {
-                    LOG.WriteExeption(string.Format("执行数据库操作错误, {0}",  sql), ex);
+                    LOG.WriteExeption(string.Format("执行数据库操作错误, {0}", sql), ex);
                 }
             }
 
@@ -110,6 +110,10 @@ namespace Aitex.Core.RT.DBCore
             return _db.ExecuteDataset(cmdText, p);
         }
 
+        public int GetAllCount(string cmdText, params object[] p)
+        {
+            return _db.GetAllCount(cmdText, p);
+        }
         void PrepareDatabaseTable(string sqlFile)
         {
             if (string.IsNullOrEmpty(sqlFile) || !File.Exists(sqlFile))

+ 2 - 0
Venus/Framework/Common/DBCore/ICommonDB.cs

@@ -15,6 +15,8 @@ namespace Aitex.Core.RT.DBCore
 
         void Insert(string sql);
 
+        int GetAllCount(string cmdText, params object[] p);
+
         DataSet ExecuteDataset(string cmdText, params object[] p);
     }
 }

+ 42 - 0
Venus/Framework/Common/DBCore/PostgresqlDB.cs

@@ -6,6 +6,7 @@ using Npgsql;
 using Aitex.Core.RT.Log;
 using System.Data;
 using Aitex.Core.Utilities;
+using DocumentFormat.OpenXml.Office.Word;
 
 namespace Aitex.Core.RT.DBCore
 {
@@ -169,7 +170,48 @@ namespace Aitex.Core.RT.DBCore
             }
         }
 
+        public int GetAllCount(string cmdText, params object[] p)
+        {
+            using (var connection = new NpgsqlConnection(_connectionString))
+            {
+                connection.Open();
+                connection.ChangeDatabase(_dbName);
+                using (NpgsqlCommand command = new NpgsqlCommand())
+                {
+                    try
+                    {
+                        PrepareCommand(command, connection, cmdText, p);
+                       
+                        return Convert.ToInt32( command.ExecuteScalar());
+                    }
+                    catch (Exception ex)
+                    {
+                        LOG.WriteExeption("执行查询出错," + cmdText, ex);
+                        return 0;
+                    }
+
+
+                }
+            }
 
+            //using (var connection = new NpgsqlConnection(_connectionString))
+            //{
+            //    using (NpgsqlCommand command = new NpgsqlCommand(cmdText,connection))
+            //    {
+            //        try
+            //        {
+            //            connection.Open();
+            //            object obj = command.ExecuteScalar();
+            //            return (Int32)command.ExecuteScalar();
+            //        }
+            //        catch (Exception ex)
+            //        {
+            //            LOG.WriteExeption("执行查询出错," + cmdText, ex);
+            //            return 0;
+            //        }
+            //    }
+            //}
+        }
         public bool ActiveConnection()
         {
             if (_conn != null && _conn.State == ConnectionState.Open)

+ 3 - 0
Venus/Framework/Common/DataCenter/IQueryDataService.cs

@@ -197,5 +197,8 @@ namespace MECF.Framework.Common.DataCenter
         
 		[OperationContract]
         List<OffsetItem> QueryOffsetDataByTime(string moduleName, DateTime from_time, DateTime to_time);
+
+        [OperationContract]
+        int GetDBEventAllCount(string sql);
     }
 }

+ 6 - 0
Venus/Framework/Common/DataCenter/QueryDataService.cs

@@ -4,6 +4,7 @@ using System.Data;
 using System.ServiceModel;
 using Aitex.Core.RT.ConfigCenter;
 using Aitex.Core.RT.DataCenter;
+using Aitex.Core.RT.DBCore;
 using Aitex.Core.RT.Event;
 using Aitex.Core.RT.IOCore;
 using Aitex.Core.RT.SCCore;
@@ -208,5 +209,10 @@ namespace MECF.Framework.Common.DataCenter
         {
             return OffsetDataRecorder.QueryOffsetDataByTime(moduleName, from_time, to_time);
         }
+
+        public int GetDBEventAllCount(string sql)
+        {
+            return EventDBWriter.QueryDBEventCount(sql);
+        }
     }
 }

+ 6 - 0
Venus/Framework/Common/DataCenter/QueryDataServiceClient.cs

@@ -245,5 +245,11 @@ namespace MECF.Framework.Common.DataCenter
             Invoke(svc => { result = svc.QueryOffsetDataByTime(moduleName, from_time, to_time); });
             return result;
         }
+        public int GetDBEventAllCount(string sql)
+        {
+            int result = 0;
+            Invoke(svc => { result = svc.GetDBEventAllCount(sql); });
+            return result;
+        }
     }
 }

+ 5 - 0
Venus/Framework/Common/Event/EventDBWriter.cs

@@ -84,5 +84,10 @@ namespace Aitex.Core.RT.Event
 
             return result;
         }
+
+        public static int QueryDBEventCount(string sql)
+        { 
+          return DB.GetAllCount(sql);
+        }
     }
 }

+ 176 - 2
Venus/Venus_MainPages/ViewModels/EventViewModel.cs

@@ -21,6 +21,13 @@ namespace Venus_MainPages.ViewModels
     {
         #region 私有字段
         //private int MenuPermission;
+        private bool m_IsAuto;
+
+        private int m_Total;
+        private int m_PageCount;
+        private int m_CurrentPage=1;
+
+        private int m_onePageCounts = 30;
         #endregion
 
         #region 属性
@@ -41,7 +48,6 @@ namespace Venus_MainPages.ViewModels
 
         public string SearchKeyWords { get; set; }
 
-        private bool m_IsAuto;
         public bool IsAuto
         {
             get { return m_IsAuto; }
@@ -59,6 +65,30 @@ namespace Venus_MainPages.ViewModels
                 SetProperty(ref m_IsAuto, value);
             }
         }
+        public int Total
+        {
+            get { return m_Total; }
+            set
+            {             
+                SetProperty(ref m_Total, value);
+            }
+        }
+        public int PageCount
+        {
+            get { return m_PageCount; }
+            set
+            {
+                SetProperty(ref m_PageCount, value);
+            }
+        }
+        public int CurrentPage
+        {
+            get { return m_CurrentPage; }
+            set
+            {
+                SetProperty(ref m_CurrentPage, value);
+            }
+        }
         public DateTime SearchBeginTime { get; set; }
         public DateTime SearchEndTime { get; set; }
 
@@ -173,7 +203,16 @@ namespace Venus_MainPages.ViewModels
             this.view.wfTimeFrom.Value = this.SearchBeginTime;
             this.view.wfTimeTo.Value = this.SearchEndTime;
             this.Preload();
+
+            this.view.pageControl.CurrentPageChanged += PageControl_CurrentPageChanged;
+        }
+
+        private void PageControl_CurrentPageChanged(int currentPage)
+        {
+            CurrentPage = currentPage;
+            PageChanged(currentPage);
         }
+
         /// <summary>
         /// 预先载入数据
         /// </summary>
@@ -276,6 +315,12 @@ namespace Venus_MainPages.ViewModels
             {
                 try
                 {
+                    string test = $"SELECT COUNT(*) FROM \"event_data\" where \"occur_time\" >='{SearchBeginTime.ToString("yyyy/MM/dd HH:mm:ss")}' and \"occur_time\" <='{SearchEndTime.ToString("yyyyMMdd HHmmss")}';";
+                    Total = QueryDataClient.Instance.Service.GetDBEventAllCount(test);
+
+                    PageCount = (Total / m_onePageCounts) +1;
+                    
+
                     SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
                     this.SearchBeginTime = this.view.wfTimeFrom.Value;
                     this.SearchEndTime = this.view.wfTimeTo.Value;
@@ -336,7 +381,7 @@ namespace Venus_MainPages.ViewModels
                     
                     if (!string.IsNullOrEmpty(sql) && QueryDBEventFunc != null)
                     {
-                        sql += " order by \"occur_time\" DESC limit 2000;";
+                        sql += $" order by \"occur_time\" DESC limit {m_onePageCounts};";
 
                         List<EventItem> lstEvent = QueryDBEventFunc(sql);
 
@@ -396,6 +441,135 @@ namespace Venus_MainPages.ViewModels
             });
         }
 
+        public void PageChanged(int CurrentPage)
+        { 
+            Task.Factory.StartNew(() =>
+            {
+                try
+                {
+                    string test = $"SELECT COUNT(*) FROM \"event_data\" where \"occur_time\" >='{SearchBeginTime.ToString("yyyy/MM/dd HH:mm:ss")}' and \"occur_time\" <='{SearchEndTime.ToString("yyyyMMdd HHmmss")}';";                  
+                    
+
+                    SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
+                    this.SearchBeginTime = this.view.wfTimeFrom.Value;
+                    this.SearchEndTime = this.view.wfTimeTo.Value;
+
+                    string sqlEvent = "";
+                    string sqlOperationLog = "";
+                    string sql = "";
+
+                    if (SearchAlarmEvent || SearchWarningEvent || SearchInfoEvent)
+                    {
+                        sqlEvent = string.Format("SELECT \"event_id\", \"event_enum\", \"type\", \"occur_time\", \"level\",\"source\" , \"description\" FROM \"event_data\" where \"occur_time\" >='{0}' and \"occur_time\" <='{1}' ", SearchBeginTime.ToString("yyyyMMdd HHmmss"), SearchEndTime.ToString("yyyyMMdd HHmmss"));
+
+                        sqlEvent += GetSourceWhere();
+
+                        sqlEvent += " and (FALSE ";
+                        if (SearchAlarmEvent) sqlEvent += " OR \"level\"='Alarm' ";
+                        if (SearchWarningEvent) sqlEvent += " OR \"level\"='Warning' ";
+                        if (SearchInfoEvent) sqlEvent += " OR \"level\"='Information' ";
+                        sqlEvent += " ) ";
+
+                        if (!string.IsNullOrWhiteSpace(SelectedEvent) && SelectedEvent != "All") sqlEvent += string.Format(" and lower(\"event_enum\")='{0}' ", SelectedEvent.ToLower());
+
+                        //if (!string.IsNullOrWhiteSpace(SearchKeyWords)) sqlEvent += string.Format(" and lower(\"description\") like '%{0}%' ", SearchKeyWords.ToLower());
+                        if (!string.IsNullOrWhiteSpace(SearchKeyWords)) sqlEvent += string.Format(" and lower(\"description\") like '%{0}%' or lower(\"type\") like '%{1}%'", SearchKeyWords.ToLower(), SearchKeyWords.ToLower());
+                    }
+
+                    if (SearchOpeLog)
+                    {
+                        //sqlOperationLog = string.Format(" SELECT \"UserName\" as \"Initiator\", 'UserOperation' as \"LogType\", \"Time\", \"ChamberId\" as \"TargetChamber\", \"Content\" as \"Description\" FROM \"OperationLog\" where \"Time\" >='{0}' and \"Time\" <='{1}' ", SearchBeginTime.ToString("yyyy/MM/dd HH:mm:ss"), SearchEndTime.ToString("yyyy/MM/dd HH:mm:ss"));
+
+                        //if (!SearchPMA) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorA);
+                        //if (!SearchPMB) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorB);
+                        //if (!SearchPMC) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorC);
+                        //if (!SearchPMD) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.ReactorD);
+                        //if (!SearchSystem) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.System);                      
+                        //if (!SearchLL) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' ", ChamberSet.Loadlock);
+                        //if (!SearchTM) sqlOperationLog += string.Format(" and \"ChamberId\"<>'{0}' and \"ChamberId\"<>'{1}' and \"ChamberId\"<>'{2}' ",
+                        //    ChamberSet.Loadlock, ChamberSet.Buffer1, ChamberSet.Cooldown);
+                        //if (!string.IsNullOrWhiteSpace(SelectedUser) && SelectedUser != "不限") sqlOperationLog += string.Format(" and lower(\"UserName\")='{0}' ", SelectedUser.ToLower());
+
+                        //if (!string.IsNullOrWhiteSpace(SearchKeyWords)) sqlOperationLog += string.Format(" and lower(\"Content\") like '%{0}%' ", SearchKeyWords.ToLower());
+                    }
+
+                    sql = sqlEvent;
+
+                    if (!string.IsNullOrEmpty(sqlOperationLog))
+                    {
+                        if (string.IsNullOrEmpty(sql))
+                        {
+                            sql = sqlOperationLog;
+                        }
+                        else
+                        {
+                            sql += " UNION ALL " + sqlOperationLog;
+                        }
+                    }
+
+                    
+                    if (!string.IsNullOrEmpty(sql) && QueryDBEventFunc != null)
+                    {
+                        sql += $" order by \"occur_time\" DESC limit {m_onePageCounts} offset ({(CurrentPage-1) * m_onePageCounts});";
+
+                        List<EventItem> lstEvent = QueryDBEventFunc(sql);
+
+                        if (lstEvent == null)
+                            return;
+
+                        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+                        {
+                            
+
+                            string logTypeStr;
+
+                            foreach (EventItem ev in lstEvent)
+                            {
+                                switch (ev.Level)
+                                {
+                                    case EventLevel.Information: logTypeStr = "Info"; break;
+                                    case EventLevel.Warning: logTypeStr = "Warning"; break;
+                                    case EventLevel.Alarm: logTypeStr = "Alarm"; break;
+                                    default: logTypeStr = "Undefine"; break;
+                                }
+                               
+                                SearchedResult.Add(new Aitex.Core.UI.View.Common.SystemLogItem()
+                                {                
+                                    ID = ev.Id.ToString() ,
+                                    Time = ((DateTime)ev.OccuringTime).ToString("yyyy/MM/dd HH:mm:ss.fff"),
+                                    LogType = logTypeStr,
+                                    Detail = ev.Description,
+                                    TargetChamber = ev.Source,
+                                    Initiator = "",
+                                    Icon = new BitmapImage(new Uri(string.Format("pack://application:,,,/MECF.Framework.Common;component/Resources/SystemLog/{0}.png", ev.Level.ToString()), UriKind.Absolute))
+                                }); ;
+                            }
+                            RaisePropertyChanged("SearchedResult");
+
+                            //if (SearchedResult.Count >= 2000)
+                            //{
+                            //    //MessageBox.Show("Only display max 2000 items,reset the query condition", "query too many result", MessageBoxButton.OK, MessageBoxImage.Warning);
+                            //}
+
+                        }));
+                    }
+                    else
+                    {
+                        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+                        {
+                            SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
+                            RaisePropertyChanged("SearchedResult");
+                        }));
+                    }
+                }
+                catch (Exception ex)
+                {
+                    //LOG.Write(ex);
+                    LOG.WriteExeption(ex);
+                }
+            });
+
+        }
         private EventView view;
         #endregion
     }

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

@@ -1436,10 +1436,13 @@ namespace Venus_MainPages.ViewModels
             }
             AITHeaterData heaterData = obj as AITHeaterData;
             var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is Window) as Window;
-            heaterView = new HeaterView(heaterData, ModuleName);
-            heaterView.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-            heaterView.Owner = _mainWindow;
-            heaterView.Show();
+            if (heaterView == null || heaterView.IsVisible == false)
+            {
+                heaterView = new HeaterView(heaterData, ModuleName);
+                heaterView.WindowStartupLocation = WindowStartupLocation.CenterScreen;
+                heaterView.Owner = _mainWindow;
+                heaterView.Show();
+            }         
         }
 
         private void OnEndStep()

+ 4 - 1
Venus/Venus_MainPages/Views/EventView.xaml

@@ -10,6 +10,7 @@
              xmlns:prism="http://prismlibrary.com/"
              xmlns:converters="clr-namespace:Venus_Themes.Converters;assembly=Venus_Themes"
              prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:customeControl="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800" x:Name="eventView">
     <UserControl.Resources>
@@ -115,7 +116,7 @@
                         <TextBlock  Text="Total:" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
                     </Border>
                     <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="130" Height="24">
-                        <TextBlock Text="{Binding SearchedResult.Count}" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
+                        <TextBlock Text="{Binding Total}" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
                     </Border>
                     <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Width="70" Height="24">
                         <TextBlock Text="Records" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
@@ -123,6 +124,8 @@
                     <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="150" Height="24">
                         <TextBlock Text="" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
                     </Border>-->
+
+                    <customeControl:Pagination Grid.Row="2" PageCount="{Binding PageCount,UpdateSourceTrigger=PropertyChanged}" CurrentPage="{Binding CurrentPage,UpdateSourceTrigger=PropertyChanged}" Height="30" x:Name="pageControl"/>
                 </StackPanel>
 
                 <DataGrid Grid.Row="1" Margin="0,5,0,0"

+ 4 - 4
Venus/Venus_MainPages/Views/TMOperationView.xaml

@@ -33,8 +33,8 @@
     </UserControl.Resources>
     <Canvas>
 
-        <customControls:StepBar x:Name="stepBar" Width="1000" Margin="100,11,0,0"  ItemsSource="{Binding HomeAllSteps}" Progress="{Binding RtDataValues[TM.Home.StepNo]}" Visibility="{Binding TMIsHoming,Converter={StaticResource bool2VisibilityConverter}}"/>
-        <Canvas>
+        <customControls:StepBar x:Name="stepBar" Width="1000" Margin="100,5,0,0"  ItemsSource="{Binding HomeAllSteps}" Progress="{Binding RtDataValues[TM.Home.StepNo]}" Visibility="{Binding TMIsHoming,Converter={StaticResource bool2VisibilityConverter}}"/>
+        <Canvas Canvas.Top="-10">
             <userControls:FlowPipe   Height="8"  Width="180" Canvas.Left="80" Canvas.Top="50" IsFlowing="{Binding TMValveN2IsOpen}"/>
             <Image    Width="40" Height="25" Canvas.Top="42" Canvas.Left="40" Source="Pack://application:,,,/Venus_Themes;Component/Resources/Arrow.png" Stretch="Uniform"/>
             <TextBlock  FontSize="15" Canvas.Top="46" Canvas.Left="10" Text="N2"/>
@@ -476,7 +476,7 @@
             
         </Canvas>
         
-        <Canvas Canvas.Top="74" Canvas.Left="140" Width="450" Height="800">
+        <Canvas Canvas.Top="64" Canvas.Left="140" Width="450" Height="800">
             <userControls:MainTM Width="300" Height="250" Canvas.Left="380" Canvas.Top="90"/>
             <userControls:LoadLockLeft   Width="150" Height="150"  Canvas.Top="310"  Canvas.Left="358"   DoorIsOpen="{Binding RtDataValues[TM.LLATSlitDoor.IsClosed],Converter={StaticResource BoolToBool}}" Door2IsOpen="{Binding RtDataValues[TM.LLAESlitDoor.IsClosed],Converter={StaticResource BoolToBool}}"  Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" RobotWafer="{Binding LLAWafer}"/>
             <userControls:LoadLockRight  Width="150" Height="150" Canvas.Top="309"  Canvas.Left="519"    DoorIsOpen="{Binding RtDataValues[TM.LLBTSlitDoor.IsClosed],Converter={StaticResource BoolToBool}}" Door2IsOpen="{Binding RtDataValues[TM.LLBESlitDoor.IsClosed],Converter={StaticResource BoolToBool}}"  Visibility="{Binding LLBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" RobotWafer="{Binding LLBWafer}"/>
@@ -487,7 +487,7 @@
             <userControls:TMChamber x:Name="PMC" ModuleName="PMC" Canvas.Top="-37"  Canvas.Left="586" Width="140" Height="140" RotateTransformValue="29"   DoorIsOpen="{Binding RtDataValues[PMC.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMCWafer}" PMVisibility="Collapsed" IsEnabled="{Binding PMCIsInstalled}"/>
             <userControls:TMChamber x:Name="PMD" ModuleName="PMD" Canvas.Top="160"  Canvas.Left="788" Width="140" Height="140" RotateTransformValue="90"   DoorIsOpen="{Binding RtDataValues[PMD.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMDWafer}" PMVisibility="Collapsed" IsEnabled="{Binding PMDIsInstalled}"/>
         </Canvas>
-        <customControls:CommonValveControl Status="{Binding TMSoftVentValveIsOpen,Mode=TwoWay}"  ValveOrientation="Horizontal" Height="20" Width="20"  Canvas.Left="440" Canvas.Top="284"  Tag="TMPurgeValve" Command="{Binding ControlValveCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}" IsCanEdit="{Binding TMIsOFFline}"/>
+        <customControls:CommonValveControl Status="{Binding TMSoftVentValveIsOpen,Mode=TwoWay}"  ValveOrientation="Horizontal" Height="20" Width="20"  Canvas.Left="440" Canvas.Top="274"  Tag="TMPurgeValve" Command="{Binding ControlValveCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}" IsCanEdit="{Binding TMIsOFFline}"/>
         <!--<TextBlock  FontSize="15" Canvas.Top="260" Canvas.Left="350" Text="Pressure(mTorr)"/>
         <TextBox    Canvas.Top="286" Canvas.Left="354" Width="80" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>-->
 

+ 0 - 10
Venus/Venus_MainPages/Views/WaferAssociationUnit.xaml.cs

@@ -1,20 +1,10 @@
 using MECF.Framework.Common.DataCenter;
-using MECF.Framework.Common.Equipment;
 using System;
 using System.Collections.Generic;
 using System.IO;
 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 Venus_MainPages.Unity;
 
 namespace Venus_MainPages.Views

+ 3 - 12
Venus/Venus_RT/Config/System.sccfg

@@ -19,8 +19,7 @@
 		<config default="2" name="MaxInternalWaferCount" nameView="Max Internal wafer count" description="系统可允许进入的wafer数" max="8" min="1" paramter="" tag="" unit="" visible="true" type="Integer" />
 		<config default="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000" name="COMLogFlag" description="Flag for print COM data log" max="" min="" paramter="" tag="" unit="" visible="false" type="String" />
 		<config default="True" name="IsIgnoreSaveDB" nameView="IsIgnoreSaveDB" description="IO实时数据是否保存数据库,2023/09/02暂时加参数设计" max="" min="" paramter="" tag="" unit="" type="Bool" visible="false"/>
-		<config default="10"  name="CheckResourceInterval" nameView="CheckResourceInterval" description="进程资源监视间隔,单位为分钟,0为不监视" max="60" min="0" paramter="" tag="" unit="min" type="Integer"/>
-		<config default="1"  name="SystemType" nameView="SystemType" description="0 = Venus;1 = Kepler 2300;2 = Kepler 2200A;3 = Kepler 2200B;4 = Venus SE;5 = Venus DE;" max="9" min="0" paramter="" tag="" unit="min" type="Integer"/>
+		<config default="10"  name="CheckResourceInterval" nameView="CheckResourceInterval" description="进程资源监视间隔,单位为分钟,0为不监视" max="60" min="0" paramter="" tag="" unit="min" type="Integer"/>		
 		<config default="1000"  name="DataCollectionInterval" nameView="DataCollectionInterval" description="插入数据时间间隔" max="2000" min="200" paramter="" tag="" unit="ms" type="Integer"/>
 		<config default="0" name="PressureUnitType"  nameView="Pressure Unit Type" description="0=>mtorr,1=>Pa" max="1" min="0" paramter="" tag=""  unit="" type="Integer"/>
 		<config default="Kepler" name="Name" nameView="Name" description="Name" tag="" unit="" type="String" />
@@ -190,6 +189,7 @@
 		</configs>
 
 	</configs>
+	
 	<!--LLA-->
 	<configs name="LLA" nameView="LLA">
 		<config default="100" name="PumpBasePressure" nameView="Pump Base Pressure" description="" max="2000" min="0" paramter="" tag="" unit="mTorr" type="Double" />
@@ -310,6 +310,7 @@
 		</configs>
 
 	</configs>
+	
 	<!--VCE-->
 	<configs  name="VCE1" nameView="VCE1">
 		<config default="COM15" name="Port" nameView="Port" description="" max="" min="0" paramter="" tag="" unit="" type="String" />
@@ -348,7 +349,6 @@
 		<config default="1" name="OpenGasValveTimeout" nameView="Open Gas Valve Timeout" description="开阀超时" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="1" name="TimeLimitOfCloseGasValve" nameView="Time Limit Of Close Gas Valve" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="OpenCloseSlitValveTimeout" nameView="Open Close Slit Valve Timeout" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="180" name="VentTime" nameView="Vent Time" description="" max="600" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="100" name="GasFlowPressureAlarmRange" nameView="Process Pressure Alarm Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
 		<config default="60" name="GasFlowPressureAlarmTime" nameView="Process Pressure Alarm Time" description="" max="3600" min="0" paramter="" tag="" unit="second" type="Double" />
 		<config default="100" name="GasFlowPressureWarningRange" nameView="Process Pressure Warning Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
@@ -495,7 +495,6 @@
 			<!--<config default="10" name="MatchPositionC1" nameView="CycleCount" description="" max="100" min="0" paramter="" tag="" unit="" type="Double" />
       <config default="10" name="MatchPositionC2" nameView="CycleCount" description="" max="100" min="0" paramter="" tag="" unit="" type="Double" />-->
 		</configs>
-
 		<configs name="BiasRf" nameView="Bias RF" >
 			<config default="true" name="EnableBiasRF" nameView="Enable Bias RF" description="enable bias RF or not" max="1" min="0" tag="" unit="" type="Bool" />
 			<config default="2" name="MFG" nameView="MFG" description="厂商, 1:AdTec; 2:Comet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -799,7 +798,6 @@
 			<config name="TempOffsetPoint_9" nameView="Temp Offset Point 9" description="温度补偿点 9" unit="degree" type="Integer" max="300" min="0" />
 			<config name="OffsetValue_9" nameView="Offset Value 9" description="补偿值 9" unit="degree" type="Double" max="300" min="0" />
 		</configs>
-
 		<configs name="WallHeater" nameView="Heater Wall" >
 			<config default="false" name="HeaterEnableTolerance" nameView="Enable Heater Deviation Check" description="" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="200" name="HeaterAlarmRange" nameView="Heater deviation Alarm Range" description="" max="200" min="0" paramter="" tag="" unit="℃" type="Integer" />
@@ -826,7 +824,6 @@
 			<config name="TempOffsetPoint_9" nameView="Temp Offset Point 9" description="温度补偿点 9" unit="degree" type="Integer" max="300" min="0" />
 			<config name="OffsetValue_9" nameView="Offset Value 9" description="补偿值 9" unit="degree" type="Double" max="300" min="0" />
 		</configs>
-
 		<configs name="ForelineHeater" nameView="Heater Foreline" >
 			<config default="false" name="HeaterEnableTolerance" nameView="Enable Heater Deviation Check" description="" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="200" name="HeaterAlarmRange" nameView="Heater deviation Alarm Range" description="" max="200" min="0" paramter="" tag="" unit="℃" type="Integer" />
@@ -853,7 +850,6 @@
 			<config name="TempOffsetPoint_9" nameView="Temp Offset Point 9" description="温度补偿点 9" unit="degree" type="Integer" max="300" min="0" />
 			<config name="OffsetValue_9" nameView="Offset Value 9" description="补偿值 9" unit="degree" type="Double" max="300" min="0" />
 		</configs>
-
 		<configs name="ValveHeater" nameView="Valve Heater" >
 			<config default="false" name="HeaterEnableTolerance" nameView="Enable Heater Deviation Check" description="" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="200" name="HeaterAlarmRange" nameView="Heater deviation Alarm Range" description="" max="200" min="0" paramter="" tag="" unit="℃" type="Integer" />
@@ -922,7 +918,6 @@
 			<config default="100"  name="TurboPumpSpeedLimit"  nameView="Turbo PumpSpeed Limit" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
 
 		</configs>
-
 		<!--Clean-->
 		<configs name="IdleClean" nameView="Idle Clean" visible="false">
 			<config default="0" name="Option" nameView="Idle Clean Option" description="0, disable; 1, By Idle Time; 2, By Wafer Count" max="2" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -932,7 +927,6 @@
 			<config default="0" name="WaferCountSinceLastClean" nameView="Wafer Count Since Last Clean" description="Wafer Count Since Last Runing Clean" max="100000" min="0" paramter="" tag="" unit="pcs" type="Integer" />
 			<config default="" name="LastRunTime" nameView="The Time Chamber Last Run Wafer" description="The Time Chamber Last Run Wafer" max="" min="" paramter="" tag="" unit="" type="String" />
 		</configs>
-
 		<configs name="EPD" nameView="EPD Setting">
 			<config default="true" name="IsEnabled" nameView="Is Enabled" description="IsEnabled" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="0" name="ChannelNumber" nameView="EPD Channel Number" description="channel number" max="32" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -963,7 +957,6 @@
 		<config default="1" name="OpenGasValveTimeout" nameView="Open Gas Valve Timeout" description="开阀超时" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="1" name="TimeLimitOfCloseGasValve" nameView="Time Limit Of Close Gas Valve" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="OpenCloseSlitValveTimeout" nameView="Open Close Slit Valve Timeout" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="180" name="VentTime" nameView="Vent Time" description="" max="600" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="100" name="GasFlowPressureAlarmRange" nameView="Process Pressure Alarm Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
 		<config default="60" name="GasFlowPressureAlarmTime" nameView="Process Pressure Alarm Time" description="" max="3600" min="0" paramter="" tag="" unit="second" type="Double" />
 		<config default="100" name="GasFlowPressureWarningRange" nameView="Process Pressure Warning Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
@@ -1562,7 +1555,6 @@
 		<config default="1" name="OpenGasValveTimeout" nameView="Open Gas Valve Timeout" description="开阀超时" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="1" name="TimeLimitOfCloseGasValve" nameView="Time Limit Of Close Gas Valve" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="OpenCloseSlitValveTimeout" nameView="Open Close Slit Valve Timeout" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="180" name="VentTime" nameView="Vent Time" description="" max="600" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="100" name="GasFlowPressureAlarmRange" nameView="Process Pressure Alarm Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
 		<config default="60" name="GasFlowPressureAlarmTime" nameView="Process Pressure Alarm Time" description="" max="3600" min="0" paramter="" tag="" unit="second" type="Double" />
 		<config default="100" name="GasFlowPressureWarningRange" nameView="Process Pressure Warning Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
@@ -2163,7 +2155,6 @@
 		<config default="1" name="OpenGasValveTimeout" nameView="Open Gas Valve Timeout" description="开阀超时" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="1" name="TimeLimitOfCloseGasValve" nameView="Time Limit Of Close Gas Valve" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="1" name="OpenCloseSlitValveTimeout" nameView="Open Close Slit Valve Timeout" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="180" name="VentTime" nameView="Vent Time" description="" max="600" min="0" paramter="" tag="" unit="second" type="Integer" />
 		<config default="100" name="GasFlowPressureAlarmRange" nameView="Process Pressure Alarm Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
 		<config default="60" name="GasFlowPressureAlarmTime" nameView="Process Pressure Alarm Time" description="" max="3600" min="0" paramter="" tag="" unit="second" type="Double" />
 		<config default="100" name="GasFlowPressureWarningRange" nameView="Process Pressure Warning Range" description="" max="760000" min="0" paramter="" tag="" unit="mtorr" type="Double" />

+ 1 - 1
Venus/Venus_RT/Devices/RevtechMatch.cs

@@ -68,7 +68,7 @@ namespace Venus_RT.Devices
 
         private void _socket_OnErrorHappened(ErrorEventArgsDevice args)
         {
-            LOG.Write(eEvent.ERR_RF, Module, $"{Module} Comet RF Error {args.Reason}");
+            LOG.Write(eEvent.ERR_MATCH, Module, $"{Module} Revtech Match Error {args.Reason}");
         }
 
         public override bool Initialize()

+ 213 - 0
Venus/Venus_Themes/CustomControls/Pagination.cs

@@ -0,0 +1,213 @@
+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.Media;
+
+
+namespace Venus_Themes.CustomControls
+{
+    public class Pagination : Control
+    {
+        private Venus_Themes.UserControls.PathButton _btnPrev = null;
+        private Button _btnOne = null;
+        private Button _btnDotPrev = null;
+        private Button _btnCenterOne = null;
+        private Button _btnCenterTwo = null;
+        private Button _btnCenterThree = null;
+        private Button _btnCenterFour = null;
+        private Button _btnCenterFive = null;
+        private Button _btnDotNext = null;
+        private Button _btnLast = null;
+        private Venus_Themes.UserControls.PathButton _btnNext = null;
+        public Action<int> CurrentPageChanged;
+        public int PageCount
+        {
+            get { return (int)GetValue(PageCountProperty); }
+            set 
+            {
+                SetValue(PageCountProperty, value);                
+            }
+        }
+        public static readonly DependencyProperty PageCountProperty =
+            DependencyProperty.Register("PageCount", typeof(int), typeof(Pagination), new PropertyMetadata(1, (d, e) =>
+            {
+                if (!(d is Pagination pagination)) return;
+                var page = (int)e.NewValue;
+                pagination.IsSimple = page < 6;
+            }));
+        public bool IsSimple
+        {
+            get { return (bool)GetValue(IsSimpleProperty); }
+            set { SetValue(IsSimpleProperty, value); }
+        }
+        public static readonly DependencyProperty IsSimpleProperty =
+            DependencyProperty.Register("IsSimple", typeof(bool), typeof(Pagination), new PropertyMetadata(false));
+
+
+        public int CurrentPage
+        {
+            get { return (int)GetValue(CurrentPageProperty); }
+            set 
+            { 
+                SetValue(CurrentPageProperty, value);
+                CurrentPageChanged(value);
+            }
+        }
+        public static readonly DependencyProperty CurrentPageProperty =
+            DependencyProperty.Register("CurrentPage", typeof(int), typeof(Pagination), new PropertyMetadata(1, (d, e) =>
+            {
+                if (!(d is Pagination pagination)) return;
+                if (pagination.PageCount > 5)
+                {
+                    pagination.UpdateControl();
+                }
+                else
+                {
+                    pagination.UpdateControlSimple();
+                }
+            }));
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+
+
+            if (PageCount > 5)
+            {
+                InitControls();
+            }
+            else
+            {
+                InitControlsSimple();
+            }
+        }
+        private List<Button> _simpleButtons = new List<Button>();
+        private void InitControlsSimple()
+        {
+            _btnPrev = GetTemplateChild("btnPrev") as Venus_Themes.UserControls.PathButton;
+            if (_btnPrev == null) 
+            {
+                return;
+            }
+            _btnCenterOne = GetTemplateChild("btnCenterOne") as Button;
+            _btnCenterTwo = GetTemplateChild("btnCenterTwo") as Button;
+            _btnCenterThree = GetTemplateChild("btnCenterThree") as Button;
+            _btnCenterFour = GetTemplateChild("btnCenterFour") as Button;
+            _btnCenterFive = GetTemplateChild("btnCenterFive") as Button;
+            _btnNext = GetTemplateChild("btnNext") as Venus_Themes.UserControls.PathButton;
+            _simpleButtons.Clear();
+            _simpleButtons.Add(_btnCenterOne);
+            _simpleButtons.Add(_btnCenterTwo);
+            _simpleButtons.Add(_btnCenterThree);
+            _simpleButtons.Add(_btnCenterFour);
+            _simpleButtons.Add(_btnCenterFive);
+            BindClickSimple();
+            UpdateControlSimple();
+        }
+
+
+        private void UpdateControlSimple()
+        {
+            if (_btnCenterOne == null)
+            {
+                return;
+            }
+            _btnCenterOne.Visibility = PageCount >= 1 ? Visibility.Visible : Visibility.Collapsed;
+            _btnCenterTwo.Visibility = PageCount >= 2 ? Visibility.Visible : Visibility.Collapsed;
+            _btnCenterThree.Visibility = PageCount >= 3 ? Visibility.Visible : Visibility.Collapsed;
+            _btnCenterFour.Visibility = PageCount >= 4 ? Visibility.Visible : Visibility.Collapsed;
+            _btnCenterFive.Visibility = PageCount >= 5 ? Visibility.Visible : Visibility.Collapsed;
+            _btnPrev.IsEnabled = CurrentPage > 1;
+            _btnNext.IsEnabled = CurrentPage < PageCount;
+            _btnCenterOne.Background = _btnCenterTwo.Background = _btnCenterThree.Background = _btnCenterFour.Background = _btnCenterFive.Background = Brushes.LightBlue;
+            _simpleButtons[CurrentPage - 1].Background = Brushes.Green;
+        }
+
+
+        private void BindClickSimple()
+        {
+            _btnPrev.Click += (s, e) => CurrentPage -= 1;
+            _btnCenterOne.Click += (s, e) => CurrentPage = 1;
+            _btnCenterTwo.Click += (s, e) => CurrentPage = 2;
+            _btnCenterThree.Click += (s, e) => CurrentPage = 3;
+            _btnCenterFour.Click += (s, e) => CurrentPage = 4;
+            _btnCenterFive.Click += (s, e) => CurrentPage = 5;
+            _btnNext.Click += (s, e) => CurrentPage += 1;
+        }
+
+
+        private void InitControls()
+        {
+            _btnPrev = GetTemplateChild("btnPrev") as Venus_Themes.UserControls.PathButton;
+            _btnOne = GetTemplateChild("btnOne") as Button;
+            _btnDotPrev = GetTemplateChild("btnDotPrev") as Button;
+            _btnCenterOne = GetTemplateChild("btnCenterOne") as Button;
+            _btnCenterTwo = GetTemplateChild("btnCenterTwo") as Button;
+            _btnCenterThree = GetTemplateChild("btnCenterThree") as Button;
+            _btnCenterFour = GetTemplateChild("btnCenterFour") as Button;
+            _btnCenterFive = GetTemplateChild("btnCenterFive") as Button;
+            _btnDotNext = GetTemplateChild("btnDotNext") as Button;
+            _btnLast = GetTemplateChild("btnLast") as Button;
+            _btnNext = GetTemplateChild("btnNext") as Venus_Themes.UserControls.PathButton;
+            BindClick();
+            UpdateControl();
+        }
+        private void BindClick()
+        {
+            _btnPrev.Click += (s, e) => SetIndex(-1);
+            _btnOne.Click += (s, e) => SetIndex(1 - CurrentPage);
+            _btnDotPrev.Click += (s, e) => SetIndex(-3);
+            _btnCenterOne.Click += (s, e) => SetIndex(-2);
+            _btnCenterTwo.Click += (s, e) => SetIndex(-1);
+            _btnCenterFour.Click += (s, e) => SetIndex(1);
+            _btnCenterFive.Click += (s, e) => SetIndex(2);
+            _btnDotNext.Click += (s, e) => SetIndex(3);
+            _btnLast.Click += (s, e) => SetIndex(PageCount - CurrentPage);
+            _btnNext.Click += (s, e) => SetIndex(1);
+        }
+        public void SetIndex(int page)
+        {
+            if (page < 0)
+            {
+                if (CurrentPage + page > 0)
+                {
+                    CurrentPage += page;
+                }
+            }
+            else if (page > 0)
+            {
+                if (CurrentPage + page <= PageCount)
+                {
+                    CurrentPage += page;
+                }
+            }
+        }
+
+
+        private void UpdateControl()
+        {
+            _btnPrev.IsEnabled = CurrentPage > 1;
+            _btnOne.Visibility = CurrentPage < 4 ? Visibility.Collapsed : Visibility.Visible;
+            _btnDotPrev.Visibility = CurrentPage < 4 ? Visibility.Collapsed : Visibility.Visible;
+            _btnCenterOne.Visibility = CurrentPage != 3 && CurrentPage != PageCount ? Visibility.Collapsed : Visibility.Visible;
+            _btnCenterTwo.Visibility = CurrentPage == 1 || (PageCount - CurrentPage) == 2 ? Visibility.Collapsed : Visibility.Visible;
+            _btnCenterFour.Visibility = CurrentPage == 3 || CurrentPage == PageCount ? Visibility.Collapsed : Visibility.Visible;
+            _btnCenterFive.Visibility = CurrentPage != 1 && (PageCount - CurrentPage) != 2 ? Visibility.Collapsed : Visibility.Visible;
+            _btnDotNext.Visibility = PageCount - CurrentPage < 3 ? Visibility.Collapsed : Visibility.Visible;
+            _btnLast.Visibility = PageCount - CurrentPage < 3 ? Visibility.Collapsed : Visibility.Visible;
+            _btnNext.IsEnabled = CurrentPage != PageCount;
+
+
+            _btnOne.Content = 1;
+            _btnCenterOne.Content = CurrentPage - 2;
+            _btnCenterTwo.Content = CurrentPage - 1;
+            _btnCenterThree.Content = CurrentPage;
+            _btnCenterFour.Content = CurrentPage + 1;
+            _btnCenterFive.Content = CurrentPage + 2;
+            _btnLast.Content = PageCount;
+        }
+    }
+}

File diff suppressed because it is too large
+ 103 - 0
Venus/Venus_Themes/Themes/Generic.xaml


+ 68 - 0
Venus/Venus_Themes/UserControls/PathButton.xaml

@@ -0,0 +1,68 @@
+<Button x:Class="Venus_Themes.UserControls.PathButton"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:Venus_Themes.UserControls"
+             mc:Ignorable="d" 
+             Style="{DynamicResource PathButtonStyle}"
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Button.Resources>
+        <Style x:Key="FocusVisual">
+            <Setter Property="Control.Template">
+                <Setter.Value>
+                    <ControlTemplate>
+                        <Rectangle Margin="2"
+                                   SnapsToDevicePixels="true"
+                                   Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                                   StrokeDashArray="1 2"
+                                   StrokeThickness="1" />
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <Style x:Key="PathButtonStyle"
+               TargetType="{x:Type Button}">
+            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+            <Setter Property="Background" Value="#00000000" />
+            <Setter Property="BorderBrush" Value="#00000000" />
+            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+            <Setter Property="BorderThickness" Value="0,1,1,1" />
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="VerticalContentAlignment" Value="Center" />
+            <Setter Property="Padding" Value="1" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Border x:Name="border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                SnapsToDevicePixels="true">
+                            <Path x:Name="Path"
+                                  Data="{Binding PathData}"
+                                  Fill="{Binding DefaultFillBrush}"
+                                  RenderTransformOrigin="0.5,0.5"
+                                  Stretch="Uniform" />
+                        </Border>
+
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsDefaulted" Value="True">
+                                <Setter TargetName="Path" Property="Fill" Value="{Binding DefaultFillBrush}" />
+                            </Trigger>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter TargetName="Path" Property="Fill" Value="{Binding MouseOverBrush}" />
+                            </Trigger>
+                            <Trigger Property="IsPressed" Value="True">
+                                <Setter TargetName="Path" Property="Fill" Value="{Binding IsPressedBrush}" />
+                            </Trigger>
+                            <Trigger Property="IsEnabled" Value="False">
+                                <Setter TargetName="Path" Property="Fill" Value="{Binding IsEnabledBrush}" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+    </Button.Resources>
+</Button>

+ 67 - 0
Venus/Venus_Themes/UserControls/PathButton.xaml.cs

@@ -0,0 +1,67 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace Venus_Themes.UserControls
+{
+    /// <summary>
+    /// PathButton.xaml 的交互逻辑
+    /// </summary>
+    public partial class PathButton :Button
+    {
+        public PathButton()
+        {
+            InitializeComponent();
+            DataContext = this;
+        }
+        public Geometry PathData
+        {
+            get { return (Geometry)GetValue(PathDataProperty); }
+            set { SetValue(PathDataProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PathData.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathDataProperty =
+            DependencyProperty.Register("PathData", typeof(Geometry), typeof(PathButton), new PropertyMetadata(new PathGeometry()));
+
+        public Brush DefaultFillBrush
+        {
+            get { return (Brush)GetValue(DefaultFillBrushProperty); }
+            set { SetValue(DefaultFillBrushProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for DefaultFillBrush.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty DefaultFillBrushProperty =
+            DependencyProperty.Register("DefaultFillBrush", typeof(Brush), typeof(PathButton), new PropertyMetadata(Brushes.DarkGray));
+
+        public Brush MouseOverBrush
+        {
+            get { return (Brush)GetValue(MouseOverBrushProperty); }
+            set { SetValue(MouseOverBrushProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MouseOverBrush.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty MouseOverBrushProperty =
+            DependencyProperty.Register("MouseOverBrush", typeof(Brush), typeof(PathButton), new PropertyMetadata(Brushes.DeepSkyBlue));
+
+        public Brush IsPressedBrush
+        {
+            get { return (Brush)GetValue(IsPressedBrushProperty); }
+            set { SetValue(IsPressedBrushProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for IsPressedBrush.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty IsPressedBrushProperty =
+            DependencyProperty.Register("IsPressedBrush", typeof(Brush), typeof(PathButton), new PropertyMetadata(Brushes.DodgerBlue));
+
+        public Brush IsEnabledBrush
+        {
+            get { return (Brush)GetValue(IsEnabledBrushProperty); }
+            set { SetValue(IsEnabledBrushProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for IsEnabledBrush.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty IsEnabledBrushProperty =
+            DependencyProperty.Register("IsEnabledBrush", typeof(Brush), typeof(PathButton), new PropertyMetadata(Brushes.LightGray));
+    }
+}

+ 8 - 0
Venus/Venus_Themes/Venus_Themes.csproj

@@ -106,6 +106,7 @@
     <Compile Include="CustomControls\GuangChuanRobot.cs" />
     <Compile Include="CustomControls\CustomRobot.cs" />
     <Compile Include="CustomControls\MultiComboBox.cs" />
+    <Compile Include="CustomControls\Pagination.cs" />
     <Compile Include="CustomControls\PathButton.cs" />
     <Compile Include="CustomControls\SERobot.cs" />
     <Compile Include="CustomControls\SplitButton.cs" />
@@ -169,6 +170,9 @@
     <Compile Include="UserControls\MainTM.xaml.cs">
       <DependentUpon>MainTM.xaml</DependentUpon>
     </Compile>
+    <Compile Include="UserControls\PathButton.xaml.cs">
+      <DependentUpon>PathButton.xaml</DependentUpon>
+    </Compile>
     <Compile Include="UserControls\Pipe2.xaml.cs">
       <DependentUpon>Pipe2.xaml</DependentUpon>
     </Compile>
@@ -382,6 +386,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="UserControls\PathButton.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="UserControls\Pipe2.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 6 - 0
Venus/Venus_Themes/unity/UIEvents.cs

@@ -32,6 +32,12 @@ namespace Venus_Themes.Unity
         {
             ChamberCreateDeleteWaferEvent?.Invoke(para);
         }
+
+        public static event Action<int> CurrentPageChangedEvent;
+        public static void OnCurrentPageChanged(int para)
+        {
+            CurrentPageChangedEvent?.Invoke(para);
+        }
     }
     public class DoorPara
     {