Browse Source

1.complete parameters writing in pm routine
2.enhance switch page function

Intern01 1 year ago
parent
commit
33f3e3a72e

+ 1 - 0
Venus/Framework/Common/CommonData/HistoryDataItem.cs

@@ -170,6 +170,7 @@ namespace MECF.Framework.Common.CommonData
         [DataMember]
         public string ProcessJob { get; set; }
 
+        public string WaferGuid { get; set; }
         [DataMember]
         public string Sequence { get; set; }
 

+ 69 - 8
Venus/Venus_MainPages/ViewModels/ProcessHistoryViewModel.cs

@@ -24,6 +24,7 @@ using System.Xml.Linq;
 using System.Windows.Forms;
 using ExcelLibrary.BinaryFileFormat;
 using Aitex.Core.UI.View.Common;
+using Aitex.Core.RT.DataCenter;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -150,6 +151,66 @@ namespace Venus_MainPages.ViewModels
         {
             SearchRecipe(this.view.wfTimeFrom.Value, this.view.wfTimeTo.Value);
         }
+        public void searchlot(string id)
+        {
+            Recipes.Clear();
+            try
+            {
+                string sql1 = string.Format($"SELECT * FROM \"lot_wafer_data\" where  guid ='{id}'; ") ;
+                DataTable dbData1 = QueryDataClient.Instance.Service.QueryData(sql1);
+                string lot_data_guid = dbData1.Rows[0]["wafer_data_guid"].ToString();
+                string sql = string.Format($"SELECT * FROM \"process_data\" where  guid ='{lot_data_guid}'");
+                if (!string.IsNullOrEmpty(SelectedValuePM))
+                {
+                    string[] pms = SelectedValuePM.Split(',');
+                    if (pms.Length > 0)
+                    {
+                        sql += " and (FALSE ";
+                        foreach (var pm in pms)
+                        {
+                            sql += $" OR \"process_in\"='{pm}' ";
+                        }
+                        sql += " ) ";
+                    }
+                }
+
+                if (!string.IsNullOrEmpty(RecipeName))
+                {
+                    sql += string.Format(" and lower(\"recipe_name\") like '%{0}%'", RecipeName.ToLower());
+                }
+                sql += " order by \"process_begin_time\" ASC;";
+
+                DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
+
+
+                System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+                {
+                    if (dbData == null || dbData.Rows.Count == 0) return;
+
+                    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();
+                        item.Chamber = dbData.Rows[i]["process_in"].ToString();
+                        item.Status = dbData.Rows[i]["process_status"].ToString();
+                        item.SlotID = dbData.Rows[i]["slot_id"].ToString();
+                        item.LotID = dbData.Rows[i]["lot_id"].ToString();
+                        if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
+                            item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss");
+                        if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
+                            item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy-MM-dd HH:mm:ss");
+                        Recipes.Add(item);
+                    }
+                }));
+            }
+            catch (Exception e)
+            {
+                LOG.WriteExeption(e);
+            }
+        }
         public void SearchRecipe(DateTime start,DateTime end )
         {
             this.StartDateTime = start;
@@ -199,9 +260,9 @@ namespace Venus_MainPages.ViewModels
                         item.SlotID = dbData.Rows[i]["slot_id"].ToString();
                         item.LotID = dbData.Rows[i]["lot_id"].ToString();
                         if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
-                            item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]);
+                            item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss");
                         if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
-                            item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]);
+                            item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy-MM-dd HH:mm:ss");
                         Recipes.Add(item);                  
                     }
                 }));
@@ -429,10 +490,10 @@ namespace Venus_MainPages.ViewModels
             //    }
             //}));          
             this.view.MyDrawGraphicsControl.ClearPlotPoints();
-            DateTime dtFrom = dataLog.StartTime;
-            //DateTime dtFrom = Convert.ToDateTime(dataLog.StartTime);
-            DateTime dtTo = dtFrom.AddMinutes(10);
-            dtTo = dataLog.EndTime;
+            //DateTime dtFrom = dataLog.StartTime;
+            DateTime dtFrom = Convert.ToDateTime(dataLog.StartTime);
+            //DateTime dtTo = dtFrom.AddMinutes(10);
+            DateTime dtTo = Convert.ToDateTime(dataLog.EndTime);
             //if (!string.IsNullOrEmpty(dataLog.EndTime))
             //{
             //    dtTo = Convert.ToDateTime(dataLog.EndTime);
@@ -507,8 +568,8 @@ namespace Venus_MainPages.ViewModels
         public string RecipeRunGuid { get; set; }
         public string Chamber { get; set; }
         public string Status { get; set; }
-        public DateTime StartTime { get; set; }
-        public DateTime EndTime { get; set; }
+        public string StartTime { get; set; }
+        public string EndTime { get; set; }
         public string LotID { get; set; }
         public string SlotID { get; set; }
     }

+ 1 - 0
Venus/Venus_MainPages/ViewModels/WaferHistoryDBViewModel.cs

@@ -402,6 +402,7 @@ namespace Venus_MainPages.ViewModels
                 {
                     WaferHistoryWafer item = new WaferHistoryWafer();
 
+                    item.WaferGuid = dbData.Rows[i]["guid1"].ToString();
                     item.ID = dbData.Rows[i]["guid"].ToString();
                     if (!itemPtr.ContainsKey(item.ID))
                     {

+ 7 - 60
Venus/Venus_MainPages/Views/ProcessHistoryView.xaml

@@ -18,59 +18,6 @@
             <i:InvokeCommandAction Command="{Binding LoadCommandPD}" CommandParameter="{Binding ElementName=processHistoryView}"/>
         </i:EventTrigger>
     </i:Interaction.Triggers>
-    <UserControl.Resources>
-        <Style TargetType="{x:Type DataGridColumnHeader}">
-            <Setter Property="SnapsToDevicePixels" Value="True"/>
-            <Setter Property="HorizontalContentAlignment" Value="Center"/>
-            <Setter Property="BorderBrush" Value="{DynamicResource DataGrid_Header_BD}"/>
-            <Setter Property="BorderThickness" Value="0,0,1,0"/>
-            <Setter Property="Padding" Value="5,1"/>
-            <Setter Property="Background" Value="{DynamicResource Table_BG_Title}"/>
-            <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
-
-            <Setter Property="FontFamily" Value="Arial"/>
-            <Setter Property="MinHeight" Value="24"/>
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
-                        <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Cursor="Hand">
-                            <Grid>
-                                <Path x:Name="Arrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" Width="8" Height="4" Fill="{DynamicResource DataGrid_ArrowBG}" Margin="0,2,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.4" />
-                                <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
-                                    <ContentPresenter.Effect>
-                                        <DropShadowEffect BlurRadius="0" ShadowDepth="1" Direction="315"/>
-                                    </ContentPresenter.Effect>
-                                </ContentPresenter>
-                                <Thumb x:Name="PART_RightHeaderGripper" Style="{StaticResource ColumnHeaderGripperStyle}" HorizontalAlignment="Right"/>
-                            </Grid>
-                        </Border>
-                        <ControlTemplate.Triggers>
-                            <Trigger Property="SortDirection" Value="Ascending">
-                                <Setter TargetName="Arrow" Property="Visibility" Value="Visible" />
-                                <Setter TargetName="Arrow" Property="RenderTransform">
-                                    <Setter.Value>
-                                        <RotateTransform Angle="180" />
-                                    </Setter.Value>
-                                </Setter>
-                                <Setter Property="Background" Value="{DynamicResource DataGrid_Header_BG_MouseOver}"/>
-                            </Trigger>
-                            <Trigger Property="SortDirection" Value="Descending">
-                                <Setter TargetName="Arrow" Property="Visibility" Value="Visible" />
-                                <Setter Property="Background" Value="{DynamicResource DataGrid_Header_BG_MouseOver}"/>
-                            </Trigger>
-                            <MultiTrigger>
-                                <MultiTrigger.Conditions>
-                                    <Condition Property="IsMouseOver" Value="True" />
-                                    <Condition Property="SortDirection" Value="{x:Null}" />
-                                </MultiTrigger.Conditions>
-                                <Setter Property="Background" Value="{DynamicResource DataGrid_Header_BG_MouseOver}"/>
-                            </MultiTrigger>
-                        </ControlTemplate.Triggers>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-        </Style>
-    </UserControl.Resources>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto"></RowDefinition>
@@ -159,14 +106,14 @@
                     <DataGridTemplateColumn Header="Lot ID" Width="320">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding LotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Background="White" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding LotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
                     <DataGridTemplateColumn Header="Slot ID" Width="320">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding SlotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding SlotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
@@ -174,21 +121,21 @@
                     <DataGridTemplateColumn Header="Start" Width="200">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding StartTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding StartTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
                     <DataGridTemplateColumn Header="End" Width="200">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding EndTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding EndTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
                     <DataGridTemplateColumn Header="Chamber" Width="80">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding Chamber}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding Chamber}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
@@ -202,14 +149,14 @@
                     <DataGridTemplateColumn Header="Recipe" Width="300">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding Recipe}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding Recipe}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
                     <DataGridTemplateColumn Header="Status" Width="*">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding Status}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                                <TextBlock Text="{Binding Status}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>

+ 2 - 0
Venus/Venus_RT/Config/DBModel.sql

@@ -133,6 +133,8 @@ begin
 					  "process_begin_time" timestamp without time zone,
 					  "process_end_time" timestamp without time zone,
 					  "recipe_name" text,
+					  "chuck_name" text,
+					  "dechuck_name" text,
 					  "process_status" text,
 					   "wafer_data_guid" text,
 					   "process_in" text,

+ 13 - 7
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -26,7 +26,7 @@ namespace Venus_RT.Modules.PMs
         public string CurrentRunningRecipe { get; set; }
         public string ProcessRecipeName { get; set; }
         public string ChuckRecipeName { get; set; }
-        public string DechuckRecipeNamae { get; set; }
+        public string DechuckRecipeName { get; set; }
         public string CleanRecipeName { get; set; }
         public RecipeHead ProcessRecipeHead { get; set; }
         public DateTime RecipeStartTime { get; private set; }
@@ -187,7 +187,7 @@ namespace Venus_RT.Modules.PMs
                         var dechuckRecipe = Recipe.Load(dechuckcontent);
                         if(dechuckRecipe != null)
                         {
-                            DechuckRecipeNamae = recipe.Header.DechuckRecipe;
+                            DechuckRecipeName = recipe.Header.DechuckRecipe;
                             _qeRecipes.Enqueue(dechuckRecipe);
                         }
                     }
@@ -198,7 +198,7 @@ namespace Venus_RT.Modules.PMs
                     _qeRecipes.Enqueue(recipe);
                     break;
                 case RecipeType.DeChuck:
-                    DechuckRecipeNamae = recipeName;
+                    DechuckRecipeName = recipeName;
                     _qeRecipes.Enqueue(recipe);
                     break;
                 case RecipeType.Clean:
@@ -417,10 +417,16 @@ namespace Venus_RT.Modules.PMs
             _chamber.OpenValve(ValveType.Guage, true);
             _chamber.SetPVPostion(1000);
             WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Completed);
-
-        
-
-            ProcessDataRecorder.RecordPrecess(Guid.NewGuid().ToString(), RecipeStartTime, DateTime.Now, CurrentRunningRecipe,"Success", "", _chamber.Name, "", "");
+            string waferId = "", slotID = "", lotID = "", recipename = "";
+            WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(Module.ToString()), 0);
+            if (!waferInfo.IsEmpty)
+            {
+                waferId = waferInfo.InnerId.ToString();
+                slotID = waferInfo.OriginSlot.ToString();
+                lotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
+                recipename = string.Format(@"{0}/{1}/{2}", ChuckRecipeName, ProcessRecipeName, DechuckRecipeName);
+            }
+            ProcessDataRecorder.RecordPrecess(waferInfo.InnerId.ToString(), RecipeStartTime, DateTime.Now, recipename,"", waferId, _chamber.Name, lotID, slotID);
             return true;
         }
 

+ 1 - 1
Venus/Venus_Simulator/Devices/AdTecMatchMockPMB.cs

@@ -8,7 +8,7 @@ namespace Venus_Simulator.Devices
     {
         private const string EOF = "\r";
         private const char MSG_DELIMITER = '\r';
-        private const string MOCKUP_PORT = "COM41";
+        private const string MOCKUP_PORT = "COM83";
 
         public AdTecMatchMockPMB() : base(MOCKUP_PORT, -1, EOF, MSG_DELIMITER)
         {

+ 4 - 2
Venus/Venus_UI/Views/ShellView.xaml.cs

@@ -24,6 +24,8 @@ using System.Windows.Controls.Primitives;
 using System.Timers;
 using System.Windows.Threading;
 using Venus_Themes.Unity;
+using Venus_Themes.UserControls;
+using OpenSEMI.Ctrlib.Controls;
 
 namespace Venus_UI.Views
 {
@@ -187,8 +189,8 @@ namespace Venus_UI.Views
         {
             UserControl address = new ProcessHistoryView();          
             ProcessHistoryViewModel vm = new ProcessHistoryViewModel() {};
-            vm.SearchRecipe(queryFilter.StartTime, queryFilter.EndTime);
-            vm.OnDataGridSelectionChanged(new Venus_MainPages.ViewModels.RecipeItem { StartTime=queryFilter.StartTime, EndTime= queryFilter.EndTime});
+            vm.searchlot(queryFilter.WaferGuid);
+            vm.OnDataGridSelectionChanged(vm.Recipes[0]);
             address.DataContext = vm;
             centerTabViews.Last().Items[2]= new TabItem() { Header = menuviewItem, Content = address };
             centerTabViews.Last().SelectedIndex = 2;