Files
HC_APTBS/Views/UserControls/TemperatureControlView.xaml
LucianoDev 197e9d1775 feat: redesign dashboard with Fluent KPI tiles, connection strip, and devices column
- Replace LCD-style readings with a 3×2 KPI tile grid (Fluent card surfaces, 52pt values)
- Add persistent top connection strip with horizontal chips + pump name badge
- Add elapsed test timer (DispatcherTimer, mm:ss) to Test Summary card
- Restyle Test Summary and Active Alarms with Fluent brushes/iconography
- Add Devices column (CAN / K-Line / Bench tiles) between KPI grid and test/alarms
  - Enumerates attached PCAN USB channels via PCAN_ATTACHED_CHANNELS API
  - Enumerates FTDI K-Line adapters via existing FtdiInterface helpers
  - Click to connect/disconnect; confirmation dialog when session active or test running
  - Hover tint: blue = will connect, red = will disconnect; Bench row is read-only stub
- Extend ICanService with SelectedChannel + EnumerateAttachedChannels()
- Expose IKwpService.ConnectedPort for active session device tracking
- Add DeviceRow button style with MultiDataTrigger hover colour logic
- Add 30+ new localization keys (ES + EN) for KPI labels, devices, confirmations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:25:00 +02:00

101 lines
5.6 KiB
XML

<UserControl x:Class="HC_APTBS.Views.UserControls.TemperatureControlView"
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"
mc:Ignorable="d"
d:DesignHeight="230" d:DesignWidth="190">
<!--
Temperature control panel: PID setpoint + heater / cooler relay toggles.
DataContext = TemperatureControlViewModel.
-->
<Border Background="#FAFAFA" BorderBrush="#DDD" BorderThickness="1" CornerRadius="4" Padding="8">
<StackPanel>
<TextBlock Text="{DynamicResource Bench.TempControl}"
FontSize="13" FontWeight="SemiBold" Foreground="#333"
Margin="0,0,0,6"/>
<!-- PID setpoint -->
<TextBlock Text="{DynamicResource Bench.Setpoint}" FontSize="10" Foreground="DimGray"/>
<Grid Margin="0,2,0,6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding SetpointText, UpdateSourceTrigger=PropertyChanged}"
FontSize="16" FontFamily="Consolas" Height="26"
VerticalContentAlignment="Center"/>
<TextBlock Grid.Column="1" Text="°C" VerticalAlignment="Center"
Margin="6,0,0,0" Foreground="#555"/>
</Grid>
<TextBlock Text="{DynamicResource Bench.Tolerance}" FontSize="10" Foreground="DimGray"/>
<Grid Margin="0,2,0,6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding ToleranceText, UpdateSourceTrigger=PropertyChanged}"
FontSize="13" FontFamily="Consolas" Height="22"
VerticalContentAlignment="Center"/>
<TextBlock Grid.Column="1" Text="± °C" VerticalAlignment="Center"
Margin="6,0,0,0" Foreground="#555"/>
</Grid>
<Button Content="{DynamicResource Bench.ApplySetpoint}" Height="26" FontSize="11"
FontWeight="SemiBold"
Command="{Binding ApplySetpointCommand}"/>
<!-- Heater / Cooler toggles -->
<TextBlock Text="{DynamicResource Bench.DepositHeater}" FontSize="10" Foreground="DimGray" Margin="0,10,0,2"/>
<ToggleButton IsChecked="{Binding IsHeaterOn}" Height="28" FontSize="11" FontWeight="SemiBold">
<ToggleButton.Style>
<Style TargetType="ToggleButton" BasedOn="{StaticResource FluentStateToggle}">
<Setter Property="Content" Value="{DynamicResource Bench.RelayOff}"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content" Value="{DynamicResource Bench.RelayOn}"/>
<Setter Property="Background" Value="#FFB020"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
<TextBlock Text="{DynamicResource Bench.DepositCooler}" FontSize="10" Foreground="DimGray" Margin="0,6,0,2"/>
<ToggleButton IsChecked="{Binding IsDepositCoolerOn}" Height="28" FontSize="11" FontWeight="SemiBold">
<ToggleButton.Style>
<Style TargetType="ToggleButton" BasedOn="{StaticResource FluentStateToggle}">
<Setter Property="Content" Value="{DynamicResource Bench.RelayOff}"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content" Value="{DynamicResource Bench.RelayOn}"/>
<Setter Property="Background" Value="#4080FF"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
<TextBlock Text="{DynamicResource Bench.TinCooler}" FontSize="10" Foreground="DimGray" Margin="0,6,0,2"/>
<ToggleButton IsChecked="{Binding IsTinCoolerOn}" Height="28" FontSize="11" FontWeight="SemiBold">
<ToggleButton.Style>
<Style TargetType="ToggleButton" BasedOn="{StaticResource FluentStateToggle}">
<Setter Property="Content" Value="{DynamicResource Bench.RelayOff}"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content" Value="{DynamicResource Bench.RelayOn}"/>
<Setter Property="Background" Value="#26C200"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
</StackPanel>
</Border>
</UserControl>