SSPC-Tester/Driver/PCIE8586/Pcie8586Probe/MainWindow.xaml

180 lines
10 KiB
XML

<Window x:Class="Pcie8586Probe.MainWindow"
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"
xmlns:scottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
mc:Ignorable="d"
Title="PCIe8586M &#x91C7;&#x96C6;&#x8C03;&#x8BD5;&#x7A0B;&#x5E8F;"
Height="780"
Width="1180"
MinHeight="680"
MinWidth="980"
Closing="Window_Closing">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="MinWidth" Value="72" />
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="3" />
<Setter Property="Padding" Value="10,0" />
</Style>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="4,0" />
</Style>
<Style TargetType="ComboBox">
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="3" />
<Setter Property="MinWidth" Value="86" />
</Style>
<Style TargetType="TextBox">
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</Window.Resources>
<DockPanel Background="#F6F7F9">
<Border DockPanel.Dock="Top" Background="#FFFFFF" BorderBrush="#DADDE3" BorderThickness="0,0,0,1" Padding="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<WrapPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
<TextBlock Text="&#x8BBE;&#x5907;" />
<ComboBox Width="280" ItemsSource="{Binding Devices}" SelectedItem="{Binding SelectedDevice}" />
<Button Content="&#x5237;&#x65B0;" Command="{Binding RefreshDevicesCommand}" />
<Button Content="&#x6253;&#x5F00;" Command="{Binding OpenCommand}" />
<Button Content="&#x5173;&#x95ED;" Command="{Binding CloseCommand}" />
<Button Content="&#x5F00;&#x59CB;" Command="{Binding StartCommand}" />
<Button Content="&#x505C;&#x6B62;" Command="{Binding StopCommand}" />
<Button Content="&#x91CD;&#x7F6E;" Command="{Binding ResetCommand}" />
<CheckBox Content="&#x663E;&#x793A;&#x6A21;&#x62DF;&#x8BBE;&#x5907;"
IsChecked="{Binding IncludeSimulatedDevice}"
VerticalAlignment="Center"
Margin="12,0,4,0" />
<TextBlock Text="{Binding StatusText}" FontWeight="SemiBold" Margin="14,0,0,0" />
</WrapPanel>
<TextBlock Grid.Row="0"
Grid.Column="1"
Text="V1.0.0"
Foreground="#555555"
FontWeight="SemiBold"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="16,0,0,0" />
<WrapPanel Grid.Row="1" Grid.ColumnSpan="2" Margin="0,8,0,0" VerticalAlignment="Center">
<TextBlock Text="&#x901A;&#x9053;&#x6570;" />
<ComboBox ItemsSource="{Binding ChannelOptions}" SelectedItem="{Binding SelectedChannelCount}" Width="78" />
<TextBlock Text="&#x91CF;&#x7A0B;" />
<ComboBox ItemsSource="{Binding RangeOptions}" SelectedItem="{Binding SelectedRangeOption}" Width="132" />
<TextBlock Text="&#x5206;&#x9891;&#x5668;" />
<ComboBox ItemsSource="{Binding ClockDividerOptions}" SelectedItem="{Binding SelectedClockDivider}" Width="92" />
<TextBlock Text="&#x91C7;&#x6837;&#x7387;" />
<TextBlock Text="{Binding ActualSampleRateHz, StringFormat={}{0:N0} Hz}" FontWeight="SemiBold" />
<CheckBox Content="&#x6709;&#x9650;&#x70B9;" IsChecked="{Binding UseFiniteMode}" VerticalAlignment="Center" Margin="16,0,4,0" />
<TextBlock Text="&#x6709;&#x9650;&#x70B9;/&#x901A;&#x9053;" />
<TextBox Width="110" Text="{Binding FiniteSamplesPerChannel, UpdateSourceTrigger=PropertyChanged}" />
</WrapPanel>
</Grid>
</Border>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="220" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#FFFFFF" BorderBrush="#DADDE3" BorderThickness="1">
<scottPlot:WpfPlot x:Name="WavePlot" />
</Border>
<Grid Grid.Row="1" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="#FFFFFF" BorderBrush="#DADDE3" BorderThickness="1" Padding="8" Margin="0,0,10,0">
<DataGrid x:Name="SampleTable"
ItemsSource="{Binding ChannelRows}"
AutoGenerateColumns="False"
IsReadOnly="True"
HeadersVisibility="Column"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
CanUserSortColumns="False"
RowHeight="20"
ColumnHeaderHeight="24"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTextColumn Header="&#x6837;&#x672C;" Binding="{Binding SampleIndex}" Width="*" />
<DataGridTextColumn Header="&#x901A;&#x9053;" Binding="{Binding Channel}" Width="*" />
<DataGridTextColumn Header="&#x7535;&#x538B; V" Binding="{Binding Value, StringFormat=F5}" Width="*" />
</DataGrid.Columns>
</DataGrid>
</Border>
<Border Grid.Column="1" Background="#FFFFFF" BorderBrush="#DADDE3" BorderThickness="1" Padding="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0">
<TextBlock Text="&#x5F55;&#x5236;" FontWeight="SemiBold" />
<Button Content="1 ms" Command="{Binding RecordCommand}" CommandParameter="1" />
<Button Content="5 ms" Command="{Binding RecordCommand}" CommandParameter="5" />
<Button Content="10 ms" Command="{Binding RecordCommand}" CommandParameter="10" />
<Button Content="100 ms" Command="{Binding RecordCommand}" CommandParameter="100" />
<Button Content="1 s" Command="{Binding RecordCommand}" CommandParameter="1000" />
<Button Content="10 s" Command="{Binding RecordCommand}" CommandParameter="10000" />
<ProgressBar Width="180" Height="18" Margin="12,0,0,0" Minimum="0" Maximum="1" Value="{Binding RecordingProgress}" />
</WrapPanel>
<Grid Grid.Row="1" Margin="0,12,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#x8F93;&#x51FA;&#x76EE;&#x5F55;" />
<TextBox Grid.Column="1" Text="{Binding OutputDirectory, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<WrapPanel Grid.Row="2" Margin="0,10,0,0">
<TextBlock Text="&#x526A;&#x8F91;&#x8D77;&#x70B9;" />
<TextBox Width="100" Text="{Binding ClipStartSample, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock Text="&#x526A;&#x8F91;&#x7EC8;&#x70B9;" />
<TextBox Width="100" Text="{Binding ClipEndSample, UpdateSourceTrigger=PropertyChanged}" />
<Button Content="&#x4FDD;&#x5B58;&#x526A;&#x8F91;" Command="{Binding SaveClipCommand}" />
<Button Content="&#x6253;&#x5F00;&#x6587;&#x4EF6;&#x5939;" Command="{Binding OpenLastFolderCommand}" />
</WrapPanel>
<TextBox Grid.Row="3"
Margin="0,12,0,0"
Text="{Binding LastRecordingPath}"
IsReadOnly="True"
TextWrapping="Wrap"
VerticalContentAlignment="Top" />
</Grid>
</Border>
</Grid>
</Grid>
</DockPanel>
</Window>