initial commit
This commit is contained in:
64
Views/Dialogs/KlineErrorsDialog.xaml
Normal file
64
Views/Dialogs/KlineErrorsDialog.xaml
Normal file
@@ -0,0 +1,64 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.KlineErrorsDialog"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
Title="K-Line Fault Codes"
|
||||
Height="400" Width="600"
|
||||
ResizeMode="CanResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header + action buttons -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fault codes:" VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold"/>
|
||||
|
||||
<Button Grid.Column="1" Content="Read" Margin="0,2,8,2"
|
||||
Width="75" Height="24"
|
||||
Command="{Binding ReadErrorsCommand}"/>
|
||||
<Button Grid.Column="2" Content="Clear" Margin="0,2,0,2"
|
||||
Width="75" Height="24"
|
||||
Command="{Binding ClearErrorsCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Fault code text -->
|
||||
<TextBox Grid.Row="1"
|
||||
Text="{Binding ErrorText, Mode=OneWay}"
|
||||
IsReadOnly="True" IsReadOnlyCaretVisible="True"
|
||||
TextWrapping="Wrap"
|
||||
FontFamily="Consolas" FontSize="12"
|
||||
VerticalScrollBarVisibility="Auto"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Footer: progress bar + close button -->
|
||||
<Grid Grid.Row="1" Margin="10,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ProgressBar Value="{Binding ProgressPercent, Mode=OneWay}"
|
||||
Minimum="0" Maximum="100"
|
||||
VerticalAlignment="Center" Margin="0,0,10,0"/>
|
||||
<Button Grid.Column="1" Content="Close" Width="80" Height="24"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
18
Views/Dialogs/KlineErrorsDialog.xaml.cs
Normal file
18
Views/Dialogs/KlineErrorsDialog.xaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Dialog for reading and clearing K-Line (KWP2000) fault codes from the pump ECU.
|
||||
/// </summary>
|
||||
public partial class KlineErrorsDialog : Window
|
||||
{
|
||||
public KlineErrorsDialog(KlineErrorsViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Views/Dialogs/ProgressDialog.xaml
Normal file
33
Views/Dialogs/ProgressDialog.xaml
Normal file
@@ -0,0 +1,33 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.ProgressDialog"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding Title}"
|
||||
Height="150" Width="450"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Topmost="True">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox Text="{Binding VerboseMessage, Mode=OneWay}"
|
||||
IsReadOnly="True"
|
||||
TextWrapping="Wrap"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
FontSize="14"
|
||||
BorderThickness="0"
|
||||
Background="White"/>
|
||||
|
||||
<ProgressBar Grid.Row="1"
|
||||
Value="{Binding ProgressPercent, Mode=OneWay}"
|
||||
Minimum="0" Maximum="100"
|
||||
Height="15" Margin="30,0" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
19
Views/Dialogs/ProgressDialog.xaml.cs
Normal file
19
Views/Dialogs/ProgressDialog.xaml.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Modal progress dialog shown during long-running K-Line operations.
|
||||
/// Close by calling <see cref="Window.Close"/> from outside (the ViewModel raises
|
||||
/// <see cref="ProgressViewModel"/> events, not this window).
|
||||
/// </summary>
|
||||
public partial class ProgressDialog : Window
|
||||
{
|
||||
public ProgressDialog(ProgressViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Views/Dialogs/ReportDialog.xaml
Normal file
123
Views/Dialogs/ReportDialog.xaml
Normal file
@@ -0,0 +1,123 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.ReportDialog"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
Title="Generate Report"
|
||||
Height="450" Width="800"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/> <!-- Section labels row -->
|
||||
<RowDefinition Height="Auto"/> <!-- Name row -->
|
||||
<RowDefinition Height="130"/> <!-- Info text -->
|
||||
<RowDefinition Height="120"/> <!-- Observations / operator -->
|
||||
<RowDefinition Height="Auto"/> <!-- Buttons -->
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180"/> <!-- Client list -->
|
||||
<ColumnDefinition Width="1*"/> <!-- Client data -->
|
||||
<ColumnDefinition Width="1*"/> <!-- Company data -->
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ── Column separators ───────────────────────────────────────────── -->
|
||||
<Border BorderBrush="DarkGray" BorderThickness="1,0,0,0"
|
||||
Grid.Column="2" Grid.RowSpan="5" Margin="-3,10,0,0"/>
|
||||
|
||||
<!-- ── Section headers ─────────────────────────────────────────────── -->
|
||||
<TextBlock Text="Client List" FontSize="14" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10"/>
|
||||
<TextBlock Grid.Column="1" Text="Client Data" FontSize="20" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10"/>
|
||||
<TextBlock Grid.Column="2" Text="Company Data" FontSize="20" FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10"/>
|
||||
|
||||
<!-- ── Client list ─────────────────────────────────────────────────── -->
|
||||
<ListBox Grid.Row="1" Grid.RowSpan="3" Margin="10,0"
|
||||
ItemsSource="{Binding ClientNames}"
|
||||
SelectedItem="{Binding SelectedClientName}"/>
|
||||
|
||||
<!-- ── Client name (editable ComboBox) ─────────────────────────────── -->
|
||||
<Grid Grid.Column="1" Grid.Row="1" Margin="8,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Name:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<ComboBox Grid.Column="1" IsEditable="True"
|
||||
ItemsSource="{Binding ClientNames}"
|
||||
Text="{Binding SelectedClientName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0"/>
|
||||
<Button Grid.Column="2" Content="Save" Width="60" Height="24"
|
||||
Command="{Binding SaveClientCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Client info text ─────────────────────────────────────────────── -->
|
||||
<GroupBox Grid.Column="1" Grid.Row="2" Header="Client information"
|
||||
Margin="8,0,8,4" FontSize="13">
|
||||
<TextBox Text="{Binding ClientInfo, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" AcceptsReturn="True"
|
||||
BorderBrush="{x:Null}" FontSize="12"/>
|
||||
</GroupBox>
|
||||
|
||||
<!-- ── Observations ─────────────────────────────────────────────────── -->
|
||||
<GroupBox Grid.Column="1" Grid.Row="3" Header="Observations"
|
||||
Margin="8,0,8,4" FontSize="13">
|
||||
<TextBox Text="{Binding Observations, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
BorderBrush="{x:Null}" FontSize="12"/>
|
||||
</GroupBox>
|
||||
|
||||
<!-- ── Operator name ────────────────────────────────────────────────── -->
|
||||
<Grid Grid.Column="2" Grid.Row="1" Margin="8,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Operator:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding OperatorName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0" Height="24"/>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Company name ─────────────────────────────────────────────────── -->
|
||||
<Grid Grid.Column="2" Grid.Row="2" Margin="8,0,8,4" VerticalAlignment="Top">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Company:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding CompanyName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0" Height="24"/>
|
||||
</Grid>
|
||||
<GroupBox Grid.Row="1" Header="Company information"
|
||||
Margin="0,4,0,0" FontSize="13">
|
||||
<TextBox Text="{Binding CompanyInfo, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" AcceptsReturn="True"
|
||||
BorderBrush="{x:Null}" FontSize="12"/>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Buttons row ──────────────────────────────────────────────────── -->
|
||||
<Button Grid.Row="4" Grid.Column="0"
|
||||
Content="Delete Client" Padding="6,2" Margin="10,8,0,8"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding DeleteClientCommand}"/>
|
||||
|
||||
<StackPanel Grid.Row="4" Grid.Column="2"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,10,8">
|
||||
<Button Content="Generate" Width="80" Height="24" Margin="0,0,8,0"
|
||||
Command="{Binding AcceptCommand}"/>
|
||||
<Button Content="Cancel" Width="80" Height="24"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
19
Views/Dialogs/ReportDialog.xaml.cs
Normal file
19
Views/Dialogs/ReportDialog.xaml.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Windows;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Dialog that collects operator, client, and company information before
|
||||
/// generating the PDF test report.
|
||||
/// </summary>
|
||||
public partial class ReportDialog : Window
|
||||
{
|
||||
public ReportDialog(ReportViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user