示波器加入源适应性界面
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
<Grid Margin="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="360" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ============ 左侧:Chroma 命令面板 ============ -->
|
||||
@@ -184,11 +185,15 @@
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="名称" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="150"
|
||||
ToolTip="保存时作为文件名(写入 D:\acp\源测试);选中已有测试项会自动填充,可改名另存"
|
||||
ToolTip="另存为对话框的默认文件名(写入 D:\acp\源测试);载入文件后自动回显当前文件名,保存不改动文件名"
|
||||
Text="{Binding PresetName, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="保存" Command="{Binding SavePresetCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="覆盖保存当前打开的测试项文件(不改变文件名);未打开文件时按“另存为”新建"
|
||||
Background="#388E3C" Foreground="White" />
|
||||
<Button Content="另存为" Command="{Binding SavePresetAsCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="弹出文件对话框选择 .json 位置另存;存入 D:\acp\源测试 才会出现在下拉列表" />
|
||||
<Button Content="删除" Command="{Binding DeletePresetCommand}"
|
||||
Style="{StaticResource WarnBtn}"
|
||||
ToolTip="删除下拉框当前选中的测试项文件(带二次确认)" />
|
||||
@@ -340,11 +345,15 @@
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="名称" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="150"
|
||||
ToolTip="保存时作为文件名(写入 D:\acp\源测试\合成波形);选中已有波形会自动填充,可改名另存"
|
||||
ToolTip="另存为对话框的默认文件名(写入 D:\acp\源测试\合成波形);载入文件后自动回显当前文件名,保存不改动文件名"
|
||||
Text="{Binding SynthPresetName, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="保存" Command="{Binding SaveSynthPresetCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="覆盖保存当前打开的波形文件(不改变文件名);未打开文件时按“另存为”新建"
|
||||
Background="#388E3C" Foreground="White" />
|
||||
<Button Content="另存为" Command="{Binding SaveSynthPresetAsCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="弹出文件对话框选择 .json 位置另存;存入 D:\acp\源测试\合成波形 才会出现在下拉列表" />
|
||||
<Button Content="删除" Command="{Binding DeleteSynthPresetCommand}"
|
||||
Style="{StaticResource WarnBtn}"
|
||||
ToolTip="删除下拉框当前选中的波形文件(带二次确认)" />
|
||||
@@ -426,6 +435,224 @@
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- ============ 右侧:示波器抓波面板 ============ -->
|
||||
<ScrollViewer Grid.Column="1"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel>
|
||||
|
||||
<GroupBox Header="示波器屏幕抓图(TektronixMSO)"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4">
|
||||
<!-- 示波器连接状态 -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0,2,0,4">
|
||||
<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 IsScopeConnected}" Value="True">
|
||||
<Setter Property="Background" Value="#4CAF50" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding ScopeName}"
|
||||
FontSize="12" Foreground="#616161"
|
||||
VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 波形图片存储位置 -->
|
||||
<TextBlock Text="波形图片存储位置"
|
||||
FontSize="11" Foreground="#616161" Margin="4,0,4,2" />
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Style="{StaticResource NumInput}" Width="Auto"
|
||||
ToolTip="抓取的屏幕图片 PNG 保存目录;也可直接在框内修改,抓图/浏览时自动记住"
|
||||
Text="{Binding ScopeImageDir, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Grid.Column="1" Content="浏览…" Command="{Binding BrowseScopeImageDirCommand}"
|
||||
Style="{StaticResource CmdBtn}" Margin="4,0,0,0"
|
||||
ToolTip="弹出文件夹选择对话框选择存储位置" />
|
||||
</Grid>
|
||||
<Button Content="抓取示波器屏幕图片" Command="{Binding CaptureScopeImageCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
Background="#388E3C" Foreground="White"
|
||||
HorizontalAlignment="Left" Margin="0,4"
|
||||
ToolTip="抓取示波器当前屏幕保存为 PNG(SAVe:IMAGe),成功后自动加载显示" />
|
||||
|
||||
<!-- 波形图片显示 -->
|
||||
<Border BorderBrush="#DDDDDD" BorderThickness="1"
|
||||
Background="#FFFFFF" CornerRadius="2" Margin="0,4,0,0">
|
||||
<Grid Height="230">
|
||||
<Image Source="{Binding ScopeImage}" Stretch="Uniform" Margin="4"
|
||||
Visibility="{Binding HasScopeImage, Converter={StaticResource BoolToVis}}" />
|
||||
<TextBlock Text="暂无波形图片
抓取成功后自动显示"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="#BDBDBD" FontSize="13" TextAlignment="Center">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding HasScopeImage}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding ScopeImageHint}"
|
||||
FontSize="11" Foreground="#757575"
|
||||
Margin="4,4,4,2" TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 采集控制:运行/停止采集,定格画面后抓图最稳定 -->
|
||||
<GroupBox Header="采集控制" Margin="0,8,0,0"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<Button Content="运行 (RUN)" Command="{Binding ScopeAcquireRunCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
Background="#388E3C" Foreground="White" />
|
||||
<Button Content="停止 (STOP)" Command="{Binding ScopeAcquireStopCommand}"
|
||||
Style="{StaticResource WarnBtn}"
|
||||
ToolTip="停止采集定格当前画面,再点「抓取示波器屏幕图片」即可截到稳定波形" />
|
||||
<Button Content="查询状态" Command="{Binding QueryAcquireStateCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="采集模式" Style="{StaticResource ParamLabel}" />
|
||||
<ComboBox Width="120" Height="32" FontSize="12" Margin="4,0"
|
||||
ToolTip="ACQuire:MODe,采样/峰值检测/高分辨率/平均/包络"
|
||||
ItemsSource="{Binding ScopeAcquireModeOptions}"
|
||||
SelectedItem="{Binding ScopeAcquireMode}" />
|
||||
<Button Content="应用" Command="{Binding ApplyAcquireModeCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 水平系统 -->
|
||||
<GroupBox Header="水平系统" Margin="0,8,0,0"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="刻度(s/Div)" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="90"
|
||||
ToolTip="HORizontal:SCAle,每格时间,单位 s,如 0.001"
|
||||
Text="{Binding ScopeTimeScale, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="设置" Command="{Binding SetScopeTimeScaleCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="记录长度" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="90"
|
||||
ToolTip="HORizontal:RECOrdlength,采样点数,如 6250000"
|
||||
Text="{Binding ScopeRecordLength, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="设置" Command="{Binding SetRecordLengthCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<Button Content="查询采样率" Command="{Binding QuerySampleRateCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
<TextBox Style="{StaticResource MeasureBox}" Width="150"
|
||||
Text="{Binding SampleRateText, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 通道设置 -->
|
||||
<GroupBox Header="通道设置" Margin="0,8,0,0"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="通道" Style="{StaticResource ParamLabel}" />
|
||||
<ComboBox Width="80" Height="32" FontSize="12" Margin="4,0"
|
||||
ItemsSource="{Binding ScopeChannelOptions}"
|
||||
SelectedIndex="{Binding SelectedScopeChannelIndex}" />
|
||||
<Button Content="显示开" Command="{Binding ChannelDisplayOnCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
<Button Content="显示关" Command="{Binding ChannelDisplayOffCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="刻度(V/Div)" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="90"
|
||||
ToolTip="CH:SCAle,每格电压,单位 V,如 100"
|
||||
Text="{Binding ChannelScale, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="设置" Command="{Binding SetChannelScaleCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="位置(Div)" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="90"
|
||||
ToolTip="CH:POSition,垂直位置偏移,单位格,如 0"
|
||||
Text="{Binding ChannelPosition, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="设置" Command="{Binding SetChannelPositionCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 自动测量 -->
|
||||
<GroupBox Header="自动测量" Margin="0,8,0,0"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="测量项" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="52"
|
||||
ToolTip="MEASUrement:MEASn 的编号 n"
|
||||
Text="{Binding MeasurementNumber, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<ComboBox Width="110" Height="32" FontSize="12" Margin="4,0"
|
||||
ToolTip="MEASUrement:TYPe,幅度/频率/平均/峰峰值/最大/最小"
|
||||
ItemsSource="{Binding ScopeMeasTypeOptions}"
|
||||
SelectedItem="{Binding MeasurementType}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="测量源" Style="{StaticResource ParamLabel}" />
|
||||
<TextBox Style="{StaticResource NumInput}" Width="90"
|
||||
ToolTip="MEASUrement:SOUrce1,如 CH1 / CH2 / MATH1"
|
||||
Text="{Binding MeasurementSource, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Content="开启测量" Command="{Binding AddMeasurementCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="ADDNew 创建测量项并设置类型与源(4/5/6 系必须先动态创建)" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<Button Content="当前值" Command="{Binding QueryMeasCurrentCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="本次采集的测量平均值" />
|
||||
<Button Content="全局均值" Command="{Binding QueryMeasMeanCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
<Button Content="全局最大" Command="{Binding QueryMeasMaxCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
</StackPanel>
|
||||
<TextBox Style="{StaticResource MeasureBox}" Width="300" HorizontalAlignment="Left"
|
||||
Margin="0,2" Text="{Binding MeasResultText, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 设备辅助 -->
|
||||
<GroupBox Header="设备辅助" Margin="0,8,0,0"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Orientation="Horizontal" Margin="4,4">
|
||||
<Button Content="查询 IDN" Command="{Binding QueryScopeIdnCommand}"
|
||||
Style="{StaticResource CmdBtn}" />
|
||||
<Button Content="清除错误" Command="{Binding ClearScopeErrorsCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="*CLS 清除所有状态寄存器与错误/事件队列" />
|
||||
<Button Content="读取错误" Command="{Binding ReadScopeErrorsCommand}"
|
||||
Style="{StaticResource CmdBtn}"
|
||||
ToolTip="ALLEv? 读取并清空示波器错误/事件队列,命令不生效时先看这里" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user