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.
353 lines
21 KiB
353 lines
21 KiB
<Window x:Class="marking_gui.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:marking_gui"
|
|
mc:Ignorable="d"
|
|
Title="양산형 테스트 기기 모니터링 시스템" Height="700" Width="900"
|
|
MinWidth="900" MinHeight="700" WindowState="Maximized" WindowStyle="None"
|
|
WindowStartupLocation="CenterScreen" Background="#F3F4F6"
|
|
ContentRendered="Window_ContentRendered">
|
|
<Window.Resources>
|
|
<!-- 버튼 스타일 -->
|
|
<Style x:Key="ModernButtonStyle" TargetType="Button">
|
|
<Setter Property="Background" Value="#3B82F6"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="FontSize" Value="16"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
<Setter Property="Focusable" Value="False"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Padding" Value="15,10"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Background="{TemplateBinding Background}"
|
|
CornerRadius="6"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{TemplateBinding BorderBrush}">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="#2563EB"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Background" Value="#D1D5DB"/>
|
|
<Setter Property="Foreground" Value="#9CA3AF"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<!-- 스타트 버튼 전용 스타일 (하단 영역 꽉 채우는 형태) -->
|
|
<Style x:Key="StartButtonStyle" TargetType="Button">
|
|
<Setter Property="Background" Value="#10B981"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="FontSize" Value="24"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
<Setter Property="Focusable" Value="False"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Background="{TemplateBinding Background}">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="#059669"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Background" Value="#E5E7EB"/>
|
|
<Setter Property="Foreground" Value="#9CA3AF"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<!-- 카드 보더 스타일 -->
|
|
<Style x:Key="CardBorderStyle" TargetType="Border">
|
|
<Setter Property="Background" Value="White"/>
|
|
<Setter Property="CornerRadius" Value="8"/>
|
|
<Setter Property="BorderBrush" Value="#E5E7EB"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="Padding" Value="20"/>
|
|
<Setter Property="Margin" Value="10"/>
|
|
</Style>
|
|
|
|
<!-- 로그아웃용 빨간색 버튼 스타일 -->
|
|
<Style x:Key="RedButtonStyle" TargetType="Button">
|
|
<Setter Property="Background" Value="#EF4444"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="FontSize" Value="12"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
<Setter Property="Focusable" Value="False"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Padding" Value="10,5"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Background="{TemplateBinding Background}"
|
|
CornerRadius="4"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{TemplateBinding BorderBrush}">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="#DC2626"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Background" Value="#D1D5DB"/>
|
|
<Setter Property="Foreground" Value="#9CA3AF"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Window.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<!-- 상단 헤더 -->
|
|
<RowDefinition Height="55"/>
|
|
<!-- 메인 콘텐츠 -->
|
|
<RowDefinition Height="*"/>
|
|
<!-- 하단 푸터 (스타트 버튼 배치) -->
|
|
<RowDefinition Height="120"/>
|
|
<!-- 최하단 바 (설정 버튼 배치) -->
|
|
<RowDefinition Height="50"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 1. 상단 헤더 영역 -->
|
|
<Border Grid.Row="0" Background="#111827" Padding="20,10" MouseLeftButtonDown="TopBar_MouseLeftButtonDown">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="Marking" Foreground="White" FontSize="20" FontWeight="Bold" VerticalAlignment="Center"/>
|
|
<TextBlock Text="v1.0.0 (Updated: 2026-06-05)" Foreground="#6B7280" FontSize="12" VerticalAlignment="Bottom" Margin="12,0,0,2"/>
|
|
<TextBlock x:Name="txtCurrentTime" Text="0000-00-00 00:00:00" Foreground="#E5E7EB" FontSize="15" FontWeight="Bold" VerticalAlignment="Bottom" Margin="25,0,0,2"/>
|
|
<TextBlock Text="상태: 대기 중" x:Name="txtSystemStatus" Foreground="#10B981" FontSize="15" FontWeight="Bold" VerticalAlignment="Bottom" Margin="25,0,0,2" Visibility="Collapsed"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<!-- 작업자 정보 배지 -->
|
|
<Border Background="#1F2937" CornerRadius="4" Padding="10,6" Margin="0,0,10,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="작업자" Foreground="#9CA3AF" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
|
<TextBlock x:Name="txtOperatorInfo" Text="---" Foreground="White" FontSize="13" FontWeight="Bold" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<!-- 모델 정보 배지 -->
|
|
<Border Background="#1F2937" CornerRadius="4" Padding="10,6" Margin="0,0,10,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="모델" Foreground="#9CA3AF" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
|
<TextBlock x:Name="txtModelInfo" Text="---" Foreground="White" FontSize="13" FontWeight="Bold" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<!-- 라인 정보 배지 -->
|
|
<Border Background="#1F2937" CornerRadius="4" Padding="10,6" Margin="0,0,15,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="라인" Foreground="#9CA3AF" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
|
<TextBlock x:Name="txtLineInfo" Text="---" Foreground="White" FontSize="13" FontWeight="Bold" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<Button x:Name="btnLogout" Content="로그아웃" Style="{StaticResource RedButtonStyle}" Click="btnLogout_Click" VerticalAlignment="Center" Width="70" Height="28" Margin="0,0,20,0"/>
|
|
|
|
<!-- 시스템 창 제어 버튼 -->
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<Button Width="36" Height="36" Background="Transparent" BorderThickness="0" Click="BtnMinimize_Click" ToolTip="최소화">
|
|
<TextBlock Text="0" FontFamily="Marlett" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
</Button>
|
|
<Button x:Name="btnMaximize" Width="36" Height="36" Background="Transparent" BorderThickness="0" Click="BtnMaximize_Click" ToolTip="창 모드">
|
|
<TextBlock x:Name="txtMaximizeIcon" Text="2" FontFamily="Marlett" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
</Button>
|
|
<Button Width="36" Height="36" Background="Transparent" BorderThickness="0" Click="BtnClose_Click" ToolTip="프로그램 종료">
|
|
<TextBlock Text="r" FontFamily="Marlett" FontSize="16" Foreground="#E74C3C" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
</Button>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 2. 메인 콘텐츠 영역 -->
|
|
<Grid Grid.Row="1" Margin="10">
|
|
<Grid.ColumnDefinitions>
|
|
<!-- 좌측: S/N 입력 및 이전 단계 결과 (비율 3.5:6.5) -->
|
|
<ColumnDefinition Width="3.5*"/>
|
|
<!-- 우측: 현재 측정 데이터 및 판정 -->
|
|
<ColumnDefinition Width="6.5*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 좌측 패널 (Grid로 감싸서 반응형 스케일 지원) -->
|
|
<Grid Grid.Column="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 시리얼 입력 카드 -->
|
|
<Border Grid.Row="0" Style="{StaticResource CardBorderStyle}">
|
|
<StackPanel>
|
|
<TextBlock Text="S/N 입력" FontSize="16" FontWeight="Bold" Foreground="#374151" Margin="0,0,0,10"/>
|
|
<TextBox x:Name="txtSerial" FontSize="18" Padding="8,6"
|
|
VerticalContentAlignment="Center" BorderBrush="#D1D5DB" BorderThickness="1" IsReadOnly="True"/>
|
|
<TextBlock Text="※ 테스트 S/N: PASS1234 / FAIL5678" Foreground="#9CA3AF" FontSize="11" Margin="0,8,0,0"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 이전 시험 단계 결과 카드 (최소 높이 안전장치 추가) -->
|
|
<Border Grid.Row="1" Style="{StaticResource CardBorderStyle}" MinHeight="250">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Text="이전 시험 단계 결과" FontSize="16" FontWeight="Bold" Foreground="#374151" Margin="0,0,0,10"/>
|
|
|
|
<Grid Grid.Row="1" Margin="0,5,0,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Housing 검사 -->
|
|
<Grid Grid.Row="0" VerticalAlignment="Center">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="1. Housing" FontSize="18" Foreground="#4B5563" FontWeight="SemiBold"/>
|
|
<TextBlock x:Name="txtPrevHousing" Grid.Column="1" Text="대기" FontSize="20" FontWeight="Bold" Foreground="#9CA3AF"/>
|
|
</Grid>
|
|
<Separator Grid.Row="1" Background="#F3F4F6"/>
|
|
|
|
<!-- Cal 검사 -->
|
|
<Grid Grid.Row="2" VerticalAlignment="Center">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="2. Calibration" FontSize="18" Foreground="#4B5563" FontWeight="SemiBold"/>
|
|
<TextBlock x:Name="txtPrevCal" Grid.Column="1" Text="대기" FontSize="20" FontWeight="Bold" Foreground="#9CA3AF"/>
|
|
</Grid>
|
|
<Separator Grid.Row="3" Background="#F3F4F6"/>
|
|
|
|
<!-- EOL 검사 -->
|
|
<Grid Grid.Row="4" VerticalAlignment="Center">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="3. EOL" FontSize="18" Foreground="#4B5563" FontWeight="SemiBold"/>
|
|
<TextBlock x:Name="txtPrevEol" Grid.Column="1" Text="대기" FontSize="20" FontWeight="Bold" Foreground="#9CA3AF"/>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Grid> <!-- 좌측 Grid 닫기 -->
|
|
|
|
<!-- 우측 패널 -->
|
|
<Grid Grid.Column="1">
|
|
<Grid.RowDefinitions>
|
|
<!-- 현재 전압 / 전류 측정값 (비율 1.8:3) -->
|
|
<RowDefinition Height="1.8*"/>
|
|
<!-- 최종 판정 영역 -->
|
|
<RowDefinition Height="3*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 전압/전류 측정값 표시 카드 -->
|
|
<Grid Grid.Row="0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 전압 -->
|
|
<Border Grid.Column="0" Style="{StaticResource CardBorderStyle}" MinWidth="220" MinHeight="160" Padding="20,10">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Text="측정 전압 (Voltage)" FontSize="14" Foreground="#6B7280" HorizontalAlignment="Center"/>
|
|
<Viewbox Grid.Row="1" Stretch="Uniform" Margin="0,5">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
|
<TextBlock x:Name="txtVoltage" Text="-.--" FontSize="54" FontWeight="Bold" Foreground="#1F2937"/>
|
|
<TextBlock Text=" V" FontSize="20" FontWeight="Bold" Foreground="#9CA3AF" VerticalAlignment="Bottom" Margin="5,0,0,8"/>
|
|
</StackPanel>
|
|
</Viewbox>
|
|
<TextBlock x:Name="txtVoltageRangeGuide" Grid.Row="2" Text="기준범위: 4.0V ~ 6.0V" FontSize="12" Foreground="#9CA3AF" HorizontalAlignment="Center"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 전류 -->
|
|
<Border Grid.Column="1" Style="{StaticResource CardBorderStyle}" MinWidth="220" MinHeight="160" Padding="20,10">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Text="측정 전류 (Current)" FontSize="14" Foreground="#6B7280" HorizontalAlignment="Center"/>
|
|
<Viewbox Grid.Row="1" Stretch="Uniform" Margin="0,5">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
|
<TextBlock x:Name="txtCurrent" Text="-.--" FontSize="54" FontWeight="Bold" Foreground="#1F2937"/>
|
|
<TextBlock Text=" A" FontSize="20" FontWeight="Bold" Foreground="#9CA3AF" VerticalAlignment="Bottom" Margin="5,0,0,8"/>
|
|
</StackPanel>
|
|
</Viewbox>
|
|
<TextBlock x:Name="txtCurrentRangeGuide" Grid.Row="2" Text="기준범위: 8.0A ~ 10.0A" FontSize="12" Foreground="#9CA3AF" HorizontalAlignment="Center"/>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- 최종 합/불 판정 영역 카드 -->
|
|
<Border Grid.Row="1" Style="{StaticResource CardBorderStyle}" x:Name="borderFinalResult" Background="#E5E7EB" MinHeight="200">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Text="최종 판정 결과" FontSize="16" FontWeight="SemiBold" Foreground="#4B5563" HorizontalAlignment="Center" Margin="10,15,10,5"/>
|
|
<Viewbox Grid.Row="1" Stretch="Uniform" Margin="10">
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<TextBlock x:Name="txtFinalResult" Text="대 기 중" FontSize="80" FontWeight="Black" Foreground="#9CA3AF" HorizontalAlignment="Center"/>
|
|
<TextBlock x:Name="txtFinalSerial" Text="S/N: ---" FontSize="16" FontWeight="Bold" Foreground="#6B7280" HorizontalAlignment="Center" Margin="0,10,0,0"/>
|
|
</StackPanel>
|
|
</Viewbox>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<!-- 3. 하단 푸터 (전체 영역이 스타트 버튼) -->
|
|
<Border Grid.Row="2" BorderBrush="#D1D5DB" BorderThickness="0,1,0,0">
|
|
<Button x:Name="btnStart" Content="▶ 검사 시작 (START)"
|
|
Style="{StaticResource StartButtonStyle}" IsEnabled="True" Click="btnStart_Click"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
|
|
</Border>
|
|
|
|
<!-- 4. 최하단 바 (파라미터 버튼 배치) -->
|
|
<Border Grid.Row="3" Background="#1F2937" BorderBrush="#111827" BorderThickness="0,1,0,0" Padding="20,0">
|
|
<Grid>
|
|
<!-- 파라미터 설정 버튼 (좌측 정렬) -->
|
|
<Button x:Name="btnOpenSettings" Content="⚙ 파라미터 설정" Width="140" Height="36"
|
|
Style="{StaticResource ModernButtonStyle}" Click="btnOpenSettings_Click"
|
|
HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Padding="10,0"/>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Window>
|
|
|
|
|