From ef52fd6fd07508883dce4eb002acda59f0169e59 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 23 四月 2026 10:19:33 +0800
Subject: [PATCH] 优化;

---
 Plugin.TestResult/ViewControl.xaml |  186 +++++++++++++++++++++++-----------------------
 1 files changed, 92 insertions(+), 94 deletions(-)

diff --git a/Plugin.TestResult/ViewControl.xaml b/Plugin.TestResult/ViewControl.xaml
index 1d320b9..0b2de18 100644
--- a/Plugin.TestResult/ViewControl.xaml
+++ b/Plugin.TestResult/ViewControl.xaml
@@ -1,17 +1,22 @@
-锘�<UserControl x:Class="Plugin.TestResult_WPF.ViewControl"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:Plugin.TestResult_WPF"
-             mc:Ignorable="d" 
+锘�<hb:PluginMaskControl x:Class="Plugin.TestResult_WPF.ViewControl"
+                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+                      xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+                      xmlns:std="clr-namespace:HMI.StdControl;assembly=HMI.StdControl"
+                      xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+                      xmlns:local="clr-namespace:Plugin.TestResult_WPF"
+                      xmlns:pu="https://opensource.panuon.com/wpf-ui"
+                      mc:Ignorable="d" 
+                      Style="{StaticResource pluginMaskControl}"
              Loaded="UserControl_Loaded"
              d:DesignHeight="450" d:DesignWidth="800">
     <UserControl.Resources>
         <local:FontSizeConverter x:Key="FontSizeConverter"/>
         <Style TargetType="GroupBox">
             <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl}, 
-Converter={StaticResource FontSizeConverter}, ConverterParameter='30,1920'}" />
+Converter={StaticResource FontSizeConverter}, ConverterParameter='20,1920'}" />
         </Style>
 
         <Style TargetType="Button">
@@ -27,18 +32,81 @@
         </Style>
     </UserControl.Resources>
     <Grid>
-        <Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <!--<Grid.ColumnDefinitions>
             <ColumnDefinition Width="7.5*"/>
             <ColumnDefinition Width="*"/>
-        </Grid.ColumnDefinitions>
-        <local:TestResultView x:Name="testResultView" Grid.Column="0" Loaded="testResultView_Loaded" />
-        <StackPanel Grid.Column="1" Background="#FFF">
-            <GroupBox Header="浜у搧淇℃伅">
-                <ComboBox x:Name="modelSelect" SelectionChanged="modelSelect_SelectionChanged"></ComboBox>
-            </GroupBox>
-            <GroupBox Header="鐢熶骇缁熻">
-                <StackPanel>
-                    <Label HorizontalContentAlignment="Center" HorizontalAlignment="Stretch">
+        </Grid.ColumnDefinitions>-->
+        <local:TestResultView x:Name="testResultView" Grid.Row="1" Grid.Column="0" Loaded="testResultView_Loaded" />
+        <DockPanel Margin="10,0" Grid.Row="0" Grid.Column="1" LastChildFill="False" Background="#FFF" VerticalAlignment="Center">
+            <pu:FormGroup DockPanel.Dock="Right">
+                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="20">
+                    <Button x:Name="btnStart" Click="Start_Click"
+                       Width="100" FontSize="14" Padding="0" Height="30" Content="{DynamicResource App.Start}">
+                        <Button.Style>
+                            <Style TargetType="Button" BasedOn="{StaticResource SuccessButton}">
+                                <Style.Triggers>
+                                    <DataTrigger Binding="{Binding EnableManualDebug}" Value="True">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                    </DataTrigger>
+                                    <DataTrigger Binding="{Binding IsRunning}" Value="True">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                    </DataTrigger>
+                                </Style.Triggers>
+                            </Style>
+                        </Button.Style>
+                    </Button>
+
+                    <Button x:Name="btnStop" Click="Stop_Click" Style="{StaticResource DangerButton}"
+                            Width="100" FontSize="14" Padding="0" Height="30"
+                    Content="{DynamicResource App.Stop}"/>
+
+                    <Button x:Name="btnClear" Click="BtnClear_Click" Style="{StaticResource PrimaryButton}"
+                            Width="100" FontSize="14" Padding="0" Height="30"
+                    Content="{DynamicResource Ts.BtnClearNum}"/>
+
+                    <Button x:Name="scannerSetting" Click="ScannerSetting_Click" Style="{StaticResource PrimaryButton}"
+                            Width="100" FontSize="14" Padding="0" Height="30" Content="{DynamicResource App.ScannerSetting}" Cursor="Hand"/>
+
+                    <!--<Button x:Name="btnScan1" Click="Scan_Click_1" Style="{StaticResource PrimaryButton}"
+                    Content="{DynamicResource Tr.Zone1Scan}"/>
+
+            <Button x:Name="btnScan2" Click="Scan_Click_2" Style="{StaticResource PrimaryButton}"
+                    Content="{DynamicResource Tr.Zone2Scan}"/>-->
+                </StackPanel>
+            </pu:FormGroup>
+            <pu:FormGroup Header="{DynamicResource Tr.ProductInfo}" FontSize="16" Visibility="Collapsed">
+                <ComboBox x:Name="modelSelect" Style="{StaticResource FormComboxStyle}" Width="200"
+                          Height="28"
+                          pu:ComboBoxHelper.ClearButtonVisibility="Collapsed"
+                          SelectionChanged="modelSelect_SelectionChanged"/>
+            </pu:FormGroup>
+
+            <pu:FormGroup Header="{DynamicResource Tr.TestProgram}" FontSize="16">
+                <TextBox IsReadOnly="True" x:Name="tbFileName" Style="{StaticResource EditorTextBoxStyle}" Width="200"
+Height="28" Text="{Binding FileName}"/>
+            </pu:FormGroup>
+
+            <pu:FormGroup>
+                <std:StdEnableMes DockPanel.Dock="Left" FontSize="20" 
+                                  x:Name="stdEnableMes"
+                                  ValueChanged="StdEnableMes_ValueChanged"/>
+            </pu:FormGroup>
+
+            <pu:FormGroup x:Name="FgEnableManualDebug" Visibility="Collapsed">
+                <CheckBox FontSize="20"
+                          IsChecked="{Binding EnableManualDebug,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" 
+          VerticalContentAlignment="Center"
+          Content="鎵嬪姩璋冭瘯" />
+            </pu:FormGroup>
+
+
+            <!--<pu:FormGroup Header="{DynamicResource Tr.Status}" FontSize="16">
+                <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10">
+                    <Label HorizontalContentAlignment="Center" VerticalAlignment="Center">
                         <Label.Style>
                             <Style TargetType="Label">
                                 <Setter Property="HorizontalContentAlignment"  Value="Center"/>
@@ -47,12 +115,12 @@
                                 <Style.Triggers>
                                     <DataTrigger Binding="{Binding mesStatus}" Value="true">
                                         <Setter Property="Background" Value="Green"/>
-                                        <Setter Property="Content" Value="MES寮�"/>
+                                        <Setter Property="Content" Value="{DynamicResource Tr.MES_OPEN}"/>
                                         <Setter Property="Foreground" Value="White"/>
                                     </DataTrigger>
                                     <DataTrigger Binding="{Binding mesStatus}" Value="false">
                                         <Setter Property="Background" Value="Red"/>
-                                        <Setter Property="Content" Value="MES鍏�"/>
+                                        <Setter Property="Content" Value="{DynamicResource Tr.MES_CLOSE}"/>
                                         <Setter Property="Foreground" Value="White"/>
                                     </DataTrigger>
                                 </Style.Triggers>
@@ -64,6 +132,7 @@
                             <Style TargetType="Label">
                                 <Setter Property="HorizontalContentAlignment"  Value="Center"/>
                                 <Setter Property="HorizontalAlignment"  Value="Stretch"/>
+                                <Setter Property="VerticalAlignment"  Value="Center"/>
                                 <Setter Property="Content" Value="{Binding produceStatus}"/>
                                 <Setter Property="Margin" Value="0,10"/>
                                 <Style.Triggers>
@@ -84,78 +153,7 @@
                         </Label.Style>
                     </Label>
                 </StackPanel>
-            </GroupBox>
-            <GroupBox Header="鎿嶄綔">
-                <StackPanel>
-                    <Button x:Name="btnStart" Click="Start_Click">
-                        <Button.Content>鍚姩</Button.Content>
-                        <Button.Style>
-                            <Style TargetType="Button">
-                                <Setter Property="Background" Value="Green"/>
-                                <Setter Property="Foreground" Value="White"/>
-                                <Setter Property="Margin" Value="0,10"/>
-                                <Setter Property="Padding" Value="5"/>
-                                <Style.Triggers>
-                                    <Trigger Property="IsEnabled" Value="False">
-                                        <Setter Property="Foreground" Value="Gray"/>
-                                    </Trigger>
-                                </Style.Triggers>
-                            </Style>
-                        </Button.Style>
-                    </Button>
-
-                    <Button x:Name="btnStop" Click="Stop_Click">
-                        <Button.Content>鍋滄</Button.Content>
-                        <Button.Style>
-                            <Style TargetType="Button">
-                                <Setter Property="Background" Value="Red"/>
-                                <Setter Property="Foreground" Value="White"/>
-                                <Setter Property="Margin" Value="0,10"/>
-                                <Setter Property="Padding" Value="5"/>
-                                <Style.Triggers>
-                                    <Trigger Property="IsEnabled" Value="False">
-                                        <Setter Property="Foreground" Value="Gray"/>
-                                    </Trigger>
-                                </Style.Triggers>
-                            </Style>
-                        </Button.Style>
-                    </Button>
-
-                    <Button x:Name="btnScan1" Click="Scan_Click_1">
-                        <Button.Content>涓�鍖烘壂鐮�</Button.Content>
-                        <Button.Style>
-                            <Style TargetType="Button">
-                                <Setter Property="Margin" Value="0,10"/>
-                                <Setter Property="Padding" Value="5"/>
-                                <Style.Triggers>
-                                    <Trigger Property="IsEnabled" Value="False">
-                                        <Setter Property="Foreground" Value="Gray"/>
-                                    </Trigger>
-                                </Style.Triggers>
-                            </Style>
-                        </Button.Style>
-                    </Button>
-
-                    <Button x:Name="btnScan2" Click="Scan_Click_2">
-                        <Button.Content>浜屽尯鎵爜</Button.Content>
-                        <Button.Style>
-                            <Style TargetType="Button">
-                                <Setter Property="Margin" Value="0,10"/>
-                                <Setter Property="Padding" Value="5"/>
-                                <Style.Triggers>
-                                    <Trigger Property="IsEnabled" Value="False">
-                                        <Setter Property="Foreground" Value="Gray"/>
-                                    </Trigger>
-                                </Style.Triggers>
-                            </Style>
-                        </Button.Style>
-                    </Button>
-                    <!-- <Button Content="璁℃暟娓呴浂"/>
-                    <Button Content="鎵爜"/>
-                    <Button Content="涓�鍖烘墜鍔�"/>
-                    <Button Content="浜屽尯鎵嬪姩"/>-->
-                </StackPanel>
-            </GroupBox>
-        </StackPanel>
+            </pu:FormGroup>-->
+        </DockPanel>
     </Grid>
-</UserControl>
+</hb:PluginMaskControl>

--
Gitblit v1.9.1