| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <UserControl x:Class="TeamAAS.Views.HomeView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:log="clr-namespace:TeamAAS.Logging.Controls;assembly=TeamAAS.Global"
- xmlns:loc="clr-namespace:TeamAAS.Localization">
- <Grid Margin="16,12">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="65*"/>
- <ColumnDefinition Width="420"/>
- </Grid.ColumnDefinitions>
- <!-- Left: Camera Display + Product Selection -->
- <Grid Grid.Column="0" Margin="0,0,8,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <!-- Product Selection Bar -->
- <Border Grid.Row="0" Background="{DynamicResource SecondaryRegionBrush}"
- CornerRadius="8" Padding="12,8" Margin="0,0,0,8">
- <DockPanel VerticalAlignment="Center">
- <!-- 左侧:产品选择 -->
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
- <TextBlock Text="{loc:Translate '产品选择:'}" VerticalAlignment="Center"
- Foreground="{DynamicResource SecondaryTextBrush}" Margin="0,0,8,0"/>
- <ComboBox Width="180" ItemsSource="{Binding Products}" SelectedItem="{Binding SelectedProduct}"
- hc:InfoElement.Placeholder="{loc:Translate '选择产品'}"/>
- <Button Content="{loc:Translate '加载'}" Command="{Binding LoadProductCommand}"
- Style="{StaticResource ButtonPrimary}" Margin="8,0,0,0" Padding="16,4"/>
- <Button Content="{loc:Translate '▶ 运行'}" Command="{Binding RunCommand}" IsEnabled="{Binding CanRun}"
- Margin="12,0,0,0" Padding="16,4" Cursor="Hand"
- Background="#4CAF50" BorderThickness="0" Foreground="White"
- ToolTip="{loc:Translate '循环运行当前产品的所有流程'}"/>
- <Button Content="{loc:Translate '■ 停止'}" Command="{Binding StopCommand}" IsEnabled="{Binding CanStop}"
- Margin="8,0,0,0" Padding="16,4" Cursor="Hand"
- Background="#F44336" BorderThickness="0" Foreground="White"
- ToolTip="{loc:Translate '停止当前产品的所有流程'}"/>
- <TextBlock VerticalAlignment="Center" Margin="16,0,0,0"
- Foreground="{DynamicResource SecondaryTextBrush}">
- <Run Text="{loc:Translate '当前运行产品: '}"/><Run Text="{Binding RunProductName, Mode=OneWay}" FontWeight="Bold"/>
- </TextBlock>
- </StackPanel>
- </DockPanel>
- </Border>
- <!-- 视觉画面区:当前引擎的多画面视图(画面框数量/布局在设置里配置,双击框放大) -->
- <Border Grid.Row="1" Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="8">
- <Grid>
- <TextBlock Text="{loc:Translate '相机画面显示区'}" HorizontalAlignment="Center" VerticalAlignment="Center"
- FontSize="24" Foreground="{DynamicResource SecondaryTextBrush}">
- <TextBlock.Style>
- <Style TargetType="TextBlock">
- <Setter Property="Visibility" Value="Collapsed"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding EngineMainView}" Value="{x:Null}">
- <Setter Property="Visibility" Value="Visible"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
- </TextBlock>
- <ContentControl Content="{Binding EngineMainView}" Focusable="False"/>
- </Grid>
- </Border>
- </Grid>
- <!-- Right: Stats + Logs -->
- <Grid Grid.Column="1" Margin="8,0,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <!-- Production Stats -->
- <Border Grid.Row="0" Background="{DynamicResource RegionBrush}" CornerRadius="8"
- Padding="16,12" Margin="0,0,0,8">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0" HorizontalAlignment="Center">
- <TextBlock Text="{loc:Translate '累计运行'}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12"/>
- <TextBlock Text="{Binding Stats.TotalCount}" FontSize="28" FontWeight="Bold" Foreground="{DynamicResource PrimaryTextBrush}"/>
- </StackPanel>
- <StackPanel Grid.Column="1" HorizontalAlignment="Center">
- <TextBlock Text="{loc:Translate '成功次数'}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12"/>
- <TextBlock Text="{Binding Stats.OkCount}" FontSize="28" FontWeight="Bold" Foreground="{DynamicResource PrimaryBrush}"/>
- </StackPanel>
- </Grid>
- <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,8,0,0">
- <TextBlock Text="UPH: " Foreground="{DynamicResource SecondaryTextBrush}" FontSize="13"/>
- <TextBlock Text="{Binding Stats.UphText}" FontSize="13" FontWeight="Bold" Foreground="{DynamicResource PrimaryTextBrush}"/>
- <TextBlock Text=" | CT: " Foreground="{DynamicResource SecondaryTextBrush}" FontSize="13"/>
- <TextBlock Text="{Binding Stats.CtText}" FontSize="13" FontWeight="Bold" Foreground="{DynamicResource PrimaryTextBrush}"/>
- </StackPanel>
- <Button Grid.Row="2" Content="{loc:Translate '清零'}" HorizontalAlignment="Center" Margin="0,8,0,0"
- Padding="20,4" FontSize="12" Command="{Binding ResetStatisticsCommand}"/>
- </Grid>
- </Border>
- <!-- Running Logs -->
- <Border Grid.Row="1" Background="{DynamicResource RegionBrush}" CornerRadius="8" Padding="12">
- <log:LogView MaxEntries="500"/>
- </Border>
- </Grid>
- </Grid>
- </UserControl>
|