Three-column layout replacing the old HMI grid: - BenchRpmCommandCard: inline numeric input, 2×4 preset grid, Start/Stop - BenchActuatorsCard: direction toggle, oil pump, temperature PID, misc relays with FluentStateToggle showing checked state via AccentFillColor - BenchLiveDataCard: 2×5 KPI tiles (RPM, P1, P2, Q-Delivery, Q-Over, temps) - BenchChartsCard: 2×2 compact chart grid (Delivery, Over, P1, P2) - AdvanceMonitorCard: RadialAngleGauge custom FrameworkElement + PSG/INJ readouts, Δ° lock offset input, Zero PSG / Zero INJ buttons Supporting changes: - AngleDisplayViewModel: promote _currentManualDegrees, _isLockSet to [ObservableProperty]; add PsgRelativeDegrees, InjEncoderDegreesValue, TargetLockAngle, IsRunningMode (29/31 hysteresis); computed PrimaryGaugeAngle, TargetAngleForGauge, SecondaryGaugeAngle - BenchControlViewModel: add IsDirectionLeft computed property, SetDirectionRightCommand, SetDirectionLeftCommand, ApplyRpmCommand - FlowmeterChartView: add IsCompact DP (false default) for 90px compact height - Styles.xaml: add IsChecked trigger to FluentStateToggle (accent fill + white text) - Strings.en/es.xaml: add all new card and actuator string keys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
1.6 KiB
C#
43 lines
1.6 KiB
C#
using System.Windows;
|
||
using System.Windows.Controls;
|
||
|
||
namespace HC_APTBS.Views.UserControls
|
||
{
|
||
/// <summary>
|
||
/// UserControl hosting a single real-time flowmeter chart.
|
||
/// DataContext is expected to be a <see cref="HC_APTBS.ViewModels.SingleFlowChartViewModel"/>.
|
||
/// Set <see cref="IsCompact"/> to <c>true</c> to reduce chart height to 90 px
|
||
/// (used in the 2×2 bench chart grid).
|
||
/// </summary>
|
||
public partial class FlowmeterChartView : UserControl
|
||
{
|
||
/// <summary>When true the chart height shrinks from 120 to 90 px.</summary>
|
||
public static readonly DependencyProperty IsCompactProperty =
|
||
DependencyProperty.Register(nameof(IsCompact), typeof(bool), typeof(FlowmeterChartView),
|
||
new FrameworkPropertyMetadata(false,
|
||
(d, e) => ((FlowmeterChartView)d).ChartHeight = (bool)e.NewValue ? 90.0 : 120.0));
|
||
|
||
public bool IsCompact
|
||
{
|
||
get => (bool)GetValue(IsCompactProperty);
|
||
set => SetValue(IsCompactProperty, value);
|
||
}
|
||
|
||
/// <summary>Derived chart height (120 or 90); bound in XAML.</summary>
|
||
public static readonly DependencyProperty ChartHeightProperty =
|
||
DependencyProperty.Register(nameof(ChartHeight), typeof(double), typeof(FlowmeterChartView),
|
||
new FrameworkPropertyMetadata(120.0));
|
||
|
||
public double ChartHeight
|
||
{
|
||
get => (double)GetValue(ChartHeightProperty);
|
||
set => SetValue(ChartHeightProperty, value);
|
||
}
|
||
|
||
public FlowmeterChartView()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
}
|
||
}
|