180 lines
10 KiB
XML
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 采集调试程序"
|
|
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="设备" />
|
|
<ComboBox Width="280" ItemsSource="{Binding Devices}" SelectedItem="{Binding SelectedDevice}" />
|
|
<Button Content="刷新" Command="{Binding RefreshDevicesCommand}" />
|
|
<Button Content="打开" Command="{Binding OpenCommand}" />
|
|
<Button Content="关闭" Command="{Binding CloseCommand}" />
|
|
<Button Content="开始" Command="{Binding StartCommand}" />
|
|
<Button Content="停止" Command="{Binding StopCommand}" />
|
|
<Button Content="重置" Command="{Binding ResetCommand}" />
|
|
<CheckBox Content="显示模拟设备"
|
|
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="通道数" />
|
|
<ComboBox ItemsSource="{Binding ChannelOptions}" SelectedItem="{Binding SelectedChannelCount}" Width="78" />
|
|
<TextBlock Text="量程" />
|
|
<ComboBox ItemsSource="{Binding RangeOptions}" SelectedItem="{Binding SelectedRangeOption}" Width="132" />
|
|
<TextBlock Text="分频器" />
|
|
<ComboBox ItemsSource="{Binding ClockDividerOptions}" SelectedItem="{Binding SelectedClockDivider}" Width="92" />
|
|
<TextBlock Text="采样率" />
|
|
<TextBlock Text="{Binding ActualSampleRateHz, StringFormat={}{0:N0} Hz}" FontWeight="SemiBold" />
|
|
<CheckBox Content="有限点" IsChecked="{Binding UseFiniteMode}" VerticalAlignment="Center" Margin="16,0,4,0" />
|
|
<TextBlock Text="有限点/通道" />
|
|
<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="样本" Binding="{Binding SampleIndex}" Width="*" />
|
|
<DataGridTextColumn Header="通道" Binding="{Binding Channel}" Width="*" />
|
|
<DataGridTextColumn Header="电压 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="录制" 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="输出目录" />
|
|
<TextBox Grid.Column="1" Text="{Binding OutputDirectory, UpdateSourceTrigger=PropertyChanged}" />
|
|
</Grid>
|
|
|
|
<WrapPanel Grid.Row="2" Margin="0,10,0,0">
|
|
<TextBlock Text="剪辑起点" />
|
|
<TextBox Width="100" Text="{Binding ClipStartSample, UpdateSourceTrigger=PropertyChanged}" />
|
|
<TextBlock Text="剪辑终点" />
|
|
<TextBox Width="100" Text="{Binding ClipEndSample, UpdateSourceTrigger=PropertyChanged}" />
|
|
<Button Content="保存剪辑" Command="{Binding SaveClipCommand}" />
|
|
<Button Content="打开文件夹" 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>
|