리크 테스트 gui
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

259 lines
15 KiB

<UserControl x:Class="leak_test_project.Views.DataView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="700" d:DesignWidth="1100" Background="#F4F6F7">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<!-- Updated Premium Legacy Styles for Data View -->
<Style x:Key="FilterHeaderBorder" TargetType="Border">
<Setter Property="Background" Value="#34495E"/>
<Setter Property="BorderBrush" Value="#2C3E50"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Height" Value="35"/>
</Style>
<Style x:Key="FilterHeaderLabel" TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="FilterContentBorder" TargetType="Border">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#BDC3C7"/>
<Setter Property="BorderThickness" Value="1,0,1,1"/>
<Setter Property="Height" Value="45"/>
</Style>
<Style x:Key="ActionButton" TargetType="Button">
<Setter Property="Width" Value="110"/>
<Setter Property="Height" Value="45"/>
<Setter Property="Margin" Value="5,0"/>
<Setter Property="Background" Value="#E5E8E8"/>
<Setter Property="BorderBrush" Value="#95A5A6"/>
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="13"/>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="#EBEDEF"/>
<Setter Property="Foreground" Value="#2C3E50"/>
<Setter Property="BorderBrush" Value="#BDC3C7"/>
<Setter Property="BorderThickness" Value="0,0,1,1"/>
<Setter Property="Height" Value="40"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<Style TargetType="DataGridCell">
<Setter Property="Padding" Value="5"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="FontSize" Value="13"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#D6EAF8"/>
<Setter Property="Foreground" Value="#2E86C1"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Increase Calendar (DatePicker Popup) Size -->
<Style TargetType="{x:Type Calendar}">
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1.25" ScaleY="1.25"/>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="50"/> <!-- Title -->
<RowDefinition Height="Auto"/> <!-- Filters -->
<RowDefinition Height="*"/> <!-- Grid -->
<RowDefinition Height="Auto"/> <!-- Footer -->
</Grid.RowDefinitions>
<!-- Title Bar -->
<Border Grid.Row="0" Background="#2C3E50" BorderBrush="#1A252F" BorderThickness="0,0,0,2">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="INSPECT DATA LIST (측정 기록 조회)" Foreground="White" FontWeight="SemiBold" HorizontalAlignment="Center" FontSize="17"/>
<TextBlock Text="※ 본 화면은 데이터베이스가 아닌 로컬 CSV 로그 백업 파일을 기준으로 데이터를 조회합니다." Foreground="#BDC3C7" FontSize="11" FontWeight="Normal" Margin="0,3,0,0" HorizontalAlignment="Center"/>
</StackPanel>
</Border>
<!-- Filter Area (2-Row Layout) -->
<StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Center" Margin="0,10">
<!-- Row 1: Common Basic Filters -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
<!-- 기간 -->
<StackPanel Width="320">
<Border Style="{StaticResource FilterHeaderBorder}">
<TextBlock Text="조회 기간" Style="{StaticResource FilterHeaderLabel}"/>
</Border>
<Border Style="{StaticResource FilterContentBorder}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<DatePicker SelectedDate="{Binding StartDate}" Width="130" FontSize="13" VerticalAlignment="Center"/>
<TextBlock Text="~" VerticalAlignment="Center" Margin="8,0" FontSize="16" FontWeight="Bold" Foreground="#7F8C8D"/>
<DatePicker SelectedDate="{Binding EndDate}" Width="130" FontSize="13" VerticalAlignment="Center"/>
</StackPanel>
</Border>
</StackPanel>
<!-- 판정 -->
<StackPanel Width="150" Margin="10,0,0,0">
<Border Style="{StaticResource FilterHeaderBorder}">
<TextBlock Text="판정 결과" Style="{StaticResource FilterHeaderLabel}"/>
</Border>
<Border Style="{StaticResource FilterContentBorder}">
<ComboBox SelectedIndex="{Binding JudgmentIndex}" Width="130" Height="30" VerticalAlignment="Center" FontSize="13">
<ComboBoxItem Content="[전체]"/>
<ComboBoxItem Content="OK"/>
<ComboBoxItem Content="NG"/>
</ComboBox>
</Border>
</StackPanel>
</StackPanel>
<!-- Row 2: Detail Database Columns Filters -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!-- ID 검색 -->
<StackPanel Width="170">
<Border Style="{StaticResource FilterHeaderBorder}">
<TextBlock Text="ID 검색" Style="{StaticResource FilterHeaderLabel}"/>
</Border>
<Border Style="{StaticResource FilterContentBorder}">
<TextBox Text="{Binding IdFilter, UpdateSourceTrigger=PropertyChanged}" Width="150" Height="30" VerticalAlignment="Center" FontSize="13" FontWeight="SemiBold" Padding="5,0"/>
</Border>
</StackPanel>
<!-- 작업자 검색 -->
<StackPanel Width="140" Margin="10,0,0,0">
<Border Style="{StaticResource FilterHeaderBorder}">
<TextBlock Text="작업자" Style="{StaticResource FilterHeaderLabel}"/>
</Border>
<Border Style="{StaticResource FilterContentBorder}">
<TextBox Text="{Binding OperatorFilter, UpdateSourceTrigger=PropertyChanged}" Width="120" Height="30" VerticalAlignment="Center" FontSize="13" FontWeight="SemiBold" Padding="5,0"/>
</Border>
</StackPanel>
<!-- Lot No 검색 -->
<StackPanel Width="140" Margin="10,0,0,0">
<Border Style="{StaticResource FilterHeaderBorder}">
<TextBlock Text="Lot No" Style="{StaticResource FilterHeaderLabel}"/>
</Border>
<Border Style="{StaticResource FilterContentBorder}">
<TextBox Text="{Binding LotNoFilter, UpdateSourceTrigger=PropertyChanged}" Width="120" Height="30" VerticalAlignment="Center" FontSize="13" FontWeight="SemiBold" Padding="5,0"/>
</Border>
</StackPanel>
<!-- 모델 검색 -->
<StackPanel Width="140" Margin="10,0,0,0">
<Border Style="{StaticResource FilterHeaderBorder}">
<TextBlock Text="모델" Style="{StaticResource FilterHeaderLabel}"/>
</Border>
<Border Style="{StaticResource FilterContentBorder}">
<TextBox Text="{Binding ModelFilter, UpdateSourceTrigger=PropertyChanged}" Width="120" Height="30" VerticalAlignment="Center" FontSize="13" FontWeight="SemiBold" Padding="5,0"/>
</Border>
</StackPanel>
<!-- Buttons -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="15,0,0,0">
<Button Content="Search" Style="{StaticResource ActionButton}" Command="{Binding SearchCommand}" Background="#D4E6F1" BorderBrush="#2E86C1"/>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- Main Grid -->
<Border Grid.Row="2" BorderBrush="#BDC3C7" BorderThickness="1.2" Background="White">
<DataGrid ItemsSource="{Binding DisplayResults}" AutoGenerateColumns="False" Background="White" IsReadOnly="True"
GridLinesVisibility="All" HorizontalGridLinesBrush="#ECF0F1" VerticalGridLinesBrush="#ECF0F1"
AlternatingRowBackground="#F9FBFC" RowHeight="35"
CanUserSortColumns="True" CanUserReorderColumns="False"
BorderThickness="0" SelectionMode="Extended" SelectionChanged="DataGrid_SelectionChanged">
<DataGrid.Columns>
<DataGridTextColumn Header="IC_SN" Binding="{Binding IcSn}" Width="150"/>
<DataGridTextColumn Header="PCB_Barcode" Binding="{Binding PcbBarcode}" Width="150"/>
<DataGridTextColumn Header="Maker" Binding="{Binding Maker}" Width="90"/>
<DataGridTextColumn Header="Model" Binding="{Binding Model}" Width="90"/>
<DataGridTextColumn Header="Variant_1" Binding="{Binding Variant1}" Width="90"/>
<DataGridTextColumn Header="Variant_2" Binding="{Binding Variant2}" Width="90"/>
<DataGridTextColumn Header="Operator" Binding="{Binding Operator}" Width="90"/>
<DataGridTextColumn Header="Production_Date" Binding="{Binding ProductionDate, StringFormat='yyyy-MM-dd HH:mm:ss'}" Width="150"/>
<DataGridTextColumn Header="Line" Binding="{Binding Line}" Width="80"/>
<DataGridTextColumn Header="Lot_No" Binding="{Binding LotNo}" Width="95"/>
<DataGridTextColumn Header="Jig_No" Binding="{Binding JigNo}" Width="80"/>
<DataGridTextColumn Header="Channel" Binding="{Binding Channel}" Width="80"/>
<DataGridTextColumn Header="Spec_UL" Binding="{Binding SpecUL}" Width="80"/>
<DataGridTextColumn Header="Spec_LL" Binding="{Binding SpecLL}" Width="80"/>
<DataGridTextColumn Header="Leak_Value" Binding="{Binding MeasuredValue}" Width="100">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,10,0"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Result" Binding="{Binding Judgment}" Width="80">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="ExtraBold"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Judgment}" Value="OK">
<Setter Property="Foreground" Value="#27AE60"/>
</DataTrigger>
<DataTrigger Binding="{Binding Judgment}" Value="NG">
<Setter Property="Foreground" Value="#C0392B"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Border>
<!-- Footer Area (Same style as InOutView) -->
<Border Grid.Row="3" Background="#D5DBDB" BorderBrush="#AEB6BF" BorderThickness="0,2,0,0" Margin="-12,10,-12,-12">
<Button Content="Close" Width="180" Height="50" Margin="0,15"
Background="#E5E8E8" BorderBrush="#95A5A6" BorderThickness="1.5"
FontWeight="Bold" FontSize="14" HorizontalAlignment="Center" Command="{Binding CloseCommand}"/>
</Border>
<!-- Loading Overlay -->
<Grid Grid.Row="0" Grid.RowSpan="4" Background="#AA07111C"
Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"
Panel.ZIndex="1000">
<Border Background="#17202A" CornerRadius="6" BorderBrush="#355369" BorderThickness="1.5"
Width="280" Height="140" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="Searching Logs..." Foreground="#F2F7FA" FontSize="15" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,0,0,15"/>
<ProgressBar IsIndeterminate="True" Width="200" Height="8" Foreground="#16C7E8" Background="#111C25" BorderThickness="0" Margin="0,0,0,15"/>
<Button Content="Cancel (취소)" Width="110" Height="30" Background="#E65252" Foreground="White" BorderThickness="0" FontWeight="Bold" Command="{Binding CancelCommand}" Focusable="False">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>