Browse Source

1.增加prcocessdatahistory 页面GridSplitter,excel导出等功能,增加FA界面

Intern01 1 year ago
parent
commit
8a99234204

+ 14 - 0
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -42,6 +42,12 @@
     <Reference Include="ControlzEx">
       <HintPath>..\ThirdParty\ControlzEx.dll</HintPath>
     </Reference>
+    <Reference Include="ExcelLibrary">
+      <HintPath>..\ThirdParty\ExcelLibrary.dll</HintPath>
+    </Reference>
+    <Reference Include="FabConnect">
+      <HintPath>..\ThirdParty\FabConnect.dll</HintPath>
+    </Reference>
     <Reference Include="LiveCharts">
       <HintPath>..\ThirdParty\LiveCharts.dll</HintPath>
     </Reference>
@@ -146,6 +152,7 @@
     <Compile Include="ViewModels\DataHistoryViewModel.cs" />
     <Compile Include="ViewModels\EfemViewModel.cs" />
     <Compile Include="ViewModels\EventViewModel.cs" />
+    <Compile Include="ViewModels\FaViewModel.cs" />
     <Compile Include="ViewModels\GasLeakCheckViewModel.cs" />
     <Compile Include="ViewModels\IOViewModel.cs" />
     <Compile Include="ViewModels\MFCVerificationViewModel.cs" />
@@ -227,6 +234,9 @@
     <Compile Include="Views\TopView.xaml.cs">
       <DependentUpon>TopView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\FaView.xaml.cs">
+      <DependentUpon>FaView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\VATPerformanceView.xaml.cs">
       <DependentUpon>VATPerformanceView.xaml</DependentUpon>
     </Compile>
@@ -341,6 +351,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\FaView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\VATPerformanceView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 19 - 0
Venus/Venus_MainPages/ViewModels/FaViewModel.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Prism.Commands;
+using Prism.Mvvm;
+using Venus_MainPages.Unity;
+using Venus_MainPages.Views;
+using System.Threading.Tasks;
+
+namespace Venus_MainPages.ViewModels
+{
+    public class FaViewModel:BindableBase
+    {
+        #region 私有变量
+
+        #endregion
+    }
+}

+ 198 - 82
Venus/Venus_MainPages/ViewModels/ProcessHistoryViewModel.cs

@@ -26,27 +26,61 @@ namespace Venus_MainPages.ViewModels
 {
     public class ProcessHistoryViewModel : BindableBase
     {
+        #region 私有字段
         private ProcessHistoryView view;
         List<string> keys = new List<string>();
         RealtimeProvider _provider = new RealtimeProvider();
         private ObservableCollection<ParameterNode> _ParameterNodes;
         DispatcherTimer timer = new DispatcherTimer();
+        ObservableCollection<PdKeyData>_PdKeyDataObservation= new ObservableCollection<PdKeyData>();
         public List<string> RecipesAdd=new List<string>();
+        public List<SolidColorBrush> solidColorBrushes = new List<SolidColorBrush>();
         DateTime currentTime;
+        #endregion
+        #region 属性
+        public List<HistoryDataItem> ProcessData { get; set; }
+        public List<Recipeslist> CheboxRecipes { get; set; }
+        public ProcessDataChartDataItem ProcessChartData{  get; set;  }
+        public DateTime StartDateTime { get; set; }
+        public DateTime EndDateTime { get; set; }
+        public string SelectedValuePM { get; set; }
+        public string RecipeName { get; set; }
+        public ObservableCollection<RecipeItem> Recipes { get; set; }
+   
+        public class Recipeslist
+        {
+            public string BoxName { get; set; }
+        }
+        public class RecipeAdd
+        {
+            public string Recipesname { get; set; }
+        }
+
+        public ObservableCollection<ParameterNode> ParameterNodes
+        {
+            get { return _ParameterNodes; }
+            set { SetProperty(ref _ParameterNodes, value); }
+        }
+        public ObservableCollection<PdKeyData> PdKeyDataCollection
+        {
+            get { return _PdKeyDataObservation; }
+            set { SetProperty(ref _PdKeyDataObservation,value); }
+        }
+        #endregion
+
+        #region 命令
         private DelegateCommand<object> _LoadCommandPD;
         public DelegateCommand<object> LoadCommandPD =>
             _LoadCommandPD ?? (_LoadCommandPD = new DelegateCommand<object>(OnLoadPd));
         private DelegateCommand _SearchRecipeCommand;
         public DelegateCommand SearchRecipeCommand =>
         _SearchRecipeCommand ?? (_SearchRecipeCommand = new DelegateCommand(SearchRecipe));
+        private DelegateCommand<object> _PdParameterCheckCommand;
+        public DelegateCommand<object> PdParameterCheckCommand=>
+           _PdParameterCheckCommand??(_PdParameterCheckCommand=new DelegateCommand<object>(OnParameterCheck));
+        #endregion
 
-        //private string _starttime;
-        //public string starttime 
-        //{ get { return _starttime; } set {  SetProperty(ref _starttime, value); } }
-        // public string starttime { get; set; }
-
-        public List<HistoryDataItem> ProcessData { get; set; }
-        //public List<Recipeslist> CheboxRecipes = new List<Recipeslist>();
+        #region 构造函数
         public ProcessHistoryViewModel()
         {
             ProcessChartData = new ProcessDataChartDataItem(60000);
@@ -54,17 +88,19 @@ namespace Venus_MainPages.ViewModels
             Recipes = new ObservableCollection<RecipeItem>();
             timer.Interval = TimeSpan.FromSeconds(0.5);
             CheboxRecipes = new List<Recipeslist>();
-            //CheboxRecipes.Add(new Recipeslist { BoxName = "test" });
-           // CheboxRecipes.Add(new Recipeslist { BoxName = "test2" });
-            //CheboxRecipes.Add(new Recipeslist { BoxName = "test3" });
-            //starttime = "1999-10-01";
-        }
-        public List<Recipeslist> CheboxRecipes { get; set; }
-        public ProcessDataChartDataItem ProcessChartData
-        {
-            get;
-            set;
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Green));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Red));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Blue));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Orange));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Yellow));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.YellowGreen));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.AliceBlue));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Chocolate));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.Cyan));
+            solidColorBrushes.Add(new SolidColorBrush(Colors.DarkGreen));
         }
+        #endregion
+        #region 命令方法
         private void OnLoadPd(Object eventView)
         {
             this.view = (ProcessHistoryView)eventView;
@@ -72,53 +108,24 @@ namespace Venus_MainPages.ViewModels
             this.view.wfTimeTo.Value = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59, 999);
             this.LoadRecipeCheckBox();
         }
+        
         private void LoadRecipeCheckBox()
         {
-            string path= Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes","PMA");
-            if (Directory.Exists(path)) {
-                string[] dir = Directory.GetFiles(path);
-                for (int i = 0; i < dir.Length; i++)
+            List<string> chamber = new List<string>() { "PMA","PMB","PMC","PMD"};
+            CheboxRecipes.Clear();
+            foreach (string item in chamber)
+            {
+                string path = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", item);
+                if (Directory.Exists(path))
                 {
-                    CheboxRecipes.Add(new Recipeslist { BoxName = Path.GetFileName(dir[i])});
+                    string[] dir = Directory.GetFiles(path);
+                    for (int i = 0; i < dir.Length; i++)
+                    {
+                        CheboxRecipes.Add(new Recipeslist { BoxName = Path.GetFileName(dir[i]) });
+                    }
                 }
             }
         }
-        //Path.GetFileName(dir[i]).ToString()
-        public DateTime StartDateTime { get; set; }
-        public DateTime EndDateTime { get; set; }
-        public string SelectedValuePM { get; set; }
-        public string RecipeName { get; set; }
-        public class RecipeItem
-        {
-            public bool Selected { get; set; }
-            public string Recipe { get; set; }
-            public string Guid { get; set; }
-            public string RecipeRunGuid { get; set; }
-            public string Chamber { get; set; }
-            public string Status { get; set; }
-            public string StartTime { get; set; }
-            public string EndTime { get; set; }
-            public string LotID { get; set; }
-            public string SlotID { get; set; }
-        }
-        public class Recipeslist
-        {
-            public string BoxName { get; set; }
-        }
-        public class RecipeAdd
-        {
-            public string Recipesname { get; set; }
-        }
-        public ObservableCollection<RecipeItem> Recipes { get; set; }
-        public ObservableCollection<ParameterNode> ParameterNodes
-        {
-            get { return _ParameterNodes; }
-            set { SetProperty(ref _ParameterNodes, value); }
-
-        }
-
-
-
         public void SearchRecipe()
         {
             //if (MenuPermission != 3) return;
@@ -152,7 +159,7 @@ namespace Venus_MainPages.ViewModels
                 sql += " order by \"process_begin_time\" ASC;";
                 
                 DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
-                
+
 
                 Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                 {
@@ -161,7 +168,7 @@ namespace Venus_MainPages.ViewModels
                     for (int i = 0; i < dbData.Rows.Count; i++)
                     {
                         RecipeItem item = new RecipeItem();
-
+                        item.Selected = false;
                         item.Recipe = dbData.Rows[i]["recipe_name"].ToString();
                         item.Guid = dbData.Rows[i]["guid"].ToString();
                         item.RecipeRunGuid = dbData.Rows[i]["wafer_data_guid"].ToString();
@@ -271,7 +278,99 @@ namespace Venus_MainPages.ViewModels
             return historyData;
 
         }
+        private bool RefreshTreeStatusToChild(ParameterNode node)
+        {
+            if (node.ChildNodes.Count > 0)
+            {
+                for (int i = 0; i < node.ChildNodes.Count; i++)
+                {
+                    ParameterNode n = node.ChildNodes[i];
+                    n.Selected = node.Selected;
+
+                    if (!RefreshTreeStatusToChild(n))
+                    {
+                        //uncheck left node
+                        for (int j = i; j < node.ChildNodes.Count; j++)
+                        {
+                            node.ChildNodes[j].Selected = !node.Selected;
+                        }
+                        //node.Selected = !node.Selected;
+                        return false;
+                    }
+                }
+            }
+            //else
+            //{
+            //    if (node.Selected == true)
+            //    {
+            //        keys.Add(node.Name);
+            //    }
+            //    else
+            //    { 
+            //    keys.Remove(node.Name);
+            //    }
+            //}     
+            return true;
+        }
+        private void RefreshTreeStatusToParent(ParameterNode node)
+        {
+            if (node.ParentNode != null)
+            {
+                if (node.Selected)
+                {
+                    bool flag = true;
+                    for (int i = 0; i < node.ParentNode.ChildNodes.Count; i++)
+                    {
+                        if (!node.ParentNode.ChildNodes[i].Selected)
+                        {
+                            flag = false;  //as least one child is unselected
+                            break;
+                        }
+                    }
+                    if (flag)
+                        node.ParentNode.Selected = true;
+                }
+                else
+                {
+                    node.ParentNode.Selected = false;
+                }
+                RefreshTreeStatusToParent(node.ParentNode);
+
+            }
+        }
+        private void OnParameterCheck(object obj)
+        {
+            ParameterNode node = obj as ParameterNode;
+            if (!RefreshTreeStatusToChild(node))
+            {
+                node.Selected = !node.Selected;
+            }
+            else
+            {
+                RefreshTreeStatusToParent(node);
+            }
+
+            keys.Clear();
+            for (int i = 0; i < ParameterNodes.Count; i++)
+            {
+                CalKeys(ParameterNodes[i]);
+            }
+            if (keys.Count > 10)
+            {
+                WPFMessageBox.ShowWarning("最多显示10个数据");
+                return;
+            }
+            PdKeyDataCollection.Clear();
+            for (int i = 0; i < keys.Count; i++)
+            {
+                if (i == 10)
+                {
+                    break;
+                }
+                PdKeyDataCollection.Add(new PdKeyData() { Key = keys[i], Color = solidColorBrushes[i] });
+            }
 
+        }
         public void UpdateData(RecipeItem dataLog)
         {
             if (dataLog == null)
@@ -289,26 +388,24 @@ namespace Venus_MainPages.ViewModels
                 WPFMessageBox.ShowWarning("最多显示10个数据");
                 return;
             }
+            //Application.Current.Dispatcher.Invoke(new Action(() =>
+            //{
+            //    string type = "A";
+            //    string s = dataLog.Chamber;
 
-
-            Application.Current.Dispatcher.Invoke(new Action(() =>
-            {
-                string type = "A";
-                string s = dataLog.Chamber;
-
-                if (dataLog.Chamber == "PMA")
-                {
-                    //keys = new List<string> { "IO.PMA.AI_Chamber_Pressure", "PMA.Rf.PowerSetPoint", "PMA.Rf.ForwardPower", "PMA.Rf.ReflectPower", "PMA.IoMfc.MfcGas1.FeedBack", "PMA.IoMfc.MfcGas1.SetPoint", "PMA.IoMfc.MfcGas2.FeedBack", "PMA.IoMfc.MfcGas2.SetPoint", "PMA.IoMfc.MfcGas3.FeedBack", "PMA.IoMfc.MfcGas3.SetPoint" };
-                    if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMA.BiasRf.EnableBiasRF"))
-                        type = "A";
-                }
-                else if (dataLog.Chamber == "PMB")
-                {
-                   // keys = new List<string> { "IO.PMB.AI_Chamber_Pressure", "PMB.Rf.PowerSetPoint", "PMB.Rf.ForwardPower", "PMB.Rf.ReflectPower", "PMB.IoMfc.MfcGas1.FeedBack", "PMB.IoMfc.MfcGas1.SetPoint", "PMB.IoMfc.MfcGas2.FeedBack", "PMB.IoMfc.MfcGas2.SetPoint", "PMB.IoMfc.MfcGas3.FeedBack", "PMB.IoMfc.MfcGas3.SetPoint" };
-                    if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMB.BiasRf.EnableBiasRF"))
-                        type = "B";
-                }
-            }));          
+            //    if (dataLog.Chamber == "PMA")
+            //    {
+            //        //keys = new List<string> { "IO.PMA.AI_Chamber_Pressure", "PMA.Rf.PowerSetPoint", "PMA.Rf.ForwardPower", "PMA.Rf.ReflectPower", "PMA.IoMfc.MfcGas1.FeedBack", "PMA.IoMfc.MfcGas1.SetPoint", "PMA.IoMfc.MfcGas2.FeedBack", "PMA.IoMfc.MfcGas2.SetPoint", "PMA.IoMfc.MfcGas3.FeedBack", "PMA.IoMfc.MfcGas3.SetPoint" };
+            //        if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMA.BiasRf.EnableBiasRF"))
+            //            type = "A";
+            //    }
+            //    else if (dataLog.Chamber == "PMB")
+            //    {
+            //       // keys = new List<string> { "IO.PMB.AI_Chamber_Pressure", "PMB.Rf.PowerSetPoint", "PMB.Rf.ForwardPower", "PMB.Rf.ReflectPower", "PMB.IoMfc.MfcGas1.FeedBack", "PMB.IoMfc.MfcGas1.SetPoint", "PMB.IoMfc.MfcGas2.FeedBack", "PMB.IoMfc.MfcGas2.SetPoint", "PMB.IoMfc.MfcGas3.FeedBack", "PMB.IoMfc.MfcGas3.SetPoint" };
+            //        if ((bool)QueryDataClient.Instance.Service.GetConfig($"PMB.BiasRf.EnableBiasRF"))
+            //            type = "B";
+            //    }
+            //}));          
             this.view.MyDrawGraphicsControl.ClearPlotPoints();
             DateTime dtFrom = Convert.ToDateTime(dataLog.StartTime);
             DateTime dtTo = dtFrom.AddMinutes(10);
@@ -332,9 +429,28 @@ namespace Venus_MainPages.ViewModels
             }
             this.view.MyDrawGraphicsControl.PointCollections = cls;
             this.view.MyDrawGraphicsControl.FitControl();
-        }
-
-        
+        }       
         
     }
+    #endregion
+    #region 数据类
+    public class RecipeItem
+    {
+        public bool Selected { get; set; }
+        public string Recipe { get; set; }
+        public string Guid { get; set; }
+        public string RecipeRunGuid { get; set; }
+        public string Chamber { get; set; }
+        public string Status { get; set; }
+        public string StartTime { get; set; }
+        public string EndTime { get; set; }
+        public string LotID { get; set; }
+        public string SlotID { get; set; }
+    }
+    public class PdKeyData
+    {
+        public string Key { get; set; }
+        public SolidColorBrush Color { get; set; }
+    }
+    #endregion
 }

+ 157 - 0
Venus/Venus_MainPages/Views/FaView.xaml

@@ -0,0 +1,157 @@
+<UserControl x:Class="Venus_MainPages.Views.FaView"
+             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:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
+             xmlns:local="clr-namespace:Venus_MainPages.Views"
+             xmlns:ctrls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
+             mc:Ignorable="d" 
+             d:DesignHeight="1024" d:DesignWidth="1580">
+
+    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="500"></ColumnDefinition>
+            <ColumnDefinition Width="500"></ColumnDefinition>
+            <ColumnDefinition Width="500"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <TabControl Height="400" Background="{DynamicResource Table_BG_Content}">
+            <TabControl.Resources>
+                <Style TargetType="{x:Type TabPanel}">
+                    <Setter Property="HorizontalAlignment" Value="Center"/>
+                    <Setter Property="Background" Value="{DynamicResource Color_BG_Button}"/>
+                </Style>
+            </TabControl.Resources>
+            <TabItem Header="Host Communication" >
+                <Grid Margin="5">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="Auto" />
+                    </Grid.RowDefinitions>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="180"/>
+                        <ColumnDefinition Width="*"/>
+                    </Grid.ColumnDefinitions>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" >
+                        <TextBlock Text="Communication State" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1" Grid.ColumnSpan="2">
+                        <TextBlock Text="{Binding HostCommunicationStatus}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+                    <StackPanel Orientation="Horizontal" Grid.Row="1"  Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,80,0,10" >
+                        <Button Content="Enable" Command="{Binding FaEnable}" Width="90" Height="30" VerticalAlignment="Center"   IsEnabled="{Binding IsEnableEnable}" >
+                        </Button>
+                        <Button Content="Disable" Command="{Binding FaDisable}"  Width="90" Height="30" Margin="10,0,0,0" VerticalAlignment="Center"    IsEnabled="{Binding IsEnableDisable}"  >
+                        </Button>
+                    </StackPanel>
+                </Grid>
+            </TabItem>
+        </TabControl>
+        <TabControl Height="400" Grid.Column="1" Margin="10,0" Background="{DynamicResource Table_BG_Content}">
+            <TabControl.Resources>
+                <Style TargetType="{x:Type TabPanel}">
+                    <Setter Property="HorizontalAlignment" Value="Center"/>
+                    <Setter Property="Background" Value="{DynamicResource Color_BG_Button}"/>
+                </Style>
+            </TabControl.Resources>
+            <TabItem Header="Host Control">
+                <Grid Margin="5">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="Auto" />
+                    </Grid.RowDefinitions>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="180"/>
+
+                        <ColumnDefinition />
+                    </Grid.ColumnDefinitions>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Grid.ColumnSpan="2">
+                        <TextBlock Text="Control State" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="2" Padding="5,1">
+                        <TextBlock Text="{Binding HostControlStatus}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+
+                    <UniformGrid Columns="2" Grid.Row="1"  Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,80,0,10" >
+                        <Button Content="Online" Command="{Binding FaOnline}"  Width="90" Height="30" Margin="0,0,10,5"  IsEnabled="{Binding IsEnableOnline}">
+
+                        </Button>
+                        <Button Content="Offline" Command="{Binding FaOffline}" Width="90" Height="30" Margin="0,0,10,5"   IsEnabled="{Binding IsEnableOffline}" >
+
+                        </Button>
+                        <Button Content="Local" Command="{Binding FaLocal}" Width="90" Height="30" Margin="0,0,10,5"  IsEnabled="{Binding IsEnableLocal}" >
+
+                        </Button>
+                        <Button Content="Remote" Command="{Binding FaRemote}" Width="90" Height="30" Margin="0,0,10,5"     IsEnabled="{Binding IsEnableRemote}" >
+                        </Button>
+                    </UniformGrid>
+                </Grid>
+            </TabItem>
+        </TabControl>
+        <TabControl Height="400" Grid.Column="2" Background="{DynamicResource Table_BG_Content}">
+            <TabControl.Resources>
+                <Style TargetType="{x:Type TabPanel}">
+                    <Setter Property="HorizontalAlignment" Value="Center"/>
+                    <Setter Property="Background" Value="{DynamicResource Color_BG_Button}"/>
+                </Style>
+            </TabControl.Resources>
+            <TabItem Header="Spooling">
+                <Grid Margin="5">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="30" />
+                        <RowDefinition Height="Auto" />
+                    </Grid.RowDefinitions>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="180" />
+                        <ColumnDefinition />
+                    </Grid.ColumnDefinitions>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
+                        <TextBlock Text="Spooling State" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1">
+                        <TextBlock Text="{Binding SpoolingState}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1">
+                        <TextBlock Text="Actual" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="1" Padding="5,1">
+                        <TextBlock Text="{Binding SpoolingActual}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="2" Padding="5,1">
+                        <TextBlock Text="Total" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="2" Grid.Column="1" Padding="5,1">
+                        <TextBlock Text="{Binding SpoolingTotal}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="3" Padding="5,1">
+                        <TextBlock Text="Full Time" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="3" Grid.Column="1" Padding="5,1">
+                        <TextBlock Text="{Binding SpoolingFullTime}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="4" Padding="5,1">
+                        <TextBlock Text="Start Time" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                    </Border>
+                    <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="4" Grid.Column="1" Padding="5,1">
+                        <TextBlock Text="{Binding SpoolingStartTime}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="16" FontFamily="Arial" VerticalAlignment="Center"/>
+                    </Border>
+
+                    <StackPanel Orientation="Horizontal" Grid.Row="5" Margin="0,10" Grid.ColumnSpan="2" HorizontalAlignment="Center">
+                        <Button Content="Enable" Command="{Binding FaEnableSpooling}"  Width="90" Height="30"   IsEnabled="{Binding IsEnableEnableSpooling}"  >
+                        </Button>
+                        <Button Content="Disable" Command="{Binding FaDisableSpooling}" Width="90" Height="30" Margin="10,0,0,0"   IsEnabled="{Binding IsEnableDisableSpooling}"  >
+                        </Button>
+                    </StackPanel>
+                </Grid>
+            </TabItem>
+        </TabControl>
+    </Grid>
+</UserControl>

+ 28 - 0
Venus/Venus_MainPages/Views/FaView.xaml.cs

@@ -0,0 +1,28 @@
+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;
+
+namespace Venus_MainPages.Views
+{
+    /// <summary>
+    /// UserControl1.xaml 的交互逻辑
+    /// </summary
+    public partial class FaView : UserControl
+    {
+        public FaView()
+        {
+            InitializeComponent();
+        }
+    }
+}

File diff suppressed because it is too large
+ 46 - 23
Venus/Venus_MainPages/Views/ProcessHistoryView.xaml


+ 120 - 0
Venus/Venus_MainPages/Views/ProcessHistoryView.xaml.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Aitex.Core.RT.Log;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
@@ -12,8 +13,12 @@ using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using ExcelLibrary.SpreadSheet;
 using Venus_MainPages.ViewModels;
+//using Xceed.Wpf.DataGrid;
+using System.IO;
 using static Venus_MainPages.ViewModels.ProcessHistoryViewModel;
+using System.Collections.ObjectModel;
 
 namespace Venus_MainPages.Views
 {
@@ -40,6 +45,121 @@ namespace Venus_MainPages.Views
             ButtonExportData.IsEnabled = item != null;
             ButtonExportList.IsEnabled = item != null;
         }
+        private void buttonLotListExport_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            try
+            {
+                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 buttonLotDetailsExport_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            try
+            {
+                RecipeItem log = (dataGrid_RecipeList.SelectedItem) as RecipeItem;
+                if (log == null)
+                {
+                    MessageBox.Show("没有数据,先从列表中选择一个批次");
+                    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}", _viewModel.StartDateTime.ToString("yyyyMMdd"), log.Recipe);
+                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<DateTime, int> rowIndex = new Dictionary<DateTime, int>();
+
+                int colCount = 0;
+                int rowCount = 0;
+                foreach (var item in _viewModel.ProcessData)
+                {
+                    if (!rowIndex.ContainsKey(item.dateTime))
+                    {
+                        rowCount++;
+                        rowIndex[item.dateTime] = rowCount;
+                        worksheet.Cells[rowCount, 0] = new Cell(item.dateTime);
+                    }
+
+                    if (!colIndex.ContainsKey(item.dbName))
+                    {
+                        colCount++;
+                        colIndex[item.dbName] = colCount;
+                        worksheet.Cells[0, colCount] = new Cell(item.dbName);
+                    }
+
+                    worksheet.Cells[rowIndex[item.dateTime], colIndex[item.dbName]] = new Cell(item.value);
+                }
+                workbook.Worksheets.Add(worksheet);
+                workbook.Save(dlg.FileName);
+            }
+            catch (Exception ex)
+            {
+                
+                LOG.WriteExeption(ex.Message, ex);
+            }
+
+        }
     }
 }

+ 23 - 0
Venus/Venus_Themes/UserControls/DrawGraphicsControl.xaml.cs

@@ -421,6 +421,29 @@ namespace Venus_Themes.UserControls
         #endregion Public
 
         #region Private Draw
+        //public void GraphicDrawplotsally()
+        //{
+        //    if (Canvas_Main.ActualWidth <= 0 || Canvas_Main.ActualHeight <= 0) return;
+        //    m_WavePlotMinX = double.MaxValue;
+        //    m_WavePlotMaxX = double.MinValue;
+        //    m_WavePlotMinY = double.MaxValue;
+        //    m_WavePlotMaxY = double.MinValue;
+        //    using (Bitmap bitmap = new Bitmap((int)Canvas_Main.ActualWidth, (int)Canvas_Main.ActualHeight))
+        //    {
+        //        Graphics graphics = Graphics.FromImage(bitmap);
+        //        if (m_WavePlotHeight < Math.Pow(10, -4))
+        //        {
+        //            double Min = m_WavePlotY;
+        //            double Max = m_WavePlotY + m_WavePlotHeight;
+        //            double delta = (Max - Min) / 2;
+        //            double center = (Max + Min) / 2;
+        //            Min = center - delta * 1.2;
+        //            Max = center + delta * 1.2;
+        //            m_WavePlotY = Min;
+        //            m_WavePlotHeight = Max - Min;
+        //        }
+        //    }
+        //}
         private void GraphicDraw()
         {
             if (Canvas_Main.ActualWidth <= 0 || Canvas_Main.ActualHeight <= 0) return;

+ 6 - 0
Venus/Venus_UI/Config/VenusMenu.json

@@ -242,6 +242,12 @@
         "IsShow": "true",
         "Name": "EFEM",
         "View": "EfemView"
+      },
+      {
+        "Id": "Fa",
+        "IsShow": "true",
+        "Name": "FA",
+        "View": "FaView"
       }
     ]
   },