首次上传
This commit is contained in:
+391
@@ -0,0 +1,391 @@
|
||||
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory.WaferHistory2View"
|
||||
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:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:interop="clr-namespace:Microsoft.DwayneNeed.Interop;assembly=Microsoft.DwayneNeed"
|
||||
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="1800">
|
||||
<Grid IsEnabled="{Binding IsPermission}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="280"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Query Condition" Style="{DynamicResource Table_TitleStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="30"/>
|
||||
<Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<StackPanel Margin="0,5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Start Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
|
||||
<interop:AirspaceDecorator AirspaceMode="Redirect" IsInputRedirectionEnabled="True" IsOutputRedirectionEnabled="True">
|
||||
<wfi:WindowsFormsHost Margin="0,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
</interop:AirspaceDecorator>
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<TextBlock Text="End Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
|
||||
<interop:AirspaceDecorator AirspaceMode="Redirect" IsInputRedirectionEnabled="True" IsOutputRedirectionEnabled="True" >
|
||||
<wfi:WindowsFormsHost Margin="0,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
</interop:AirspaceDecorator>
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Label Grid.Row="2" Margin="0,5,0,0" Content="Query Option" Style="{DynamicResource Table_TitleStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="30"/>
|
||||
<Border Grid.Row="3" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<StackPanel Margin="0,5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Load Port" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<!--<TextBox x:Name="tbLoadPort" Text="" Width="115" Height="25" Margin="5,0,0,0"/>-->
|
||||
<toolkit:CheckComboBox x:Name="tbLoadPort" ItemsSource="{Binding SourceLP}" Width="120" FontFamily="Arial" FontSize="14" Height="25" Margin="5,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
SelectedValue="{Binding SelectedValueLP}" ToolTip="Value">
|
||||
|
||||
</toolkit:CheckComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<TextBlock Text="Wafer ID" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbWaferID" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Lot ID" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbLotID" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Carrier ID" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbCarrierID" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<!--<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Sequence Name" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbSequenceName" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Process Chamber" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbProcessChamber" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Process Recipe" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbProcessRecipe" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>-->
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Grid Grid.Row="4">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,20">
|
||||
<Button Content="Query" Width="100" Height="30">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Query">
|
||||
<micro:Parameter Value="{Binding ElementName=tbLoadPort, Path=SelectedValue}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbWaferID, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbLotID, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbCarrierID, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbSequenceName, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbProcessChamber, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbProcessRecipe, Path=Text}"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
<Button Content="Export" Width="100" Height="30" Margin="0,10,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Export">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
<Button Content="ExportMove" Width="100" Height="30" Margin="0,10,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="ExportMove">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" Margin="10,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="520"/>
|
||||
<RowDefinition Height="250"/>
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid AutoGenerateColumns="False" Name="dataGrid_LotList" ItemsSource="{Binding Wafers}" CanUserAddRows="False" CanUserResizeColumns="True" CanUserResizeRows="False" HorizontalAlignment="Left"
|
||||
FontFamily="Arial" FontSize="14" DataContextChanged="dataGrid_LotList_DataContextChanged">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding CreateTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Create Time" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding CreateTime}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding DeleteTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Delete Time" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding DeleteTime}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding LoadPort, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Load Port" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding LoadPort}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="160" CanUserSort="True" Binding="{Binding Slot, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Slot" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Slot}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding CarrierID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Carrier ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding CarrierID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding LotID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Lot ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding LotID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding WaferID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Wafer ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding WaferID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding Status, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Status" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Status}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<micro:ActionMessage MethodName="WaferHistoryChanged">
|
||||
<micro:Parameter Value="{Binding ElementName=dataGrid_LotList, Path=SelectedItem}"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</DataGrid>
|
||||
<Grid Grid.Row="1" Margin="0,5,0,0" HorizontalAlignment="Left">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="785"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DataGrid Grid.Column="0" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" ItemsSource="{Binding Movements}"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Time, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Time" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Time}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Station, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Station" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Station}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Slot, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Slot" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Slot}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Status, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Status" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Status}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding WaferID, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Wafer ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding WaferID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
|
||||
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" ItemsSource="{Binding Processes}"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding ProcessTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="ProcessTime" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding ProcessTime}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Station, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Station" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Station}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding DataName, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="DataName" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding DataName}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding DataValue, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="DataValue" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding DataValue}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
<!--<s:SciChartSurface x:Name="sciChart" BorderBrush="Gray" Grid.Column="1" Width="500"
|
||||
s:ThemeManager.Theme="ExpressionLight"
|
||||
RenderableSeries="{Binding RenderableSeries}" Annotations="{Binding Annotations}">
|
||||
<s:SciChartSurface.XAxis>
|
||||
<s:NumericAxis AxisTitle="Number of Samples (per Series)" AutoRange="Always"/>
|
||||
</s:SciChartSurface.XAxis>
|
||||
<s:SciChartSurface.YAxis>
|
||||
<s:NumericAxis AxisTitle="Value" AutoRange="Never" AxisAlignment="Left" VisibleRange="0,8" LabelProvider="{Binding YLabelProvider}" />
|
||||
</s:SciChartSurface.YAxis>
|
||||
|
||||
<s:SciChartSurface.ChartModifier>
|
||||
|
||||
<s:ModifierGroup ExecuteOn="MouseDoubleClick">
|
||||
<s:CursorModifier IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True" SourceMode="AllSeries" ShowTooltip="False" />
|
||||
</s:ModifierGroup>
|
||||
</s:SciChartSurface.ChartModifier>
|
||||
|
||||
</s:SciChartSurface>-->
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
/// <summary>
|
||||
/// WaferHistory2View.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WaferHistory2View : UserControl
|
||||
{
|
||||
public WaferHistory2View()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void dataGrid_LotList_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
dataGrid_LotList.CanUserAddRows = false;
|
||||
if (dataGrid_LotList.Items == null || dataGrid_LotList.Items.Count == 0)
|
||||
dataGrid_LotList.CanUserAddRows = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+395
@@ -0,0 +1,395 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Windows;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.Common.Utilities;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase;
|
||||
using SciChart.Charting.Model.DataSeries;
|
||||
using SciChart.Charting.Visuals.Annotations;
|
||||
using SciChart.Charting.Visuals.RenderableSeries;
|
||||
using SciChart.Data.Model;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
public class WaferProcess
|
||||
{
|
||||
public string ProcessTime { get; set; }
|
||||
public string Station { get; set; }
|
||||
public string DataName { get; set; }
|
||||
public string DataValue { get; set; }
|
||||
}
|
||||
public class WaferHistory2ViewModel : BaseModel
|
||||
{
|
||||
public DateTime BeginDate { get; set; }
|
||||
public DateTime StartDateTime { get; set; }
|
||||
public DateTime EndDateTime { get; set; }
|
||||
public DateTime UIEndTime { get; set; }
|
||||
|
||||
|
||||
public ObservableCollection<WaferHistoryDetail> Wafers { get; set; }
|
||||
public ObservableCollection<WaferMovement> Movements { get; set; }
|
||||
|
||||
public ObservableCollection<WaferProcess> Processes { get; set; } = new ObservableCollection<WaferProcess>();
|
||||
|
||||
public ObservableCollection<string> SourceLP { get; set; }
|
||||
public string SelectedValueLP { get; set; }
|
||||
|
||||
public WaferHistory2ViewModel()
|
||||
{
|
||||
this.DisplayName = "Wafer History";
|
||||
var now = DateTime.Now;
|
||||
this.StartDateTime = now;
|
||||
this.BeginDate = now;
|
||||
this.StartDateTime = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, 0);
|
||||
this.EndDateTime = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59, 999);
|
||||
this.Wafers = new ObservableCollection<WaferHistoryDetail>();
|
||||
this.Movements = new ObservableCollection<WaferMovement>();
|
||||
|
||||
|
||||
SourceLP = new ObservableCollection<string>(new[] { "LP1", "LP2", "LP3" });
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
this.YLabelProvider = new YAxisLabelProvider();
|
||||
this.RenderableSeries = new ObservableCollection<IRenderableSeries>();
|
||||
this.RenderableSeries.Add(new FastLineRenderableSeries() { DataSeries = new XyDataSeries<int, int>() });
|
||||
this.Annotations = new AnnotationCollection();
|
||||
}
|
||||
|
||||
private WaferHistory2View view;
|
||||
public void Query(string loadport, string waferid, string lotid, string carrierid, string sequencename, string processchamber, string processrecipe)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.StartDateTime = this.view.wfTimeFrom.Value;
|
||||
this.EndDateTime = this.view.wfTimeTo.Value;
|
||||
|
||||
if (StartDateTime > EndDateTime)
|
||||
{
|
||||
MessageBox.Show("Time range invalid, start time should be early than end time");
|
||||
return;
|
||||
}
|
||||
|
||||
string sql = string.Format(
|
||||
"SELECT * FROM \"wafer_data\",\"carrier_data\" where \"create_time\" >= '{0}' and \"create_time\" <= '{1}' and \"wafer_data\".\"carrier_data_guid\"=\"carrier_data\".\"guid\"",
|
||||
StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff"), EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff"));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(loadport))
|
||||
{
|
||||
sql += " and (FALSE ";
|
||||
var loadPorts = loadport.Split(',');
|
||||
for (int i = 0; i < loadPorts.Length; i++)
|
||||
{
|
||||
sql += $" OR \"create_station\"='{loadPorts[i]}'";
|
||||
}
|
||||
sql += " )";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(waferid))
|
||||
sql += $" and lower(\"wafer_id\") like '%{waferid.ToLower()}%'";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(lotid))
|
||||
sql += $" and lower(\"wafer_data\".\"lot_id\") like '%{lotid.ToLower()}%'";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(carrierid))
|
||||
sql += $" and lower(\"rfid\") like '%{carrierid.ToLower()}%'";
|
||||
|
||||
sql += " order by \"create_time\" ASC, \"create_station\" ASC,\"create_slot\" ASC";
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Wafers.Clear();
|
||||
try
|
||||
{
|
||||
if (dbData == null || dbData.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferHistoryDetail item = new WaferHistoryDetail();
|
||||
|
||||
item.Guid = dbData.Rows[i]["guid"].ToString();
|
||||
item.LoadPort = dbData.Rows[i]["create_station"].ToString();
|
||||
item.Slot = dbData.Rows[i]["create_slot"].ToString();
|
||||
|
||||
item.CarrierID = dbData.Rows[i]["rfid"].ToString();
|
||||
|
||||
item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
||||
item.WaferID = dbData.Rows[i]["wafer_id"].ToString();
|
||||
|
||||
item.Status = dbData.Rows[i]["process_status"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["create_time"].Equals(DBNull.Value))
|
||||
item.CreateTime = ((DateTime)dbData.Rows[i]["create_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
if (!dbData.Rows[i]["delete_time"].Equals(DBNull.Value))
|
||||
item.DeleteTime = ((DateTime)dbData.Rows[i]["delete_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
Wafers.Add(item);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
}
|
||||
|
||||
}));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.Write(e);
|
||||
}
|
||||
}
|
||||
public void WaferHistoryChanged(WaferHistoryDetail detail)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (detail == null)
|
||||
{
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Movements.Clear();
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
string sql = string.Format(
|
||||
"SELECT * FROM \"wafer_move_history\" where \"wafer_data_guid\" = '{0}' order by \"arrive_time\" ASC;",
|
||||
detail.Guid);
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Movements.Clear();
|
||||
|
||||
if (dbData == null || dbData.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferMovement item = new WaferMovement();
|
||||
|
||||
item.Station = dbData.Rows[i]["station"].ToString();
|
||||
item.Slot = dbData.Rows[i]["slot"].ToString();
|
||||
item.Status = dbData.Rows[i]["status"].ToString();
|
||||
item.WaferID = detail.WaferID;
|
||||
|
||||
if (!dbData.Rows[i]["arrive_time"].Equals(DBNull.Value))
|
||||
item.Time = ((DateTime)dbData.Rows[i]["arrive_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
Movements.Add(item);
|
||||
}
|
||||
|
||||
|
||||
}));
|
||||
|
||||
string sql2= string.Format(
|
||||
"SELECT * FROM \"wafer_process_data\" where \"wafer_guid\" = '{0}' order by \"process_time\" ASC;",
|
||||
detail.Guid);
|
||||
|
||||
DataTable dbData2 = QueryDataClient.Instance.Service.QueryData(sql2);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Processes.Clear();
|
||||
|
||||
if (dbData2 == null || dbData2.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < dbData2.Rows.Count; i++)
|
||||
{
|
||||
WaferProcess item = new WaferProcess();
|
||||
if (!dbData2.Rows[i]["process_time"].Equals(DBNull.Value))
|
||||
item.ProcessTime = ((DateTime)dbData2.Rows[i]["process_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
|
||||
item.Station = dbData2.Rows[i]["station"].ToString();
|
||||
item.DataName = dbData2.Rows[i]["data_name"].ToString();
|
||||
item.DataValue = dbData2.Rows[i]["data_value"].ToString();
|
||||
|
||||
|
||||
|
||||
Processes.Add(item);
|
||||
}
|
||||
|
||||
|
||||
}));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.Write(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void Export()
|
||||
{
|
||||
try
|
||||
{
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"{DisplayName}_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
|
||||
if (result == true) // Process open file dialog box results
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
ds.Tables.Add(new System.Data.DataTable("系统运行日志"));
|
||||
ds.Tables[0].Columns.Add("CreateTime");
|
||||
ds.Tables[0].Columns.Add("DeleteTime");
|
||||
ds.Tables[0].Columns.Add("LoadPort");
|
||||
ds.Tables[0].Columns.Add("Slot");
|
||||
ds.Tables[0].Columns.Add("CarrierID");
|
||||
ds.Tables[0].Columns.Add("LotID");
|
||||
ds.Tables[0].Columns.Add("WaferID");
|
||||
ds.Tables[0].Columns.Add("Status");
|
||||
foreach (var item in Wafers)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = item.CreateTime;
|
||||
row[1] = item.DeleteTime;
|
||||
row[2] = item.LoadPort;
|
||||
row[3] = item.Slot;
|
||||
row[4] = item.CarrierID;
|
||||
row[5] = item.LotID;
|
||||
row[6] = item.WaferID;
|
||||
row[7] = item.Status;
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
MessageBox.Show("导出系统日志发生错误", "导出失败", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
public void ExportMove()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Movements.Count == 0)
|
||||
{
|
||||
DialogBox.ShowDialog(DialogButton.OK, DialogType.INFO, "No wafer move history to export.");
|
||||
return;
|
||||
}
|
||||
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"Wafer_Move_History_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
|
||||
if (result == true) // Process open file dialog box results
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
ds.Tables.Add(new System.Data.DataTable("系统运行日志"));
|
||||
ds.Tables[0].Columns.Add("Time");
|
||||
ds.Tables[0].Columns.Add("Station");
|
||||
ds.Tables[0].Columns.Add("Slot");
|
||||
ds.Tables[0].Columns.Add("Status");
|
||||
ds.Tables[0].Columns.Add("WaferId");
|
||||
foreach (var item in Movements)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = item.Time;
|
||||
row[1] = item.Station;
|
||||
row[2] = item.Slot;
|
||||
row[3] = item.Status;
|
||||
row[4] = item.WaferID;
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
MessageBox.Show($"导出系统日志发生错误", "导出失败", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#region scichart
|
||||
|
||||
public ObservableCollection<IRenderableSeries> RenderableSeries
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
private AnnotationCollection _annotations = new AnnotationCollection();
|
||||
public AnnotationCollection Annotations
|
||||
{
|
||||
get { return _annotations; }
|
||||
set { _annotations = value; }
|
||||
}
|
||||
|
||||
private IRange _TimeRange;
|
||||
public IRange TimeRange
|
||||
{
|
||||
get { return _TimeRange; }
|
||||
set
|
||||
{
|
||||
_TimeRange = value;
|
||||
NotifyOfPropertyChange("TimeRange");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private IRange _YTimeRange;
|
||||
public IRange YTimeRange
|
||||
{
|
||||
get { return _YTimeRange; }
|
||||
set { _YTimeRange = value; }
|
||||
}
|
||||
|
||||
|
||||
public YAxisLabelProvider YLabelProvider { get; set; }
|
||||
public void AppendData()
|
||||
{
|
||||
(this.RenderableSeries[0].DataSeries as XyDataSeries<int, int>).Clear();
|
||||
|
||||
for (var index = 1; index <= 8; index++)
|
||||
{
|
||||
(this.RenderableSeries[0].DataSeries as XyDataSeries<int, int>).Append(index * 5, index);
|
||||
|
||||
this.Annotations.Add(new LineArrowAnnotation() { X1 = index * 5, Y1 = index, X2 = index * 5, Y2 = index + 2, });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded(object _view)
|
||||
{
|
||||
base.OnViewLoaded(_view);
|
||||
this.view = (WaferHistory2View)_view;
|
||||
this.view.wfTimeFrom.Value = this.StartDateTime;
|
||||
this.view.wfTimeTo.Value = this.EndDateTime;
|
||||
this.AppendData();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+378
@@ -0,0 +1,378 @@
|
||||
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory.WaferHistoryDBView"
|
||||
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:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:waferHistory="clr-namespace:MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory"
|
||||
xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="800" d:DesignWidth="1800"
|
||||
lex:LocalizeDictionary.DesignCulture="en"
|
||||
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common">
|
||||
<Grid x:Name="root">
|
||||
<Grid.Resources>
|
||||
<waferHistory:HideMinTimeConverters x:Key="HideMinTimeConvert" />
|
||||
<waferHistory:MinTime2BoolConverters x:Key="MinTime2BoolConverter" />
|
||||
<waferHistory:RecipeStepNull2Empty x:Key="RecipeStepNull2Empty" />
|
||||
<Grid x:Key="LotLayout">
|
||||
<DataGrid ItemsSource="{Binding Lots}" IsReadOnly="True" AutoGenerateColumns="False" RowHeight="25"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_LotName}" Width="180*" Binding="{Binding Name}" />
|
||||
<DataGridTextColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_StartTime}" Width="150*"
|
||||
Binding="{Binding StartTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_EndTime}" Width="150*"
|
||||
Binding="{Binding EndTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_Duration}" Width="75*" Binding="{Binding Duration}" />
|
||||
<DataGridTextColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_WaferCount}" Width="100*" Binding="{Binding WaferCount}" />
|
||||
<DataGridTextColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_FaultWaferCount}" Width="150*" Binding="{Binding FaultWaferCount}" />
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_Chart}" Width="100*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="{lex:Loc ID_BTN_ToChart_Content}" lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews" Margin="0" Height="22"
|
||||
VerticalContentAlignment="Center" FontSize="12">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<i:InvokeCommandAction
|
||||
Command="{Binding DataContext.ToChartCommand,ElementName=root}"
|
||||
CommandParameter="{Binding }" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<Grid x:Key="WaferLayout">
|
||||
<DataGrid ItemsSource="{Binding Wafers}" IsReadOnly="True" AutoGenerateColumns="False" RowHeight="25"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Wafer Name" Width="180*" Binding="{Binding Name}" />
|
||||
<DataGridTextColumn Header="Arrive Time" Width="150*"
|
||||
Binding="{Binding StartTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn Header="Remove Time" Width="150*"
|
||||
Binding="{Binding EndTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn Header="Duration" Width="75*" Binding="{Binding Duration}" />
|
||||
<DataGridTextColumn Header="Sequence" Width="200*" Binding="{Binding Sequence}" />
|
||||
<DataGridTextColumn Header="Status" Width="200*" Binding="{Binding Status}" />
|
||||
<DataGridTemplateColumn Header="Chart" Width="100*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="To Chart"
|
||||
IsEnabled="{Binding EndTime,Converter={StaticResource MinTime2BoolConverter }}"
|
||||
Margin="0" Height="22" VerticalContentAlignment="Center" FontSize="12">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<i:InvokeCommandAction
|
||||
Command="{Binding DataContext.ToChartCommand,ElementName=root}"
|
||||
CommandParameter="{Binding }" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<Grid x:Key="MovementLayout">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20*" />
|
||||
<RowDefinition Height="50*" />
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid ItemsSource="{Binding Recipes}" IsReadOnly="True" AutoGenerateColumns="False" RowHeight="25"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Width="200*" Binding="{Binding Recipe}" />
|
||||
<DataGridTextColumn Header="StartTime" Width="150*"
|
||||
Binding="{Binding StartTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn Header="EndTime" Width="150*"
|
||||
Binding="{Binding EndTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn Header="Chamber" Width="100*" Binding="{Binding Chamber}" />
|
||||
<DataGridTextColumn Header="SettingTime" Width="150*" Binding="{Binding SettingTime}" />
|
||||
<DataGridTextColumn Header="ActualTime" Width="150*" Binding="{Binding ActualTime}" />
|
||||
<DataGridTemplateColumn Header="Chart" Width="100*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="To Chart" Margin="0" Height="22" VerticalContentAlignment="Center"
|
||||
FontSize="12">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<i:InvokeCommandAction
|
||||
Command="{Binding DataContext.ToChartCommand,ElementName=root}"
|
||||
CommandParameter="{Binding Recipe}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<TabControl Grid.Row="1">
|
||||
<TabItem Header="Movements">
|
||||
<DataGrid ItemsSource="{Binding Movements}" IsReadOnly="True" AutoGenerateColumns="False"
|
||||
RowHeight="25"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Source" Width="200*" Binding="{Binding Source}" />
|
||||
<DataGridTextColumn Header="Destination" Width="200*" Binding="{Binding Destination}" />
|
||||
<DataGridTextColumn Header="Time" Width="200*"
|
||||
Binding="{Binding InTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
|
||||
<Grid x:Key="RecipeLayout">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20*" />
|
||||
<RowDefinition Height="80*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Tab_BD}" BorderThickness="1"
|
||||
Background="{DynamicResource Tab_BG}">
|
||||
<Grid DataContext="{Binding Recipe}" Background="{DynamicResource DataGrid_BG_First}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*" />
|
||||
<ColumnDefinition Width="10*" />
|
||||
<ColumnDefinition Width="10*" />
|
||||
<ColumnDefinition Width="10*" />
|
||||
<ColumnDefinition Width="10*" />
|
||||
<ColumnDefinition Width="10*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Grid.Column="0"
|
||||
Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
|
||||
<TextBlock Text="Name" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}"
|
||||
FontSize="12" FontFamily="Arial" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Grid.Column="1"
|
||||
Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
|
||||
<TextBlock Text="StartTime" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}"
|
||||
FontSize="12" FontFamily="Arial" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Grid.Column="2"
|
||||
Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
|
||||
<TextBlock Text="EndTime" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}"
|
||||
FontSize="12" FontFamily="Arial" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Grid.Column="3"
|
||||
Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
|
||||
<TextBlock Text="Chamber" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}"
|
||||
FontSize="12" FontFamily="Arial" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Grid.Column="4"
|
||||
Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
|
||||
<TextBlock Text="SettingTime" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}"
|
||||
FontSize="12" FontFamily="Arial" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,0,1" Grid.Column="5"
|
||||
Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
|
||||
<TextBlock Text="ActualTime" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}"
|
||||
FontSize="12" FontFamily="Arial" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"
|
||||
Background="{DynamicResource Table_BG_Content}" Grid.Column="0" Grid.Row="1"
|
||||
Padding="5,1">
|
||||
<TextBlock Text="{Binding Recipe}" TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"
|
||||
Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Grid.Row="1"
|
||||
Padding="5,1">
|
||||
<TextBlock Text="{Binding StartTime,Converter={StaticResource HideMinTimeConvert}}"
|
||||
TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12"
|
||||
FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"
|
||||
Background="{DynamicResource Table_BG_Content}" Grid.Column="2" Grid.Row="1"
|
||||
Padding="5,1">
|
||||
<TextBlock Text="{Binding EndTime,Converter={StaticResource HideMinTimeConvert}}"
|
||||
TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12"
|
||||
FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"
|
||||
Background="{DynamicResource Table_BG_Content}" Grid.Column="3" Grid.Row="1"
|
||||
Padding="5,1">
|
||||
<TextBlock Text="{Binding Chamber}" TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"
|
||||
Background="{DynamicResource Table_BG_Content}" Grid.Column="4" Grid.Row="1"
|
||||
Padding="5,1">
|
||||
<TextBlock Text="{Binding SettingTime}" TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,0,1"
|
||||
Background="{DynamicResource Table_BG_Content}" Grid.Column="5" Grid.Row="1"
|
||||
Padding="5,1">
|
||||
<TextBlock Text="{Binding ActualTime}" TextWrapping="Wrap"
|
||||
Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<TabControl Grid.Row="1">
|
||||
<TabItem Header="Steps">
|
||||
<DataGrid ItemsSource="{Binding Recipe.Steps, Converter={StaticResource RecipeStepNull2Empty}}"
|
||||
IsReadOnly="True" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="#" Binding="{Binding No}" />
|
||||
<DataGridTextColumn Header="Name" Width="200*" Binding="{Binding Name}" />
|
||||
<DataGridTextColumn Header="Start Time" Width="200*"
|
||||
Binding="{Binding StartTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn Header="End Time" Width="200*"
|
||||
Binding="{Binding EndTime,Converter={StaticResource HideMinTimeConvert}}" />
|
||||
<DataGridTextColumn Header="Actual Time" Width="100*" Binding="{Binding ActualTime}" />
|
||||
<DataGridTextColumn Header="Setting Time" Width="100*" Binding="{Binding SettingTime}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="FDC">
|
||||
<DataGrid ItemsSource="{Binding Recipe.Fdcs}" IsReadOnly="True" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="#" Binding="{Binding StepNumber}" />
|
||||
<DataGridTextColumn Header="Name" Width="200" Binding="{Binding Name}" />
|
||||
<DataGridTextColumn Header="SetPoint" Width="100" Binding="{Binding SetPoint}" />
|
||||
<DataGridTextColumn Header="Count" Width="50" Binding="{Binding SampleCount}" />
|
||||
<DataGridTextColumn Header="Min" Width="100" Binding="{Binding MinValue}" />
|
||||
<DataGridTextColumn Header="Max" Width="100" Binding="{Binding MaxValue}" />
|
||||
<DataGridTextColumn Header="Mean" Width="100" Binding="{Binding MeanValue}" />
|
||||
<DataGridTextColumn Header="Std" Width="100" Binding="{Binding StdValue}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
</Grid>
|
||||
|
||||
<waferHistory:HistoryLayoutSelectorConverter x:Key="HistoryLayoutSelectorConverter"
|
||||
WaferLayout="{StaticResource WaferLayout}"
|
||||
MovementLayout="{StaticResource MovementLayout}"
|
||||
RecipeLayout="{StaticResource RecipeLayout}"
|
||||
LotsLayout="{StaticResource LotLayout}" />
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="2,10,2,2">
|
||||
<Label Content="{lex:Loc ID_TXT_StartTime}" />
|
||||
<wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22"
|
||||
VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss"
|
||||
Format="Custom">
|
||||
</wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
<Label Content="{lex:Loc ID_TXT_EndTime}" />
|
||||
<wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22"
|
||||
VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeTo" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss"
|
||||
Format="Custom">
|
||||
</wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
<Label lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Content="{lex:Loc ID_TXT_LotName}" />
|
||||
<TextBox Width="200" Text="{Binding KeyWord}" />
|
||||
<Button Content="{lex:Loc ID_BTN_Query_Content}" Width="120" Margin="4,2,4,2"
|
||||
Command="{Binding QueryCommand}" />
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="1" Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="350" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Margin="0,5,13,0" BorderBrush="{DynamicResource Tab_BD}" BorderThickness="1"
|
||||
Background="{DynamicResource Tab_BG}">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
||||
<TreeView ItemsSource="{Binding HistoryData}" SelectedValuePath="Data">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding SubItems}">
|
||||
<TextBlock Text="{Binding Data.ItemInfo}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonDown">
|
||||
<i:InvokeCommandAction
|
||||
Command="{Binding DataContext.SelectionChangedCommand,ElementName=root}"
|
||||
CommandParameter="{Binding Data}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</TextBlock>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<GridSplitter Grid.Column="0" Width="10" HorizontalAlignment="Right" Background="Transparent"
|
||||
VerticalAlignment="Stretch" Style="{DynamicResource VerticalGridSplitterStyle}" />
|
||||
<Grid Grid.Row="0" Grid.Column="1">
|
||||
<ContentControl
|
||||
Content="{Binding SelectedItem,UpdateSourceTrigger=PropertyChanged, Converter={StaticResource HistoryLayoutSelectorConverter}}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
using Aitex.Sorter.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// WaferHistoryDB.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WaferHistoryDBView : UserControl
|
||||
{
|
||||
public WaferHistoryDBView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
public class HistoryLayoutSelectorConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
var type = ((WaferHistoryItem)value).Type;
|
||||
switch (type)
|
||||
{
|
||||
case WaferHistoryItemType.None:
|
||||
return LotsLayout;
|
||||
case WaferHistoryItemType.Lot:
|
||||
return WaferLayout;
|
||||
case WaferHistoryItemType.Wafer:
|
||||
return MovementLayout;
|
||||
case WaferHistoryItemType.Recipe:
|
||||
return RecipeLayout;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public object WaferLayout { get; set; }
|
||||
public object MovementLayout { get; set; }
|
||||
public object RecipeLayout { get; set; }
|
||||
public object LotsLayout { get; set; }
|
||||
}
|
||||
|
||||
public class HideMinTimeConverters : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is DateTime)
|
||||
return (DateTime)value == DateTime.MinValue ? "" : ((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
if (DateTime.TryParse((string)value, out DateTime dateTime))
|
||||
return dateTime == DateTime.MinValue ? "" : dateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class MinTime2BoolConverters : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is DateTime)
|
||||
return (DateTime)value != DateTime.MinValue;
|
||||
|
||||
if (DateTime.TryParse((string)value, out DateTime dateTime))
|
||||
return dateTime != DateTime.MinValue;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class RecipeStepNull2Empty : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value != null && (value is List<RecipeStep>) && ((List<RecipeStep>)value).Count > 0)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
return new List<RecipeStep>() { new RecipeStep() { Name = "", StartTime = DateTime.MinValue, EndTime = DateTime.MinValue, ActualTime = "", SettingTime = "" } };
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+662
@@ -0,0 +1,662 @@
|
||||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase.Command;
|
||||
using SciChart.Core.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
public class WaferHistoryDBViewModel : BaseModel
|
||||
{
|
||||
public WaferHistoryDBViewModel()
|
||||
{
|
||||
SelectionChangedCommand = new BaseCommand<WaferHistoryItem>(SelectionChanged);
|
||||
QueryCommand = new BaseCommand<object>(QueryLots);
|
||||
ToChartCommand = new BaseCommand<object>(GoToChart);
|
||||
HistoryData = new ObservableCollection<LazyTreeItem<WaferHistoryItem>>();
|
||||
|
||||
InitTime();
|
||||
}
|
||||
|
||||
private ObservableCollection<LazyTreeItem<WaferHistoryItem>> _historyData;
|
||||
public ObservableCollection<LazyTreeItem<WaferHistoryItem>> HistoryData
|
||||
{
|
||||
get { return _historyData; }
|
||||
set
|
||||
{
|
||||
_historyData = value;
|
||||
NotifyOfPropertyChange("HistoryData");
|
||||
}
|
||||
}
|
||||
|
||||
private WaferHistoryItem _selectedItem;
|
||||
public WaferHistoryItem SelectedItem
|
||||
{
|
||||
get { return _selectedItem; }
|
||||
set
|
||||
{
|
||||
_selectedItem = value;
|
||||
NotifyOfPropertyChange("SelectedItem");
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<WaferHistoryLot> _lots = new ObservableCollection<WaferHistoryLot>();
|
||||
public ObservableCollection<WaferHistoryLot> Lots
|
||||
{
|
||||
get { return _lots; }
|
||||
set
|
||||
{
|
||||
_lots = value;
|
||||
NotifyOfPropertyChange("Lots");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ObservableCollection<WaferHistoryWafer> _wafers = new ObservableCollection<WaferHistoryWafer>();
|
||||
public ObservableCollection<WaferHistoryWafer> Wafers
|
||||
{
|
||||
get { return _wafers; }
|
||||
set
|
||||
{
|
||||
_wafers = value;
|
||||
NotifyOfPropertyChange("Wafers");
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<WaferHistoryMovement> _movements = new ObservableCollection<WaferHistoryMovement>();
|
||||
public ObservableCollection<WaferHistoryMovement> Movements
|
||||
{
|
||||
get { return _movements; }
|
||||
set
|
||||
{
|
||||
_movements = value;
|
||||
NotifyOfPropertyChange("Movements");
|
||||
}
|
||||
}
|
||||
|
||||
private WaferHistoryRecipe _recipe;
|
||||
public WaferHistoryRecipe Recipe
|
||||
{
|
||||
get { return _recipe; }
|
||||
set
|
||||
{
|
||||
_recipe = value;
|
||||
NotifyOfPropertyChange("Recipe");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ObservableCollection<WaferHistoryRecipe> _recipes = new ObservableCollection<WaferHistoryRecipe>();
|
||||
public ObservableCollection<WaferHistoryRecipe> Recipes
|
||||
{
|
||||
get { return _recipes; }
|
||||
set
|
||||
{
|
||||
_recipes = value;
|
||||
NotifyOfPropertyChange("Recipes");
|
||||
}
|
||||
}
|
||||
private DateTime _searchBeginTime;
|
||||
public DateTime SearchBeginTime
|
||||
{
|
||||
get { return _searchBeginTime; }
|
||||
set
|
||||
{
|
||||
_searchBeginTime = value;
|
||||
NotifyOfPropertyChange("SearchBeginTime");
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime _searchEndTime;
|
||||
public DateTime SearchEndTime
|
||||
{
|
||||
get { return _searchEndTime; }
|
||||
set
|
||||
{
|
||||
_searchEndTime = value;
|
||||
NotifyOfPropertyChange("SearchEndTime");
|
||||
}
|
||||
}
|
||||
|
||||
private string keyWord;
|
||||
private WaferHistoryDBView view;
|
||||
|
||||
public string KeyWord
|
||||
{
|
||||
get { return keyWord; }
|
||||
set
|
||||
{
|
||||
keyWord = value;
|
||||
NotifyOfPropertyChange("KeyWord");
|
||||
}
|
||||
}
|
||||
public ICommand SelectionChangedCommand { get; set; }
|
||||
|
||||
public ICommand QueryCommand { get; set; }
|
||||
|
||||
public ICommand ToChartCommand { get; set; }
|
||||
|
||||
void InitTime()
|
||||
{
|
||||
SearchBeginTime = DateTime.Now.Date;
|
||||
SearchEndTime = DateTime.Now.Date.AddDays(1).Date;
|
||||
}
|
||||
|
||||
|
||||
void QueryLots(object e)
|
||||
{
|
||||
this.SearchBeginTime = this.view.wfTimeFrom.Value;
|
||||
this.SearchEndTime = this.view.wfTimeTo.Value;
|
||||
|
||||
if (SearchBeginTime > SearchEndTime)
|
||||
{
|
||||
MessageBox.Show("Time range invalid, start time should be early than end time");
|
||||
return;
|
||||
}
|
||||
|
||||
Lots = new ObservableCollection<WaferHistoryLot>(QueryLot(SearchBeginTime, SearchEndTime, KeyWord));//.OrderByDescending(lot => lot.StartTime).ToArray();
|
||||
|
||||
HistoryData.Clear();
|
||||
var lotsItem = new WaferHistoryItem() { Name = "Lots", };
|
||||
var root = new LazyTreeItem<WaferHistoryItem>(lotsItem, x => LoadSubItem(x));
|
||||
root.SubItems = new ObservableCollection<LazyTreeItem<WaferHistoryItem>>(Lots.Select(x => new LazyTreeItem<WaferHistoryItem>(new WaferHistoryItem() { ID = x.ID, Name = x.Name, StartTime = x.StartTime, EndTime = x.EndTime, Type = WaferHistoryItemType.Lot }, LoadSubItem)));
|
||||
root.IsExpanded = true;
|
||||
HistoryData.Add(root);
|
||||
|
||||
SelectedItem = lotsItem;
|
||||
}
|
||||
/// <summary>
|
||||
/// Notify chart page to prepare datas
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
void GoToChart(object o)
|
||||
{
|
||||
WaferHistoryRecipe chartQuery = null;
|
||||
|
||||
if (o is string name)
|
||||
{
|
||||
var query = _recipes.FirstOrDefault(t => t.Recipe == name);
|
||||
if (query is null) return;
|
||||
chartQuery = query;
|
||||
}
|
||||
if (o is WaferHistoryLot waferLot)
|
||||
{
|
||||
DateTime start = waferLot.StartTime;
|
||||
double.TryParse(waferLot.Duration, out double duration);
|
||||
DateTime end = start.AddSeconds(duration);
|
||||
chartQuery = new WaferHistoryRecipe() { StartTime = start, EndTime = end, /*Chamber = waferLot.CarrierID */};
|
||||
|
||||
}
|
||||
else if (o is WaferHistoryWafer wafer)
|
||||
{
|
||||
chartQuery = new WaferHistoryRecipe() { StartTime = wafer.StartTime, EndTime = wafer.EndTime/*,Chamber = waferLot.CarrierID*/ };
|
||||
}
|
||||
|
||||
//导航切换到chart页面
|
||||
BaseApp.Instance.SwitchPage("DataLog", "DataHistory", chartQuery);
|
||||
}
|
||||
|
||||
public List<WaferHistoryLot> QueryLot(DateTime from, DateTime to, string key)
|
||||
|
||||
{
|
||||
List<WaferHistoryLot> result = new List<WaferHistoryLot>();
|
||||
|
||||
string sql = $"SELECT * FROM \"lot_data\" where \"start_time\" >= '{from:yyyy/MM/dd HH:mm:ss.fff}' and \"start_time\" <= '{to:yyyy/MM/dd HH:mm:ss.fff}' order by \"start_time\" ASC;";
|
||||
|
||||
//Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
//{
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferHistoryLot item = new WaferHistoryLot();
|
||||
|
||||
string name = dbData.Rows[i]["name"].ToString();
|
||||
string time = "";
|
||||
item.WaferCount = (int)dbData.Rows[i]["total_wafer_count"];
|
||||
item.ID = dbData.Rows[i]["guid"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["start_time"].Equals(DBNull.Value))
|
||||
{
|
||||
item.StartTime = ((DateTime)dbData.Rows[i]["start_time"]);
|
||||
time = item.StartTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
if (!dbData.Rows[i]["end_time"].Equals(DBNull.Value))
|
||||
{
|
||||
item.EndTime = ((DateTime)dbData.Rows[i]["end_time"]);
|
||||
}
|
||||
|
||||
item.Name = $"{name} - {time}";
|
||||
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<WaferHistoryWafer> QueryLotWafer(string lotGuid)
|
||||
{
|
||||
List<WaferHistoryWafer> result = new List<WaferHistoryWafer>();
|
||||
|
||||
string sql = $"SELECT * FROM \"wafer_data\",\"lot_wafer_data\" where \"lot_wafer_data\".\"lot_data_guid\" = '{lotGuid}' and \"lot_wafer_data\".\"wafer_data_guid\" = \"wafer_data\".\"guid\" order by \"wafer_data\".\"create_time\" ASC;;";
|
||||
|
||||
Wafers.Clear();
|
||||
//Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
//{
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferHistoryWafer item = new WaferHistoryWafer();
|
||||
|
||||
item.ID = dbData.Rows[i]["guid"].ToString();
|
||||
var itemLoadPort = dbData.Rows[i]["create_station"].ToString();
|
||||
var itemSlot = dbData.Rows[i]["create_slot"].ToString();
|
||||
|
||||
//item.CarrierID = dbData.Rows[i]["rfid"].ToString();
|
||||
|
||||
//item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
||||
var itemWaferID = dbData.Rows[i]["wafer_id"].ToString();
|
||||
|
||||
item.Sequence = dbData.Rows[i]["sequence_name"].ToString();
|
||||
|
||||
item.Status = dbData.Rows[i]["process_status"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["create_time"].Equals(DBNull.Value))
|
||||
{
|
||||
item.StartTime = ((DateTime)dbData.Rows[i]["create_time"]);
|
||||
}
|
||||
|
||||
if (!dbData.Rows[i]["delete_time"].Equals(DBNull.Value))
|
||||
item.EndTime = ((DateTime)dbData.Rows[i]["delete_time"]);
|
||||
|
||||
item.Name = $"{itemLoadPort} - {itemSlot} - {itemWaferID}";
|
||||
|
||||
item.Type = WaferHistoryItemType.Wafer;
|
||||
|
||||
Wafers.Add(item);
|
||||
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public List<WaferHistoryRecipe> QueryWaferRecipe(string waferGuid)
|
||||
{
|
||||
List<WaferHistoryRecipe> result = new List<WaferHistoryRecipe>();
|
||||
|
||||
string sql = $"SELECT * FROM \"process_data\" where \"wafer_data_guid\" = '{waferGuid}';";
|
||||
|
||||
Recipes.Clear();
|
||||
//Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
//{
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferHistoryRecipe item = new WaferHistoryRecipe();
|
||||
|
||||
item.ID = dbData.Rows[i]["guid"].ToString();
|
||||
var itemName = dbData.Rows[i]["recipe_name"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
||||
item.StartTime = (DateTime)dbData.Rows[i]["process_begin_time"];
|
||||
|
||||
if (dbData.Rows[i].Table.Columns.Contains("process_end_time") && !dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
||||
item.EndTime = (DateTime)dbData.Rows[i]["process_end_time"];
|
||||
|
||||
if (dbData.Rows[i].Table.Columns.Contains("recipe_setting_time") && !dbData.Rows[i]["recipe_setting_time"].Equals(DBNull.Value))
|
||||
item.SettingTime = dbData.Rows[i]["recipe_setting_time"].ToString();
|
||||
|
||||
item.ActualTime = item.Duration;
|
||||
|
||||
item.Recipe = itemName;
|
||||
|
||||
item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
||||
|
||||
item.Name = itemName;
|
||||
|
||||
item.Type = WaferHistoryItemType.Recipe;
|
||||
|
||||
Recipes.Add(item);
|
||||
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public string QueryWaferInnerIDToWaferID(string waferInnerD)
|
||||
{
|
||||
string sql = $"SELECT * FROM \"wafer_data\" where \"guid\" = '{waferInnerD}';";
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
return dbData.Rows[0]["wafer_id"].ToString();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public List<WaferHistoryMovement> QueryWaferMovement(string waferGuid)
|
||||
{
|
||||
List<WaferHistoryMovement> result = new List<WaferHistoryMovement>();
|
||||
|
||||
string sql = $"SELECT * FROM \"wafer_move_history\" where \"wafer_data_guid\" = '{waferGuid}' order by \"arrive_time\" ASC limit 1000;";
|
||||
|
||||
Movements.Clear();
|
||||
//Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
//{
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count - 1; i++)
|
||||
{
|
||||
WaferHistoryMovement item = new WaferHistoryMovement();
|
||||
|
||||
item.Source = $"station : {dbData.Rows[i]["station"]} slot : {dbData.Rows[i]["slot"]}";
|
||||
item.Destination = $"station : {dbData.Rows[i + 1]["station"]} slot : {dbData.Rows[i + 1]["slot"]}";
|
||||
item.InTime = dbData.Rows[i]["arrive_time"].ToString();
|
||||
|
||||
result.Add(item);
|
||||
|
||||
Movements.Add(item);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public WaferHistoryRecipe QueryRecipe(string recipeGuid)
|
||||
{
|
||||
WaferHistoryRecipe result = new WaferHistoryRecipe();
|
||||
|
||||
string sql = $"SELECT * FROM \"process_data\" where \"guid\" = '{recipeGuid}';";
|
||||
|
||||
|
||||
//Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
//{
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferHistoryRecipe item = new WaferHistoryRecipe();
|
||||
|
||||
item.ID = dbData.Rows[i]["guid"].ToString();
|
||||
var itemName = dbData.Rows[i]["recipe_name"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
||||
item.StartTime = (DateTime)dbData.Rows[i]["process_begin_time"];
|
||||
|
||||
if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
||||
item.EndTime = (DateTime)dbData.Rows[i]["process_end_time"];
|
||||
|
||||
if (dbData.Rows[i].Table.Columns.Contains("recipe_setting_time") && !dbData.Rows[i]["recipe_setting_time"].Equals(DBNull.Value))
|
||||
item.SettingTime = dbData.Rows[i]["recipe_setting_time"].ToString();
|
||||
|
||||
item.ActualTime = item.Duration;
|
||||
|
||||
item.Recipe = itemName;
|
||||
|
||||
item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
||||
|
||||
item.Name = itemName;
|
||||
|
||||
item.Type = WaferHistoryItemType.Recipe;
|
||||
|
||||
result = item;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sql = $"SELECT * FROM \"recipe_step_data\" where \"process_data_guid\" = '{recipeGuid}' order by step_number ASC;";
|
||||
dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
List<RecipeStep> steps = new List<RecipeStep>();
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
RecipeStep item = new RecipeStep();
|
||||
|
||||
item.No = int.Parse(dbData.Rows[i]["step_number"].ToString());
|
||||
item.Name = dbData.Rows[i]["step_name"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["step_begin_time"].Equals(DBNull.Value))
|
||||
item.StartTime = (DateTime)dbData.Rows[i]["step_begin_time"];
|
||||
|
||||
if (!dbData.Rows[i]["step_end_time"].Equals(DBNull.Value))
|
||||
item.EndTime = (DateTime)dbData.Rows[i]["step_end_time"];
|
||||
|
||||
item.ActualTime = item.EndTime.CompareTo(item.StartTime) <= 0 ? "" : item.EndTime.Subtract(item.StartTime).TotalSeconds.ToString();
|
||||
|
||||
item.SettingTime = dbData.Rows[i]["step_time"].ToString();
|
||||
|
||||
steps.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sql = $"SELECT * FROM \"step_fdc_data\" where \"process_data_guid\" = '{recipeGuid}' order by step_number ASC;";
|
||||
dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
List<RecipeStepFdcData> fdcs = new List<RecipeStepFdcData>();
|
||||
if (dbData != null && dbData.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
RecipeStepFdcData item = new RecipeStepFdcData();
|
||||
|
||||
item.StepNumber = int.Parse(dbData.Rows[i]["step_number"].ToString());
|
||||
item.Name = dbData.Rows[i]["parameter_name"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["sample_count"].Equals(DBNull.Value))
|
||||
item.SampleCount = (int)dbData.Rows[i]["sample_count"];
|
||||
|
||||
if (!dbData.Rows[i]["setpoint"].Equals(DBNull.Value))
|
||||
item.SetPoint = (float)dbData.Rows[i]["setpoint"];
|
||||
|
||||
if (!dbData.Rows[i]["min_value"].Equals(DBNull.Value))
|
||||
item.MinValue = (float)dbData.Rows[i]["min_value"];
|
||||
|
||||
if (!dbData.Rows[i]["max_value"].Equals(DBNull.Value))
|
||||
item.MaxValue = (float)dbData.Rows[i]["max_value"];
|
||||
|
||||
if (!dbData.Rows[i]["std_value"].Equals(DBNull.Value))
|
||||
item.StdValue = (float)dbData.Rows[i]["std_value"];
|
||||
|
||||
if (!dbData.Rows[i]["mean_value"].Equals(DBNull.Value))
|
||||
item.MeanValue = (float)dbData.Rows[i]["mean_value"];
|
||||
|
||||
|
||||
fdcs.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
result.Steps = steps;
|
||||
result.Fdcs = fdcs;
|
||||
|
||||
Recipe = result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SelectionChanged(WaferHistoryItem item)
|
||||
{
|
||||
switch (item.Type)
|
||||
{
|
||||
case WaferHistoryItemType.Lot:
|
||||
|
||||
QueryLotWafer(item.ID);
|
||||
|
||||
break;
|
||||
case WaferHistoryItemType.Wafer:
|
||||
QueryWaferRecipe(item.ID);
|
||||
string waferID = QueryWaferInnerIDToWaferID(item.ID);
|
||||
if (!string.IsNullOrEmpty(waferID))
|
||||
{
|
||||
QueryWaferMovement(waferID);
|
||||
}
|
||||
|
||||
break;
|
||||
case WaferHistoryItemType.Recipe:
|
||||
|
||||
QueryRecipe(item.ID);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
SelectedItem = item;
|
||||
}
|
||||
|
||||
protected List<LazyTreeItem<WaferHistoryItem>> LoadSubItem(WaferHistoryItem item)
|
||||
{
|
||||
switch (item.Type)
|
||||
{
|
||||
case WaferHistoryItemType.Lot:
|
||||
var wafers = QueryLotWafer(item.ID);
|
||||
return wafers.Select(x => new LazyTreeItem<WaferHistoryItem>(x, y => LoadSubItem(y))).OrderBy(s => s.Data.StartTime).ToList();
|
||||
case WaferHistoryItemType.Wafer:
|
||||
var recipes = QueryWaferRecipe(item.ID);
|
||||
return recipes.Select(x => new LazyTreeItem<WaferHistoryItem>(x, y => LoadSubItem(y))).OrderBy(s => s.Data.StartTime).ToList();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return new List<LazyTreeItem<WaferHistoryItem>> { };
|
||||
}
|
||||
|
||||
|
||||
protected override void OnViewLoaded(object _view)
|
||||
{
|
||||
base.OnViewLoaded(_view);
|
||||
this.view = (WaferHistoryDBView)_view;
|
||||
this.view.wfTimeFrom.Value = this.SearchBeginTime;
|
||||
this.view.wfTimeTo.Value = this.SearchEndTime;
|
||||
|
||||
QueryLots(new object());
|
||||
SelectionChanged(SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class LazyTreeItem<T> : INotifyPropertyChanged where T : ITreeItem<T>, new()
|
||||
{
|
||||
private LazyTreeItem<T> dummyChild;
|
||||
private T data;
|
||||
private Func<T, List<LazyTreeItem<T>>> loader;
|
||||
|
||||
|
||||
private LazyTreeItem()
|
||||
{
|
||||
data = new T();
|
||||
data.ID = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
public LazyTreeItem(T data, Func<T, List<LazyTreeItem<T>>> loader)
|
||||
{
|
||||
this.data = data;
|
||||
this.loader = loader;
|
||||
|
||||
dummyChild = new LazyTreeItem<T>();
|
||||
|
||||
SubItems = new ObservableCollection<LazyTreeItem<T>>();
|
||||
SubItems.Add(dummyChild);
|
||||
}
|
||||
|
||||
public T Data
|
||||
{
|
||||
get
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ObservableCollection<LazyTreeItem<T>> SubItems
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private bool isExpanded;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void OnPropertyChanged(string name)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasDummyChild
|
||||
{
|
||||
get { return SubItems.Count == 1 && SubItems.First().data.ID == dummyChild.data.ID; }
|
||||
}
|
||||
|
||||
public bool IsExpanded
|
||||
{
|
||||
get { return isExpanded; }
|
||||
set
|
||||
{
|
||||
if (value != isExpanded)
|
||||
{
|
||||
isExpanded = value;
|
||||
OnPropertyChanged("IsExpanded");
|
||||
}
|
||||
|
||||
if (HasDummyChild)
|
||||
{
|
||||
SubItems.Remove(dummyChild);
|
||||
var items = loader(data);
|
||||
items.ForEachDo(x => SubItems.Add(x));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+335
@@ -0,0 +1,335 @@
|
||||
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory.WaferHistoryView"
|
||||
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:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:interop="clr-namespace:Microsoft.DwayneNeed.Interop;assembly=Microsoft.DwayneNeed"
|
||||
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="1800">
|
||||
<Grid IsEnabled="{Binding IsPermission}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="280"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Query Condition" Style="{DynamicResource Table_TitleStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="30"/>
|
||||
<Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<StackPanel Margin="0,5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Start Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
|
||||
<interop:AirspaceDecorator AirspaceMode="Redirect" IsInputRedirectionEnabled="True" IsOutputRedirectionEnabled="True">
|
||||
<wfi:WindowsFormsHost Margin="0,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
</interop:AirspaceDecorator>
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<TextBlock Text="End Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
|
||||
<interop:AirspaceDecorator AirspaceMode="Redirect" IsInputRedirectionEnabled="True" IsOutputRedirectionEnabled="True" >
|
||||
<wfi:WindowsFormsHost Margin="0,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
</interop:AirspaceDecorator>
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Label Grid.Row="2" Margin="0,5,0,0" Content="Query Option" Style="{DynamicResource Table_TitleStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="30"/>
|
||||
<Border Grid.Row="3" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<StackPanel Margin="0,5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Load Port" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<!--<TextBox x:Name="tbLoadPort" Text="" Width="115" Height="25" Margin="5,0,0,0"/>-->
|
||||
<toolkit:CheckComboBox x:Name="tbLoadPort" ItemsSource="{Binding SourceLP}" Width="120" FontFamily="Arial" FontSize="14" Height="25" Margin="5,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
SelectedValue="{Binding SelectedValueLP}" ToolTip="Value">
|
||||
|
||||
</toolkit:CheckComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<TextBlock Text="Wafer ID" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbWaferID" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Lot ID" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbLotID" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Carrier ID" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbCarrierID" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<!--<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Sequence Name" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbSequenceName" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Process Chamber" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbProcessChamber" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Process Recipe" Width="120" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Right"/>
|
||||
<TextBox x:Name="tbProcessRecipe" Text="" Width="115" Height="25" Margin="5,0,0,0"/>
|
||||
</StackPanel>-->
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Grid Grid.Row="4">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,20">
|
||||
<Button Content="Query" Width="100" Height="30">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Query">
|
||||
<micro:Parameter Value="{Binding ElementName=tbLoadPort, Path=SelectedValue}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbWaferID, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbLotID, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbCarrierID, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbSequenceName, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbProcessChamber, Path=Text}"/>
|
||||
<micro:Parameter Value="{Binding ElementName=tbProcessRecipe, Path=Text}"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
<Button Content="Export" Width="100" Height="30" Margin="0,10,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Export">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
<Button Content="ExportMove" Width="100" Height="30" Margin="0,10,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="ExportMove">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" Margin="10,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="520"/>
|
||||
<RowDefinition Height="250"/>
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid AutoGenerateColumns="False" Name="dataGrid_LotList" ItemsSource="{Binding Wafers}" CanUserAddRows="False" CanUserResizeColumns="True" CanUserResizeRows="False" HorizontalAlignment="Left"
|
||||
FontFamily="Arial" FontSize="14" DataContextChanged="dataGrid_LotList_DataContextChanged">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding CreateTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Create Time" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding CreateTime}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding DeleteTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Delete Time" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding DeleteTime}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding LoadPort, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Load Port" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding LoadPort}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="160" CanUserSort="True" Binding="{Binding Slot, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Slot" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Slot}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding CarrierID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Carrier ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding CarrierID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding LotID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Lot ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding LotID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding WaferID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Wafer ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding WaferID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" CanUserSort="True" Binding="{Binding Status, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Status" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Status}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<micro:ActionMessage MethodName="WaferHistoryChanged">
|
||||
<micro:Parameter Value="{Binding ElementName=dataGrid_LotList, Path=SelectedItem}"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</DataGrid>
|
||||
<Grid Grid.Row="1" Margin="0,5,0,0" HorizontalAlignment="Left">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1585"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" ItemsSource="{Binding Movements}"
|
||||
FontFamily="Arial" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Time, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Time" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Time}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Station, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Station" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Station}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Slot, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Slot" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Slot}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding Status, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Status" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding Status}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Width="200" Binding="{Binding WaferID, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
|
||||
<DataGridTextColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Wafer ID" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="ToolTip" Value="{Binding WaferID}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
<!--<s:SciChartSurface x:Name="sciChart" BorderBrush="Gray" Grid.Column="1" Width="500"
|
||||
s:ThemeManager.Theme="ExpressionLight"
|
||||
RenderableSeries="{Binding RenderableSeries}" Annotations="{Binding Annotations}">
|
||||
<s:SciChartSurface.XAxis>
|
||||
<s:NumericAxis AxisTitle="Number of Samples (per Series)" AutoRange="Always"/>
|
||||
</s:SciChartSurface.XAxis>
|
||||
<s:SciChartSurface.YAxis>
|
||||
<s:NumericAxis AxisTitle="Value" AutoRange="Never" AxisAlignment="Left" VisibleRange="0,8" LabelProvider="{Binding YLabelProvider}" />
|
||||
</s:SciChartSurface.YAxis>
|
||||
|
||||
<s:SciChartSurface.ChartModifier>
|
||||
|
||||
<s:ModifierGroup ExecuteOn="MouseDoubleClick">
|
||||
<s:CursorModifier IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True" SourceMode="AllSeries" ShowTooltip="False" />
|
||||
</s:ModifierGroup>
|
||||
</s:SciChartSurface.ChartModifier>
|
||||
|
||||
</s:SciChartSurface>-->
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
/// <summary>
|
||||
/// WaferHistoryView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WaferHistoryView : UserControl
|
||||
{
|
||||
public WaferHistoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void dataGrid_LotList_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
dataGrid_LotList.CanUserAddRows = false;
|
||||
if (dataGrid_LotList.Items == null || dataGrid_LotList.Items.Count == 0)
|
||||
dataGrid_LotList.CanUserAddRows = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+380
@@ -0,0 +1,380 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Windows;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.Common.Utilities;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase;
|
||||
using SciChart.Charting.Model.DataSeries;
|
||||
using SciChart.Charting.Visuals.Annotations;
|
||||
using SciChart.Charting.Visuals.RenderableSeries;
|
||||
using SciChart.Data.Model;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
public class WaferHistoryDetail
|
||||
{
|
||||
public string Guid { get; set; }
|
||||
public string CreateTime { get; set; }
|
||||
public string DeleteTime { get; set; }
|
||||
public string LoadPort { get; set; }
|
||||
public string Slot { get; set; }
|
||||
public string CarrierID { get; set; }
|
||||
public string LotID { get; set; }
|
||||
public string WaferID { get; set; }
|
||||
public string Status { get; set; }
|
||||
|
||||
public string LotId { get; set; }
|
||||
public string SequenceName { get; set; }
|
||||
public string NotchAngle { get; set; }
|
||||
}
|
||||
|
||||
public class WaferMovement
|
||||
{
|
||||
public string Time { get; set; }
|
||||
public string Station { get; set; }
|
||||
public string Slot { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string WaferID { get; set; }
|
||||
}
|
||||
|
||||
public class WaferHistoryViewModel : BaseModel
|
||||
{
|
||||
public DateTime BeginDate { get; set; }
|
||||
public DateTime StartDateTime { get; set; }
|
||||
public DateTime EndDateTime { get; set; }
|
||||
public DateTime UIEndTime { get; set; }
|
||||
|
||||
|
||||
public ObservableCollection<WaferHistoryDetail> Wafers { get; set; }
|
||||
public ObservableCollection<WaferMovement> Movements { get; set; }
|
||||
|
||||
public ObservableCollection<string> SourceLP { get; set; }
|
||||
public string SelectedValueLP { get; set; }
|
||||
|
||||
public WaferHistoryViewModel()
|
||||
{
|
||||
this.DisplayName = "Wafer History";
|
||||
var now = DateTime.Now;
|
||||
this.StartDateTime = now;
|
||||
this.BeginDate = now;
|
||||
this.StartDateTime = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, 0);
|
||||
this.EndDateTime = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59, 999);
|
||||
this.Wafers = new ObservableCollection<WaferHistoryDetail>();
|
||||
this.Movements = new ObservableCollection<WaferMovement>();
|
||||
|
||||
|
||||
SourceLP = new ObservableCollection<string>(new[] { "LP1", "LP2", "LP3" });
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
this.YLabelProvider = new YAxisLabelProvider();
|
||||
this.RenderableSeries = new ObservableCollection<IRenderableSeries>();
|
||||
this.RenderableSeries.Add(new FastLineRenderableSeries() { DataSeries = new XyDataSeries<int, int>() });
|
||||
this.Annotations = new AnnotationCollection();
|
||||
}
|
||||
|
||||
private WaferHistoryView view;
|
||||
public void Query(string loadport, string waferid, string lotid, string carrierid, string sequencename, string processchamber, string processrecipe)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.StartDateTime = this.view.wfTimeFrom.Value;
|
||||
this.EndDateTime = this.view.wfTimeTo.Value;
|
||||
|
||||
if (StartDateTime > EndDateTime)
|
||||
{
|
||||
MessageBox.Show("Time range invalid, start time should be early than end time");
|
||||
return;
|
||||
}
|
||||
|
||||
string sql = string.Format(
|
||||
"SELECT * FROM \"wafer_data\",\"carrier_data\" where \"create_time\" >= '{0}' and \"create_time\" <= '{1}' and \"wafer_data\".\"carrier_data_guid\"=\"carrier_data\".\"guid\"",
|
||||
StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff"), EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff"));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(loadport))
|
||||
{
|
||||
sql += " and (FALSE ";
|
||||
var loadPorts = loadport.Split(',');
|
||||
for (int i = 0; i < loadPorts.Length; i++)
|
||||
{
|
||||
sql += $" OR \"create_station\"='{loadPorts[i]}'";
|
||||
}
|
||||
sql += " )";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(waferid))
|
||||
sql += $" and lower(\"wafer_id\") like '%{waferid.ToLower()}%'";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(lotid))
|
||||
sql += $" and lower(\"wafer_data\".\"lot_id\") like '%{lotid.ToLower()}%'";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(carrierid))
|
||||
sql += $" and lower(\"rfid\") like '%{carrierid.ToLower()}%'";
|
||||
|
||||
sql += " order by \"create_time\" ASC, \"create_station\" ASC,\"create_slot\" ASC";
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Wafers.Clear();
|
||||
try
|
||||
{
|
||||
if (dbData == null || dbData.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferHistoryDetail item = new WaferHistoryDetail();
|
||||
|
||||
item.Guid = dbData.Rows[i]["guid"].ToString();
|
||||
item.LoadPort = dbData.Rows[i]["create_station"].ToString();
|
||||
item.Slot = dbData.Rows[i]["create_slot"].ToString();
|
||||
|
||||
item.CarrierID = dbData.Rows[i]["rfid"].ToString();
|
||||
|
||||
item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
||||
item.WaferID = dbData.Rows[i]["wafer_id"].ToString();
|
||||
|
||||
item.Status = dbData.Rows[i]["process_status"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["create_time"].Equals(DBNull.Value))
|
||||
item.CreateTime = ((DateTime)dbData.Rows[i]["create_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
if (!dbData.Rows[i]["delete_time"].Equals(DBNull.Value))
|
||||
item.DeleteTime = ((DateTime)dbData.Rows[i]["delete_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
Wafers.Add(item);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
}
|
||||
|
||||
}));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.Write(e);
|
||||
}
|
||||
}
|
||||
public void WaferHistoryChanged(WaferHistoryDetail detail)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (detail == null)
|
||||
{
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Movements.Clear();
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
string sql = string.Format(
|
||||
"SELECT * FROM \"wafer_move_history\" where \"wafer_data_guid\" = '{0}' order by \"arrive_time\" ASC;",
|
||||
detail.Guid);
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Movements.Clear();
|
||||
|
||||
if (dbData == null || dbData.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
WaferMovement item = new WaferMovement();
|
||||
|
||||
item.Station = dbData.Rows[i]["station"].ToString();
|
||||
item.Slot = dbData.Rows[i]["slot"].ToString();
|
||||
item.Status = dbData.Rows[i]["status"].ToString();
|
||||
item.WaferID = detail.WaferID;
|
||||
|
||||
if (!dbData.Rows[i]["arrive_time"].Equals(DBNull.Value))
|
||||
item.Time = ((DateTime)dbData.Rows[i]["arrive_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
Movements.Add(item);
|
||||
}
|
||||
|
||||
|
||||
}));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.Write(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void Export()
|
||||
{
|
||||
try
|
||||
{
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"{DisplayName}_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
|
||||
if (result == true) // Process open file dialog box results
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
ds.Tables.Add(new System.Data.DataTable("系统运行日志"));
|
||||
ds.Tables[0].Columns.Add("CreateTime");
|
||||
ds.Tables[0].Columns.Add("DeleteTime");
|
||||
ds.Tables[0].Columns.Add("LoadPort");
|
||||
ds.Tables[0].Columns.Add("Slot");
|
||||
ds.Tables[0].Columns.Add("CarrierID");
|
||||
ds.Tables[0].Columns.Add("LotID");
|
||||
ds.Tables[0].Columns.Add("WaferID");
|
||||
ds.Tables[0].Columns.Add("Status");
|
||||
foreach (var item in Wafers)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = item.CreateTime;
|
||||
row[1] = item.DeleteTime;
|
||||
row[2] = item.LoadPort;
|
||||
row[3] = item.Slot;
|
||||
row[4] = item.CarrierID;
|
||||
row[5] = item.LotID;
|
||||
row[6] = item.WaferID;
|
||||
row[7] = item.Status;
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
MessageBox.Show("导出系统日志发生错误", "导出失败", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
public void ExportMove()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Movements.Count == 0)
|
||||
{
|
||||
DialogBox.ShowDialog(DialogButton.OK, DialogType.INFO, "No wafer move history to export.");
|
||||
return;
|
||||
}
|
||||
|
||||
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
|
||||
dlg.DefaultExt = ".xlsx"; // Default file extension
|
||||
dlg.FileName = $"Wafer_Move_History_{DateTime.Now:yyyyMMdd_HHmmss}";
|
||||
dlg.Filter = "Excel数据表格文件(*.xlsx)|*.xlsx"; // Filter files by extension
|
||||
Nullable<bool> result = dlg.ShowDialog();// Show open file dialog box
|
||||
if (result == true) // Process open file dialog box results
|
||||
{
|
||||
System.Data.DataSet ds = new System.Data.DataSet();
|
||||
ds.Tables.Add(new System.Data.DataTable("系统运行日志"));
|
||||
ds.Tables[0].Columns.Add("Time");
|
||||
ds.Tables[0].Columns.Add("Station");
|
||||
ds.Tables[0].Columns.Add("Slot");
|
||||
ds.Tables[0].Columns.Add("Status");
|
||||
ds.Tables[0].Columns.Add("WaferId");
|
||||
foreach (var item in Movements)
|
||||
{
|
||||
var row = ds.Tables[0].NewRow();
|
||||
row[0] = item.Time;
|
||||
row[1] = item.Station;
|
||||
row[2] = item.Slot;
|
||||
row[3] = item.Status;
|
||||
row[4] = item.WaferID;
|
||||
ds.Tables[0].Rows.Add(row);
|
||||
}
|
||||
|
||||
if (!ExcelHelper.ExportToExcel(dlg.FileName, ds, out string reason))
|
||||
{
|
||||
MessageBox.Show($"Export failed, {reason}", "Export", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show($"Export succeed, file save as {dlg.FileName}", "Export", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
MessageBox.Show($"导出系统日志发生错误", "导出失败", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#region scichart
|
||||
|
||||
public ObservableCollection<IRenderableSeries> RenderableSeries
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
private AnnotationCollection _annotations = new AnnotationCollection();
|
||||
public AnnotationCollection Annotations
|
||||
{
|
||||
get { return _annotations; }
|
||||
set { _annotations = value; }
|
||||
}
|
||||
|
||||
private IRange _TimeRange;
|
||||
public IRange TimeRange
|
||||
{
|
||||
get { return _TimeRange; }
|
||||
set
|
||||
{
|
||||
_TimeRange = value;
|
||||
NotifyOfPropertyChange("TimeRange");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private IRange _YTimeRange;
|
||||
public IRange YTimeRange
|
||||
{
|
||||
get { return _YTimeRange; }
|
||||
set { _YTimeRange = value; }
|
||||
}
|
||||
|
||||
|
||||
public YAxisLabelProvider YLabelProvider { get; set; }
|
||||
public void AppendData()
|
||||
{
|
||||
(this.RenderableSeries[0].DataSeries as XyDataSeries<int, int>).Clear();
|
||||
|
||||
for (var index = 1; index <= 8; index++)
|
||||
{
|
||||
(this.RenderableSeries[0].DataSeries as XyDataSeries<int, int>).Append(index * 5, index);
|
||||
|
||||
this.Annotations.Add(new LineArrowAnnotation() { X1 = index * 5, Y1 = index, X2 = index * 5, Y2 = index + 2, });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded(object _view)
|
||||
{
|
||||
base.OnViewLoaded(_view);
|
||||
this.view = (WaferHistoryView)_view;
|
||||
this.view.wfTimeFrom.Value = this.StartDateTime;
|
||||
this.view.wfTimeTo.Value = this.EndDateTime;
|
||||
this.AppendData();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using SciChart.Charting.Visuals.Axes.LabelProviders;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory
|
||||
{
|
||||
public class YAxisLabelProvider : LabelProviderBase
|
||||
{
|
||||
//public string[] LabelList { get; set; }
|
||||
|
||||
private readonly string[] LabelList = { "Unload", "HotN2", "QDR2", "AP7990-2", "QDR1", "AP7990-1", "C/C", "Load" };
|
||||
|
||||
public override string FormatLabel(IComparable dataValue)
|
||||
{
|
||||
var i = Convert.ToInt32(dataValue);
|
||||
|
||||
int len = LabelList.Length;
|
||||
|
||||
string result = "";
|
||||
if (i >= 0 && i < len)
|
||||
{
|
||||
result = LabelList[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string FormatCursorLabel(IComparable dataValue)
|
||||
{
|
||||
var i = Convert.ToInt32(dataValue);
|
||||
string result = "";
|
||||
if (i >= 0 && i < LabelList.Length)
|
||||
{
|
||||
result = LabelList[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = string.Empty;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user