Files
HC_APTBS/ViewModels/Pages/DashboardPageViewModel.cs
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

31 lines
1.2 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using HC_APTBS.Services;
namespace HC_APTBS.ViewModels.Pages
{
/// <summary>
/// ViewModel for the Dashboard navigation page.
///
/// <para>Thin façade — holds a <see cref="Root"/> reference so the Dashboard XAML
/// can bind to MainViewModel-owned live readings, connection state, test summary,
/// alarms, and commands via <c>{Binding Root.X}</c>.</para>
/// </summary>
public sealed class DashboardPageViewModel : ObservableObject
{
/// <summary>Root ViewModel — owns services, live readings, and global commands.</summary>
public MainViewModel Root { get; }
/// <summary>Active alarm aggregator bound to the Dashboard alarm list.</summary>
public DashboardAlarmsViewModel Alarms => Root.DashboardAlarms;
/// <summary>Devices column ViewModel — CAN, K-Line, and Bench device tiles.</summary>
public DashboardDevicesViewModel Devices { get; }
public DashboardPageViewModel(MainViewModel root, ICanService can, IKwpService kwp)
{
Root = root;
Devices = new DashboardDevicesViewModel(root, can, kwp);
}
}
}