示波器修改
This commit is contained in:
@@ -2,7 +2,7 @@ using DeviceCommand.Devices;
|
||||
using Prism.Commands;
|
||||
using Prism.Ioc;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
@@ -60,30 +60,45 @@ namespace DeviceEditModule.ViewModels
|
||||
set => SetProperty(ref _channel, value);
|
||||
}
|
||||
|
||||
private string _channelUnit = "V";
|
||||
/// <summary>通道物理单位(V 电压 / A 电流)。</summary>
|
||||
public string ChannelUnit
|
||||
{
|
||||
get => _channelUnit;
|
||||
set => SetProperty(ref _channelUnit, value);
|
||||
}
|
||||
|
||||
public string[] ChannelUnitOptions { get; } = { "V", "A" };
|
||||
|
||||
private double _voltsPerDiv = 1.0;
|
||||
/// <summary>垂直电压档位(V/div)。</summary>
|
||||
/// <summary>垂直档位(V/div 或 A/div)。</summary>
|
||||
public double VoltsPerDiv
|
||||
{
|
||||
get => _voltsPerDiv;
|
||||
set => SetProperty(ref _voltsPerDiv, value);
|
||||
}
|
||||
|
||||
private double _offset = 0.0;
|
||||
/// <summary>垂直偏移(V)。</summary>
|
||||
public double Offset
|
||||
private ChannelCoupling _selectedCoupling = ChannelCoupling.DC;
|
||||
/// <summary>通道耦合方式(DC/AC/GND,测纹波需 AC)。</summary>
|
||||
public ChannelCoupling SelectedCoupling
|
||||
{
|
||||
get => _offset;
|
||||
set => SetProperty(ref _offset, value);
|
||||
get => _selectedCoupling;
|
||||
set => SetProperty(ref _selectedCoupling, value);
|
||||
}
|
||||
|
||||
private bool _is50Ohm;
|
||||
/// <summary>是否使用 50Ω 输入阻抗,false 为 1MΩ。</summary>
|
||||
public bool Is50Ohm
|
||||
public ChannelCoupling[] CouplingOptions { get; } =
|
||||
(ChannelCoupling[])Enum.GetValues(typeof(ChannelCoupling));
|
||||
|
||||
private string _bandwidthLimit = "20M";
|
||||
/// <summary>通道带宽限制(20M/200M/FULL,测纹波常用 20M)。</summary>
|
||||
public string BandwidthLimit
|
||||
{
|
||||
get => _is50Ohm;
|
||||
set => SetProperty(ref _is50Ohm, value);
|
||||
get => _bandwidthLimit;
|
||||
set => SetProperty(ref _bandwidthLimit, value);
|
||||
}
|
||||
|
||||
public string[] BandwidthLimitOptions { get; } = { "20M", "200M", "FULL" };
|
||||
|
||||
private double _timeBase = 0.001;
|
||||
/// <summary>水平时基档位(s/div)。</summary>
|
||||
public double TimeBase
|
||||
@@ -92,20 +107,66 @@ namespace DeviceEditModule.ViewModels
|
||||
set => SetProperty(ref _timeBase, value);
|
||||
}
|
||||
|
||||
private TriggerMode _selectedTriggerMode = TriggerMode.AUTO;
|
||||
/// <summary>触发模式(AUTO/NORMal/SINGle)。</summary>
|
||||
public TriggerMode SelectedTriggerMode
|
||||
{
|
||||
get => _selectedTriggerMode;
|
||||
set => SetProperty(ref _selectedTriggerMode, value);
|
||||
}
|
||||
|
||||
public TriggerMode[] TriggerModeOptions { get; } =
|
||||
(TriggerMode[])Enum.GetValues(typeof(TriggerMode));
|
||||
|
||||
private string _triggerSource = "C1";
|
||||
/// <summary>边沿触发源(C1~C4/EX/LINE)。</summary>
|
||||
public string TriggerSource
|
||||
{
|
||||
get => _triggerSource;
|
||||
set => SetProperty(ref _triggerSource, value);
|
||||
}
|
||||
|
||||
private double _triggerLevel = 0.0;
|
||||
/// <summary>触发电平(V)。</summary>
|
||||
/// <summary>边沿触发电平(V)。</summary>
|
||||
public double TriggerLevel
|
||||
{
|
||||
get => _triggerLevel;
|
||||
set => SetProperty(ref _triggerLevel, value);
|
||||
}
|
||||
|
||||
private string _triggerSource = "C1";
|
||||
/// <summary>触发源(C1/C2/C3/C4/EX/LINE)。</summary>
|
||||
public string TriggerSource
|
||||
private TriggerSlope _selectedTriggerSlope = TriggerSlope.RISing;
|
||||
/// <summary>边沿触发斜率(RISing/FALLing/ALTernate,测泄放时间用 FALLing)。</summary>
|
||||
public TriggerSlope SelectedTriggerSlope
|
||||
{
|
||||
get => _triggerSource;
|
||||
set => SetProperty(ref _triggerSource, value);
|
||||
get => _selectedTriggerSlope;
|
||||
set => SetProperty(ref _selectedTriggerSlope, value);
|
||||
}
|
||||
|
||||
public TriggerSlope[] TriggerSlopeOptions { get; } =
|
||||
(TriggerSlope[])Enum.GetValues(typeof(TriggerSlope));
|
||||
|
||||
private double _cursorX1 = 0.0;
|
||||
/// <summary>X1 光标位置(s)。</summary>
|
||||
public double CursorX1
|
||||
{
|
||||
get => _cursorX1;
|
||||
set => SetProperty(ref _cursorX1, value);
|
||||
}
|
||||
|
||||
private double _cursorX2 = 0.001;
|
||||
/// <summary>X2 光标位置(s)。</summary>
|
||||
public double CursorX2
|
||||
{
|
||||
get => _cursorX2;
|
||||
set => SetProperty(ref _cursorX2, value);
|
||||
}
|
||||
|
||||
private string _saveFilePath = Path.Combine(AppContext.BaseDirectory, "Screenshots", "SDS2000X_HD.png");
|
||||
/// <summary>屏幕截图保存路径(保存时自动追加时间戳)。</summary>
|
||||
public string SaveFilePath
|
||||
{
|
||||
get => _saveFilePath;
|
||||
set => SetProperty(ref _saveFilePath, value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -133,6 +194,14 @@ namespace DeviceEditModule.ViewModels
|
||||
set => SetProperty(ref _measuredRms, value);
|
||||
}
|
||||
|
||||
private double _cursorDeltaT;
|
||||
/// <summary>X1/X2 光标时间差 ΔT(s)。</summary>
|
||||
public double CursorDeltaT
|
||||
{
|
||||
get => _cursorDeltaT;
|
||||
set => SetProperty(ref _cursorDeltaT, value);
|
||||
}
|
||||
|
||||
private string _responseLog = string.Empty;
|
||||
/// <summary>命令响应日志(最新消息在顶部)。</summary>
|
||||
public string ResponseLog
|
||||
@@ -145,91 +214,123 @@ namespace DeviceEditModule.ViewModels
|
||||
|
||||
#region 命令
|
||||
|
||||
// IEEE 488.2 公共命令
|
||||
public ICommand QueryIdentityCommand { get; }
|
||||
public ICommand ResetDeviceCommand { get; }
|
||||
public ICommand ClearStatusCommand { get; }
|
||||
public ICommand QueryErrorCommand { get; }
|
||||
public ICommand QueryOpcCommand { get; }
|
||||
|
||||
// 运行与捕获控制
|
||||
public ICommand RunCommand { get; }
|
||||
public ICommand StopCommand { get; }
|
||||
public ICommand SingleCommand { get; }
|
||||
public ICommand ForceTriggerCommand { get; }
|
||||
public ICommand SetTriggerModeCommand { get; }
|
||||
|
||||
// 通道垂直控制
|
||||
public ICommand SetChannelOnCommand { get; }
|
||||
public ICommand SetChannelOffCommand { get; }
|
||||
public ICommand SetChannelUnitCommand { get; }
|
||||
public ICommand SetVoltsDivCommand { get; }
|
||||
public ICommand SetOffsetCommand { get; }
|
||||
|
||||
// 🛠️ 补全:设置阻抗的 Command
|
||||
public ICommand SetImpedance50Command { get; }
|
||||
public ICommand SetImpedance1MCommand { get; }
|
||||
public ICommand SetChannelCouplingCommand { get; }
|
||||
public ICommand SetBandwidthLimitCommand { get; }
|
||||
|
||||
// 水平与触发控制
|
||||
public ICommand SetTimeBaseCommand { get; }
|
||||
public ICommand SetTriggerLevelCommand { get; }
|
||||
public ICommand SetTriggerSourceCommand { get; }
|
||||
public ICommand SetTriggerLevelCommand { get; }
|
||||
public ICommand SetTriggerSlopeCommand { get; }
|
||||
|
||||
// 光标测量
|
||||
public ICommand EnableManualXCursorCommand { get; }
|
||||
public ICommand SetCursorX1Command { get; }
|
||||
public ICommand SetCursorX2Command { get; }
|
||||
public ICommand QueryCursorDeltaTCommand { get; }
|
||||
|
||||
// 基本测量
|
||||
public ICommand QueryMeasurementsCommand { get; }
|
||||
public ICommand QueryVppCommand { get; }
|
||||
public ICommand QueryFrequencyCommand { get; }
|
||||
public ICommand QueryRmsCommand { get; }
|
||||
|
||||
// 屏幕截图
|
||||
public ICommand SaveScreenshotCommand { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
public SDS2000X_HDViewModel(IContainerProvider containerProvider) : base(containerProvider)
|
||||
{
|
||||
_deviceManager = containerProvider.Resolve<DeviceManager>();
|
||||
|
||||
// IEEE 488.2 公共命令
|
||||
QueryIdentityCommand = new DelegateCommand(async () => await Exec(async () => AppendLog("IDN: " + await _device!.查询设备标识(Ct()))));
|
||||
ResetDeviceCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.重置设备(Ct()); AppendLog("设备已重置"); }));
|
||||
RunCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.启动捕获_RUN(Ct()); AppendLog("已开始捕获"); }));
|
||||
StopCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.停止捕获_STOP(Ct()); AppendLog("已停止捕获"); }));
|
||||
SingleCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.单次触发_SINGLE(Ct()); AppendLog("已触发单次捕获"); }));
|
||||
ForceTriggerCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.强制触发(Ct()); AppendLog("已强制触发"); }));
|
||||
ResetDeviceCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.重置设备(Ct()); AppendLog("设备已重置 (*RST)"); }));
|
||||
ClearStatusCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.清除状态(Ct()); AppendLog("状态寄存器与错误队列已清除 (*CLS)"); }));
|
||||
QueryErrorCommand = new DelegateCommand(async () => await Exec(async () => AppendLog("SYST:ERR? → " + await _device!.查询错误信息(Ct()))));
|
||||
QueryOpcCommand = new DelegateCommand(async () => await Exec(async () => AppendLog("操作完成 (*OPC?): " + (await _device!.检查操作完成_OPC(Ct()) ? "是" : "否"))));
|
||||
|
||||
// 运行与捕获控制
|
||||
RunCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.启动捕获_RUN(Ct()); AppendLog("已开始连续捕获"); }));
|
||||
StopCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.停止捕获_STOP(Ct()); AppendLog("已停止捕获,画面定格"); }));
|
||||
SetTriggerModeCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置触发模式(SelectedTriggerMode, Ct()); AppendLog($"触发模式已设为 {SelectedTriggerMode}"); }));
|
||||
|
||||
// 通道垂直控制
|
||||
SetChannelOnCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道开关(Channel, true, Ct()); AppendLog($"通道 {Channel} 已开启"); }));
|
||||
SetChannelOffCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道开关(Channel, false, Ct()); AppendLog($"通道 {Channel} 已关闭"); }));
|
||||
SetVoltsDivCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道电压档位(Channel, VoltsPerDiv, Ct()); AppendLog($"C{Channel} 电压档位已设为 {VoltsPerDiv} V/div"); }));
|
||||
SetOffsetCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道垂直偏移(Channel, Offset, Ct()); AppendLog($"C{Channel} 垂直偏移已设为 {Offset} V"); }));
|
||||
|
||||
// 🛠️ 绑定:设置 50Ω 和 1MΩ 阻抗控制
|
||||
SetImpedance50Command = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
await _device!.设置通道阻抗(Channel, ImpedanceType.FIFty, Ct());
|
||||
Is50Ohm = true;
|
||||
AppendLog($"C{Channel} 输入阻抗已设为 50Ω");
|
||||
}));
|
||||
|
||||
SetImpedance1MCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
await _device!.设置通道阻抗(Channel, ImpedanceType.ONEM, Ct());
|
||||
Is50Ohm = false;
|
||||
AppendLog($"C{Channel} 输入阻抗已设为 1MΩ");
|
||||
}));
|
||||
SetChannelUnitCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道单位(Channel, ChannelUnit, Ct()); AppendLog($"C{Channel} 单位已设为 {ChannelUnit}"); }));
|
||||
SetVoltsDivCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道档位(Channel, VoltsPerDiv, Ct()); AppendLog($"C{Channel} 垂直档位已设为 {VoltsPerDiv} {ChannelUnit}/div"); }));
|
||||
SetChannelCouplingCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道耦合(Channel, SelectedCoupling, Ct()); AppendLog($"C{Channel} 耦合方式已设为 {SelectedCoupling}"); }));
|
||||
SetBandwidthLimitCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置通道带宽限制(Channel, BandwidthLimit, Ct()); AppendLog($"C{Channel} 带宽限制已设为 {BandwidthLimit}"); }));
|
||||
|
||||
// 水平与触发控制
|
||||
SetTimeBaseCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置水平时基(TimeBase, Ct()); AppendLog($"水平时基已设为 {TimeBase} s/div"); }));
|
||||
SetTriggerLevelCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置触发电平(TriggerLevel, Ct()); AppendLog($"触发电平已设为 {TriggerLevel} V"); }));
|
||||
SetTriggerSourceCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置触发源(TriggerSource, Ct()); AppendLog($"触发源已设为 {TriggerSource}"); }));
|
||||
SetTriggerSourceCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置边沿触发源(TriggerSource, Ct()); AppendLog($"边沿触发源已设为 {TriggerSource}"); }));
|
||||
SetTriggerLevelCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置边沿触发电平(TriggerLevel, Ct()); AppendLog($"边沿触发电平已设为 {TriggerLevel} V"); }));
|
||||
SetTriggerSlopeCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.设置边沿触发斜率(SelectedTriggerSlope, Ct()); AppendLog($"边沿触发斜率已设为 {SelectedTriggerSlope}"); }));
|
||||
|
||||
QueryMeasurementsCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
// 光标测量
|
||||
EnableManualXCursorCommand = new DelegateCommand(async () => await Exec(async () => { await _device!.开启手动X光标(Ct()); AppendLog("已开启手动 X 轴光标"); }));
|
||||
SetCursorX1Command = new DelegateCommand(async () => await Exec(async () => { await _device!.设置光标X1位置(CursorX1, Ct()); AppendLog($"X1 光标已设为 {CursorX1} s"); }));
|
||||
SetCursorX2Command = new DelegateCommand(async () => await Exec(async () => { await _device!.设置光标X2位置(CursorX2, Ct()); AppendLog($"X2 光标已设为 {CursorX2} s"); }));
|
||||
QueryCursorDeltaTCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
// 设备层已自动提取纯数值并返回 double
|
||||
MeasuredVpp = await _device!.查询实际电压峰峰值(Channel, Ct());
|
||||
MeasuredFrequency = await _device!.查询实际频率(Channel, Ct());
|
||||
MeasuredRms = await _device!.查询实际电压均方根(Channel, Ct());
|
||||
|
||||
AppendLog($"C{Channel} 测量结果 → Vpp:{MeasuredVpp:0.######}V Freq:{MeasuredFrequency:0.######}Hz RMS:{MeasuredRms:0.######}V");
|
||||
CursorDeltaT = await _device!.查询光标X时间差(Ct());
|
||||
AppendLog($"光标时间差 ΔT = {CursorDeltaT:0.######E+0} s");
|
||||
}));
|
||||
|
||||
// 基本测量(查询前先将测量源切换到当前通道)
|
||||
QueryVppCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
MeasuredVpp = await _device!.查询实际电压峰峰值(Channel, Ct());
|
||||
AppendLog($"C{Channel} Vpp: {MeasuredVpp:0.######} V");
|
||||
MeasuredVpp = await QuerySimpleValueAsync("PKPK");
|
||||
AppendLog($"C{Channel} Vpp: {MeasuredVpp:0.######} {ChannelUnit}");
|
||||
}));
|
||||
|
||||
QueryFrequencyCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
MeasuredFrequency = await _device!.查询实际频率(Channel, Ct());
|
||||
MeasuredFrequency = await QuerySimpleValueAsync("FREQ");
|
||||
AppendLog($"C{Channel} Freq: {MeasuredFrequency:0.######} Hz");
|
||||
}));
|
||||
|
||||
QueryRmsCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
MeasuredRms = await _device!.查询实际电压均方根(Channel, Ct());
|
||||
AppendLog($"C{Channel} RMS: {MeasuredRms:0.######} V");
|
||||
MeasuredRms = await QuerySimpleValueAsync("RMS");
|
||||
AppendLog($"C{Channel} RMS: {MeasuredRms:0.######} {ChannelUnit}");
|
||||
}));
|
||||
|
||||
QueryMeasurementsCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
await _device!.设置基本测量源(Channel, Ct());
|
||||
MeasuredVpp = await _device.查询基本测量值("PKPK", Ct());
|
||||
MeasuredFrequency = await _device.查询基本测量值("FREQ", Ct());
|
||||
MeasuredRms = await _device.查询基本测量值("RMS", Ct());
|
||||
|
||||
AppendLog($"C{Channel} 测量结果 → Vpp:{MeasuredVpp:0.######}{ChannelUnit} Freq:{MeasuredFrequency:0.######}Hz RMS:{MeasuredRms:0.######}{ChannelUnit}");
|
||||
}));
|
||||
|
||||
// 屏幕截图
|
||||
SaveScreenshotCommand = new DelegateCommand(async () => await Exec(async () =>
|
||||
{
|
||||
bool ok = await _device!.获取屏幕图像并保存(SaveFilePath, Ct());
|
||||
AppendLog(ok ? $"截图已保存:{SaveFilePath}" : "截图获取或保存失败,请检查连接与保存路径。");
|
||||
}));
|
||||
|
||||
Initialize();
|
||||
@@ -283,6 +384,17 @@ namespace DeviceEditModule.ViewModels
|
||||
|
||||
private CancellationToken Ct() => (_cts = new CancellationTokenSource(TimeSpan.FromSeconds(10))).Token;
|
||||
|
||||
/// <summary>
|
||||
/// 将基本测量源切换到当前通道后,查询指定测量项的实时数值。
|
||||
/// </summary>
|
||||
/// <param name="type">测量参数名称(如: "PKPK"、"FREQ"、"RMS")</param>
|
||||
/// <returns>测量项提取到的实时数值</returns>
|
||||
private async Task<double> QuerySimpleValueAsync(string type)
|
||||
{
|
||||
await _device!.设置基本测量源(Channel, Ct());
|
||||
return await _device.查询基本测量值(type, Ct());
|
||||
}
|
||||
|
||||
private async Task Exec(Func<Task> action)
|
||||
{
|
||||
if (_device == null)
|
||||
@@ -327,4 +439,4 @@ namespace DeviceEditModule.ViewModels
|
||||
_cts?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<!-- ─── 左列 ─── -->
|
||||
<StackPanel Grid.Column="0" Margin="0,0,4,0">
|
||||
|
||||
<!-- 通道选择 -->
|
||||
<GroupBox Header="通道选择" Margin="0,0,0,8"
|
||||
<!-- 通道与垂直设置 -->
|
||||
<GroupBox Header="通道与垂直设置" Margin="0,0,0,8"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4,4,4,4">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
@@ -103,11 +103,45 @@
|
||||
<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"
|
||||
<!-- 运行与捕获 -->
|
||||
<GroupBox Header="运行与捕获" Margin="0,0,0,8"
|
||||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||||
<StackPanel Margin="4,4,4,4">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
@@ -117,49 +151,20 @@
|
||||
Height="32" Padding="16,0" FontSize="12" Margin="4,0"/>
|
||||
<Button Content="Stop" Command="{Binding StopCommand}"
|
||||
Style="{StaticResource WarnBtn}"/>
|
||||
<Button Content="Single" Command="{Binding SingleCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
<Button Content="Force Trig" Command="{Binding ForceTriggerCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<Button Content="查询 IDN" Command="{Binding QueryIdentityCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
<Button Content="重置设备" Command="{Binding ResetDeviceCommand}"
|
||||
Style="{StaticResource WarnBtn}"/>
|
||||
</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="V/div (V)" 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="Offset (V)" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBox Style="{StaticResource NumInput}"
|
||||
Text="{Binding Offset, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<Button Content="设置" Command="{Binding SetOffsetCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||||
<TextBlock Text="输入阻抗" Style="{StaticResource ParamLabel}"/>
|
||||
<Button Content="50Ω" Command="{Binding SetImpedance50Command}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
<Button Content="1MΩ" Command="{Binding SetImpedance1MCommand}"
|
||||
<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">
|
||||
@@ -170,6 +175,13 @@
|
||||
<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}"
|
||||
@@ -178,10 +190,33 @@
|
||||
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}"
|
||||
<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>
|
||||
@@ -191,6 +226,38 @@
|
||||
<!-- ─── 右列 ─── -->
|
||||
<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">
|
||||
@@ -199,7 +266,6 @@
|
||||
<TextBlock Text="Vpp" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBox Style="{StaticResource MeasureBox}"
|
||||
Text="{Binding MeasuredVpp, Mode=OneWay}"/>
|
||||
<TextBlock Text="V" VerticalAlignment="Center" Margin="2,0,8,0"/>
|
||||
<Button Content="刷新" Command="{Binding QueryVppCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
</StackPanel>
|
||||
@@ -207,7 +273,6 @@
|
||||
<TextBlock Text="频率" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBox Style="{StaticResource MeasureBox}"
|
||||
Text="{Binding MeasuredFrequency, Mode=OneWay}"/>
|
||||
<TextBlock Text="Hz" VerticalAlignment="Center" Margin="2,0,8,0"/>
|
||||
<Button Content="刷新" Command="{Binding QueryFrequencyCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
</StackPanel>
|
||||
@@ -215,7 +280,6 @@
|
||||
<TextBlock Text="RMS" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBox Style="{StaticResource MeasureBox}"
|
||||
Text="{Binding MeasuredRms, Mode=OneWay}"/>
|
||||
<TextBlock Text="V" VerticalAlignment="Center" Margin="2,0,8,0"/>
|
||||
<Button Content="刷新" Command="{Binding QueryRmsCommand}"
|
||||
Style="{StaticResource CmdBtn}"/>
|
||||
</StackPanel>
|
||||
@@ -225,10 +289,26 @@
|
||||
</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="460" VerticalScrollBarVisibility="Auto">
|
||||
<ScrollViewer Height="240" VerticalScrollBarVisibility="Auto">
|
||||
<TextBox Text="{Binding ResponseLog, Mode=OneWay}"
|
||||
materialDesign:HintAssist.Hint=""
|
||||
IsReadOnly="True"
|
||||
|
||||
Reference in New Issue
Block a user