328 lines
21 KiB
XML
328 lines
21 KiB
XML
<UserControl x:Class="DeviceEditModule.Views.SDS2000X_HDView"
|
|
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"
|
|
xmlns:prism="http://prismlibrary.com/"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:converters="clr-namespace:UIShare.Converters;assembly=UIShare"
|
|
mc:Ignorable="d"
|
|
prism:ViewModelLocator.AutoWireViewModel="False"
|
|
d:DesignHeight="760" d:DesignWidth="860">
|
|
|
|
<UserControl.Resources>
|
|
<converters:BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
|
</UserControl.Resources>
|
|
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
|
<StackPanel Margin="12">
|
|
|
|
<!-- ═══ 设备信息头 ═══ -->
|
|
<materialDesign:Card Margin="0,0,0,8" Padding="12,8">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<materialDesign:PackIcon Kind="Waveform" Width="22" Height="22"
|
|
Foreground="#1565C0" Margin="0,0,8,0"
|
|
VerticalAlignment="Center"/>
|
|
<TextBlock Text="SDS2000X_HD 数字存储示波器"
|
|
FontSize="15" FontWeight="Bold"
|
|
VerticalAlignment="Center"/>
|
|
<TextBlock Text="{Binding DeviceName, StringFormat=' [{0}]'}"
|
|
FontSize="13" Foreground="#757575"
|
|
VerticalAlignment="Center" Margin="4,0,0,0"/>
|
|
</StackPanel>
|
|
|
|
<!-- 连接状态指示 -->
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<Border Width="10" Height="10" CornerRadius="5" Margin="0,0,6,0">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Setter Property="Background" Value="#F44336"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
|
<Setter Property="Background" Value="#4CAF50"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
</Border>
|
|
<TextBlock VerticalAlignment="Center" FontSize="12">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Text" Value="未连接"/>
|
|
<Setter Property="Foreground" Value="#F44336"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
|
<Setter Property="Text" Value="已连接"/>
|
|
<Setter Property="Foreground" Value="#4CAF50"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
<ProgressBar IsIndeterminate="True" Width="80" Height="4"
|
|
Margin="12,0,0,0"
|
|
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVis}}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</materialDesign:Card>
|
|
|
|
<!-- ═══ 主体 2 列 ═══ -->
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- ─── 左列 ─── -->
|
|
<StackPanel Grid.Column="0" Margin="0,0,4,0">
|
|
|
|
<!-- 通道与垂直设置 -->
|
|
<GroupBox Header="通道与垂直设置" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="通道号" Style="{StaticResource ParamLabel}"/>
|
|
<ComboBox Width="80" Height="32" Margin="4,0"
|
|
SelectedItem="{Binding Channel}"
|
|
VerticalContentAlignment="Center" FontSize="12">
|
|
<sys:Int32>1</sys:Int32>
|
|
<sys:Int32>2</sys:Int32>
|
|
<sys:Int32>3</sys:Int32>
|
|
<sys:Int32>4</sys:Int32>
|
|
</ComboBox>
|
|
<Button Content="开启" Command="{Binding SetChannelOnCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
<Button Content="关闭" Command="{Binding SetChannelOffCommand}"
|
|
Style="{StaticResource WarnBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="单位" Style="{StaticResource ParamLabel}"/>
|
|
<ComboBox Width="70" Height="32" Margin="4,0"
|
|
ItemsSource="{Binding ChannelUnitOptions}"
|
|
SelectedItem="{Binding ChannelUnit}"
|
|
VerticalContentAlignment="Center" FontSize="12"/>
|
|
<Button Content="设置" Command="{Binding SetChannelUnitCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="档位 (/div)" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}"
|
|
Text="{Binding VoltsPerDiv}"/>
|
|
<Button Content="设置" Command="{Binding SetVoltsDivCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="耦合方式" Style="{StaticResource ParamLabel}"/>
|
|
<ComboBox Width="80" Height="32" Margin="4,0"
|
|
ItemsSource="{Binding CouplingOptions}"
|
|
SelectedItem="{Binding SelectedCoupling}"
|
|
VerticalContentAlignment="Center" FontSize="12"/>
|
|
<Button Content="设置" Command="{Binding SetChannelCouplingCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="带宽限制" Style="{StaticResource ParamLabel}"/>
|
|
<ComboBox Width="90" Height="32" Margin="4,0"
|
|
ItemsSource="{Binding BandwidthLimitOptions}"
|
|
SelectedItem="{Binding BandwidthLimit}"
|
|
VerticalContentAlignment="Center" FontSize="12"/>
|
|
<Button Content="设置" Command="{Binding SetBandwidthLimitCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- 运行与捕获 -->
|
|
<GroupBox Header="运行与捕获" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<Button Content="Run" Command="{Binding RunCommand}"
|
|
Style="{StaticResource MaterialDesignRaisedButton}"
|
|
Background="#388E3C" Foreground="White"
|
|
Height="32" Padding="16,0" FontSize="12" Margin="4,0"/>
|
|
<Button Content="Stop" Command="{Binding StopCommand}"
|
|
Style="{StaticResource WarnBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="触发模式" Style="{StaticResource ParamLabel}"/>
|
|
<ComboBox Width="90" Height="32" Margin="4,0"
|
|
ItemsSource="{Binding TriggerModeOptions}"
|
|
SelectedItem="{Binding SelectedTriggerMode}"
|
|
VerticalContentAlignment="Center" FontSize="12"/>
|
|
<Button Content="设置" Command="{Binding SetTriggerModeCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- 水平与触发 -->
|
|
<GroupBox Header="水平与触发" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="时基 (s/div)" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}"
|
|
Text="{Binding TimeBase}"/>
|
|
<Button Content="设置" Command="{Binding SetTimeBaseCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="触发源" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}" Width="80"
|
|
Text="{Binding TriggerSource, UpdateSourceTrigger=PropertyChanged}"/>
|
|
<Button Content="设置" Command="{Binding SetTriggerSourceCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="触发电平 (V)" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}"
|
|
Text="{Binding TriggerLevel, UpdateSourceTrigger=PropertyChanged}"/>
|
|
<Button Content="设置" Command="{Binding SetTriggerLevelCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="触发斜率" Style="{StaticResource ParamLabel}"/>
|
|
<ComboBox Width="100" Height="32" Margin="4,0"
|
|
ItemsSource="{Binding TriggerSlopeOptions}"
|
|
SelectedItem="{Binding SelectedTriggerSlope}"
|
|
VerticalContentAlignment="Center" FontSize="12"/>
|
|
<Button Content="设置" Command="{Binding SetTriggerSlopeCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- 系统命令 -->
|
|
<GroupBox Header="系统命令" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<Button Content="查询 IDN" Command="{Binding QueryIdentityCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
<Button Content="重置设备" Command="{Binding ResetDeviceCommand}"
|
|
Style="{StaticResource WarnBtn}"/>
|
|
<Button Content="清除状态" Command="{Binding ClearStatusCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<Button Content="查询错误" Command="{Binding QueryErrorCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
<Button Content="*OPC?" Command="{Binding QueryOpcCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
|
|
<!-- ─── 右列 ─── -->
|
|
<StackPanel Grid.Column="1" Margin="4,0,0,0">
|
|
|
|
<!-- 光标测量 -->
|
|
<GroupBox Header="光标测量 (ΔT)" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<Button Content="开启手动 X 光标" Command="{Binding EnableManualXCursorCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="X1 位置 (s)" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}"
|
|
Text="{Binding CursorX1, UpdateSourceTrigger=PropertyChanged}"/>
|
|
<Button Content="设置" Command="{Binding SetCursorX1Command}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="X2 位置 (s)" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}"
|
|
Text="{Binding CursorX2, UpdateSourceTrigger=PropertyChanged}"/>
|
|
<Button Content="设置" Command="{Binding SetCursorX2Command}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="ΔT (s)" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource MeasureBox}"
|
|
Text="{Binding CursorDeltaT, Mode=OneWay}"/>
|
|
<Button Content="查询" Command="{Binding QueryCursorDeltaTCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- 自动测量 -->
|
|
<GroupBox Header="自动测量" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="Vpp" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource MeasureBox}"
|
|
Text="{Binding MeasuredVpp, Mode=OneWay}"/>
|
|
<Button Content="刷新" Command="{Binding QueryVppCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="频率" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource MeasureBox}"
|
|
Text="{Binding MeasuredFrequency, Mode=OneWay}"/>
|
|
<Button Content="刷新" Command="{Binding QueryFrequencyCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="RMS" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource MeasureBox}"
|
|
Text="{Binding MeasuredRms, Mode=OneWay}"/>
|
|
<Button Content="刷新" Command="{Binding QueryRmsCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
<Button Content="刷新全部测量" Command="{Binding QueryMeasurementsCommand}"
|
|
Style="{StaticResource CmdBtn}"
|
|
HorizontalAlignment="Left" Margin="0,4,0,0"/>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- 屏幕截图 -->
|
|
<GroupBox Header="屏幕截图" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<StackPanel Margin="4,4,4,4">
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<TextBlock Text="保存路径" Style="{StaticResource ParamLabel}"/>
|
|
<TextBox Style="{StaticResource NumInput}" Width="300"
|
|
Text="{Binding SaveFilePath, UpdateSourceTrigger=PropertyChanged}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,4">
|
|
<Button Content="保存截图 (自动追加时间戳)" Command="{Binding SaveScreenshotCommand}"
|
|
Style="{StaticResource CmdBtn}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- 响应日志 -->
|
|
<GroupBox Header="响应日志" Margin="0,0,0,8"
|
|
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
|
<ScrollViewer Height="240" VerticalScrollBarVisibility="Auto">
|
|
<TextBox Text="{Binding ResponseLog, Mode=OneWay}"
|
|
materialDesign:HintAssist.Hint=""
|
|
IsReadOnly="True"
|
|
TextWrapping="Wrap"
|
|
FontSize="11"
|
|
FontFamily="Consolas"
|
|
Background="#FAFAFA"
|
|
BorderThickness="0"
|
|
VerticalAlignment="Top"/>
|
|
</ScrollViewer>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
</Grid>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl>
|