673 lines
51 KiB
XML
673 lines
51 KiB
XML
<UserControl x:Class="PowerAdaptabilityModule.Views.PowerAdaptabilityView"
|
||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
mc:Ignorable="d"
|
||
xmlns:prism="http://prismlibrary.com/"
|
||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||
xmlns:converters="clr-namespace:UIShare.Converters;assembly=UIShare"
|
||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||
d:DesignHeight="1080"
|
||
d:DesignWidth="1920">
|
||
<UserControl.Resources>
|
||
<converters:BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||
</UserControl.Resources>
|
||
|
||
<Border Background="#F5F7FA">
|
||
<Grid Margin="8">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="360" />
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<!-- ============ 左侧:Chroma 命令面板 ============ -->
|
||
<ScrollViewer Grid.Column="0"
|
||
VerticalScrollBarVisibility="Auto"
|
||
HorizontalScrollBarVisibility="Disabled"
|
||
Margin="0,0,8,0">
|
||
<StackPanel>
|
||
|
||
<!-- 设备状态卡片 -->
|
||
<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="Flash"
|
||
Width="22" Height="22"
|
||
Foreground="#1565C0"
|
||
Margin="0,0,8,0"
|
||
VerticalAlignment="Center" />
|
||
<TextBlock Text="电源适应性测试 · Chroma61800"
|
||
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="60" Height="4"
|
||
Margin="12,0,0,0"
|
||
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVis}}" />
|
||
</StackPanel>
|
||
</Grid>
|
||
</materialDesign:Card>
|
||
|
||
<!-- 三相输出控制 -->
|
||
<GroupBox Header="三相输出控制" Margin="0,0,0,8"
|
||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||
<StackPanel Margin="4">
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<Button Content="开启输出" Command="{Binding OutputOnCommand}"
|
||
Style="{StaticResource CmdBtn}"
|
||
Background="#388E3C" Foreground="White" />
|
||
<Button Content="关闭输出" Command="{Binding OutputOffCommand}"
|
||
Style="{StaticResource WarnBtn}" />
|
||
<Button Content="复位" Command="{Binding ResetCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
<Button Content="退出远程" Command="{Binding ExitRemoteCommand}"
|
||
Style="{StaticResource CmdBtn}"
|
||
ToolTip="SYST:LOC:退出远程状态、恢复前面板操作(手册注明僅 RS-232 控制下有效)" />
|
||
<Button Content="查询 IDN" Command="{Binding QueryIdnCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="相模式" Style="{StaticResource ParamLabel}" />
|
||
<Button Content="三相" Command="{Binding SetThreePhaseModeCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
<Button Content="单相" Command="{Binding SetSinglePhaseModeCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="耦合模式" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="110" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding CouplingOptions}"
|
||
SelectedItem="{Binding CouplingMode}" />
|
||
<Button Content="应用" Command="{Binding ApplyCouplingCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="三相关系" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="110" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding RelationOptions}"
|
||
SelectedItem="{Binding ThreePhaseRelation}" />
|
||
<Button Content="应用" Command="{Binding ApplyRelationCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="输出继电器" Style="{StaticResource ParamLabel}" />
|
||
<Button Content="开启" Command="{Binding RelayOnCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
<Button Content="关闭" Command="{Binding RelayOffCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<!-- 输出参数设置 -->
|
||
<GroupBox Header="输出参数设置" Margin="0,0,0,8"
|
||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||
<StackPanel Margin="4">
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="相位选择" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="130" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding PhaseOptions}"
|
||
SelectedIndex="{Binding SelectedPhaseIndex}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="电压 (V)" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}"
|
||
Text="{Binding Voltage, UpdateSourceTrigger=PropertyChanged}" />
|
||
<Button Content="设置" Command="{Binding SetVoltageCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="频率 (Hz)" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}"
|
||
Text="{Binding Frequency, UpdateSourceTrigger=PropertyChanged}" />
|
||
<Button Content="设置" Command="{Binding SetFrequencyCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="波形" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="130" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding WaveformOptions}"
|
||
SelectedItem="{Binding Waveform}"
|
||
ToolTip="FUNC:SHAP:A — SINE / SQUA / TRIAN(三角)/ CSIN、内建 DST01~30、自定义 USR01~30" />
|
||
<Button Content="设置" Command="{Binding SetWaveformCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<!-- LIST 模式(三相独立) -->
|
||
<GroupBox Header="LIST 模式(三相独立)" Margin="0,0,0,8"
|
||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||
<StackPanel Margin="4">
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="测试项" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="230" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding PresetOptions}"
|
||
SelectedIndex="{Binding SelectedPresetIndex}" />
|
||
<Button Content="载入" Command="{Binding LoadPresetCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="名称" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}" Width="150"
|
||
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="删除下拉框当前选中的测试项文件(带二次确认)" />
|
||
</StackPanel>
|
||
<TextBox Margin="4,0,4,2" FontSize="11" Foreground="#1565C0"
|
||
Height="46" TextWrapping="Wrap" AcceptsReturn="True"
|
||
VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Top"
|
||
ToolTip="测试项说明(随文件一并保存)"
|
||
Text="{Binding PresetNote, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="{Binding PresetStorageHint}"
|
||
FontSize="11" Foreground="#757575"
|
||
Margin="4,0,4,4" TextWrapping="Wrap" />
|
||
|
||
<Separator Margin="0,4" />
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="操作模态" Style="{StaticResource ParamLabel}" />
|
||
<Button Content="FIXED 固定" Command="{Binding SetFixedModeCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
<Button Content="进入 LIST" Command="{Binding EnterListModeCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="执行次数" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}" Width="60"
|
||
ToolTip="0 = 无限循环"
|
||
Text="{Binding ListCount, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="触发" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="88" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding ListTriggerOptions}"
|
||
SelectedItem="{Binding ListTrigger}" />
|
||
<TextBlock Text="时基" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="80" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding ListTimeBaseOptions}"
|
||
SelectedItem="{Binding ListTimeBase}" />
|
||
<TextBlock Text="相位连续" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="88" Height="32" FontSize="12" Margin="4,0"
|
||
ToolTip="SOUR:LIST:PHAS:CONT — 相位连续功能:DISABLE | ENABLE"
|
||
ItemsSource="{Binding ListPhaseContinueOptions}"
|
||
SelectedItem="{Binding ListPhaseContinue}" />
|
||
</StackPanel>
|
||
|
||
<Separator Margin="0,6" />
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="编辑相位" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="100" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding ListPhaseOptions}"
|
||
SelectedIndex="{Binding ListEditPhaseIndex}" />
|
||
</StackPanel>
|
||
<Button Content="复制当前相到三相(B/C 相位角自动 ±120°)"
|
||
Command="{Binding CopyPhaseToThreeCommand}"
|
||
Style="{StaticResource CmdBtn}"
|
||
HorizontalAlignment="Left" Margin="0,4" />
|
||
<TextBlock Text="序列设置(英文逗号分隔,留空则不下发;作用于上方选中的相位)"
|
||
FontSize="12" Foreground="#616161" Margin="4,2" TextWrapping="Wrap" />
|
||
<Grid Margin="0,2">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="92" />
|
||
<ColumnDefinition Width="*" />
|
||
</Grid.ColumnDefinitions>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<TextBlock Grid.Row="0" Grid.Column="0" Text="相位角度"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:DEGR,单位 °,如 0,90,0;三相基准 0/120/240"
|
||
Text="{Binding ListDegrText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="1" Grid.Column="0" Text="AC起始电压"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:VOLT:AC:STAR,单位 V,如 230,11.5,230"
|
||
Text="{Binding ListVoltAcStartText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="2" Grid.Column="0" Text="AC结束电压"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:VOLT:AC:END,单位 V,如 230,11.5,230"
|
||
Text="{Binding ListVoltAcEndText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="3" Grid.Column="0" Text="DC起始电压"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="3" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:VOLT:DC:STAR,单位 V,如 10,10,10"
|
||
Text="{Binding ListVoltDcStartText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="4" Grid.Column="0" Text="DC结束电压"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="4" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:VOLT:DC:END,单位 V,如 10,10,10"
|
||
Text="{Binding ListVoltDcEndText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="5" Grid.Column="0" Text="起始频率"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="5" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:FREQ:STAR,单位 Hz,如 50,50,50"
|
||
Text="{Binding ListFreqStartText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="6" Grid.Column="0" Text="结束频率"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="6" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:FREQ:END,单位 Hz,如 50,50,50"
|
||
Text="{Binding ListFreqEndText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="7" Grid.Column="0" Text="静止时间"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="7" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:DWEL,单位 ms,如 20000,280,20000"
|
||
Text="{Binding ListDwellText, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<TextBlock Grid.Row="8" Grid.Column="0" Text="波形顺序"
|
||
Style="{StaticResource ParamLabel}" />
|
||
<TextBox Grid.Row="8" Grid.Column="1" Style="{StaticResource NumInput}"
|
||
Width="240" ToolTip="LIST:SHAP 序列:可直接写形状名 SINE/SQUA/TRIAN/CSIN/DST01~30/USR01~30,或引用 A/B 组,如 SINE,SQUA,TRIAN(可留空)"
|
||
Text="{Binding ListShapeText, UpdateSourceTrigger=PropertyChanged}" />
|
||
</Grid>
|
||
|
||
<Separator Margin="0,6" />
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<Button Content="下发三相并启动 LIST" Command="{Binding DownloadThreePhaseListCommand}"
|
||
Style="{StaticResource CmdBtn}"
|
||
Background="#388E3C" Foreground="White" />
|
||
<Button Content="停止 LIST" Command="{Binding ListStopCommand}"
|
||
Style="{StaticResource WarnBtn}" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<!-- SYNTHESIS 自定义谐波波形输出 -->
|
||
<GroupBox Header="SYNTHESIS 波形输出(自定义谐波)" Margin="0,0,0,8"
|
||
materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||
<StackPanel Margin="4">
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="波形文件" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="210" Height="32" FontSize="12" Margin="4,0"
|
||
ItemsSource="{Binding SynthPresetOptions}"
|
||
SelectedIndex="{Binding SelectedSynthPresetIndex}" />
|
||
<Button Content="载入" Command="{Binding LoadSynthPresetCommand}"
|
||
Style="{StaticResource CmdBtn}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="名称" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}" Width="150"
|
||
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="删除下拉框当前选中的波形文件(带二次确认)" />
|
||
</StackPanel>
|
||
<TextBox Margin="4,0,4,2" FontSize="11" Foreground="#1565C0"
|
||
Height="40" TextWrapping="Wrap" AcceptsReturn="True"
|
||
VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Top"
|
||
ToolTip="波形说明(随文件一并保存)"
|
||
Text="{Binding SynthPresetNote, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="{Binding SynthStorageHint}"
|
||
FontSize="11" Foreground="#757575"
|
||
Margin="4,0,4,4" TextWrapping="Wrap" />
|
||
|
||
<Separator Margin="0,4" />
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="数据格式" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="120" Height="32" FontSize="12" Margin="4,0"
|
||
ToolTip="SYNT:COMP,VALUE=绝对值 / PERCENT=基频百分率,后缀 1/2/3 为三段波形"
|
||
ItemsSource="{Binding SynthComposeOptions}"
|
||
SelectedItem="{Binding SynthCompose}" />
|
||
<TextBlock Text="基频" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="70" Height="32" FontSize="12" Margin="4,0"
|
||
ToolTip="SYNT:FREQ,仅支持 50 / 60 Hz"
|
||
ItemsSource="{Binding SynthFrequencyOptions}"
|
||
SelectedItem="{Binding SynthFrequency}" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="基波电压" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}"
|
||
ToolTip="SYNT:FUND,基波交流电压,单位 V,0.0 ~ 300.0"
|
||
Text="{Binding SynthFundamental, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="V" VerticalAlignment="Center" Margin="2,0,10,0" />
|
||
<TextBlock Text="直流" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}"
|
||
ToolTip="SYNT:DC,叠加直流电压,单位 V,-424.2 ~ 424.2"
|
||
Text="{Binding SynthDc, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="V" VerticalAlignment="Center" Margin="2,0,0,0" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="编辑相位" Style="{StaticResource ParamLabel}" />
|
||
<ComboBox Width="100" Height="32" FontSize="12" Margin="4,0"
|
||
ToolTip="当前编辑的相位(INST:NSEL 1/2/3),起始相位/谐波振幅/谐波相位作用于该相"
|
||
ItemsSource="{Binding ListPhaseOptions}"
|
||
SelectedIndex="{Binding SynthEditPhaseIndex}" />
|
||
<Button Content="复制当前相到三相(起始相位自动 ±120°)"
|
||
Command="{Binding CopySynthPhaseToThreeCommand}"
|
||
Style="{StaticResource CmdBtn}" Margin="8,0,0,0"
|
||
ToolTip="把当前相的起始相位/谐波振幅/谐波相位复制到另外两相:谐波内容相同,起始相位按 ±120° 偏移生成对称三相;需再点「下发并启动 SYNTH」写入仪器" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<TextBlock Text="起始相位" Style="{StaticResource ParamLabel}" />
|
||
<TextBox Style="{StaticResource NumInput}"
|
||
ToolTip="SYNT:SPH,起始相位角,单位 °,0.0 ~ 359.9(作用于上方选中的编辑相位)"
|
||
Text="{Binding SynthStartPhase, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="°" VerticalAlignment="Center" Margin="2,0,0,0" />
|
||
</StackPanel>
|
||
<TextBlock Text="谐波振幅(SYNT:AMPL,英文逗号分隔,首值=2次谐波,依次 3/4/5…最多 50 阶,留空不下发)"
|
||
FontSize="11" Foreground="#616161" Margin="4,4,4,2" TextWrapping="Wrap" />
|
||
<TextBox Style="{StaticResource NumInput}" Width="380" HorizontalAlignment="Left" Margin="4,0"
|
||
ToolTip="如 0,10,0,5 表示 2次=0、3次=10、4次=0、5次=5(VALUE 为绝对值 V,PERCENT 为基波百分率)"
|
||
Text="{Binding SynthAmplitudeText, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Text="谐波相位(SYNT:PHAS,英文逗号分隔,与振幅逐阶对应,单位 °,0~359.9,留空不下发)"
|
||
FontSize="11" Foreground="#616161" Margin="4,4,4,2" TextWrapping="Wrap" />
|
||
<TextBox Style="{StaticResource NumInput}" Width="380" HorizontalAlignment="Left" Margin="4,0"
|
||
ToolTip="如 0,180,90 与振幅序列逐阶对应"
|
||
Text="{Binding SynthPhaseText, UpdateSourceTrigger=PropertyChanged}" />
|
||
<Separator Margin="0,6" />
|
||
<StackPanel Orientation="Horizontal" Margin="0,4">
|
||
<Button Content="下发并启动 SYNTH" Command="{Binding DownloadSynthesisCommand}"
|
||
Style="{StaticResource CmdBtn}"
|
||
ToolTip="三相独立下发(INST:EDIT EACH + INST:NSEL 逐相):每相谐波内容相同、起始相位各不相同(±120° 对称)"
|
||
Background="#388E3C" Foreground="White" />
|
||
<Button Content="停止 SYNTH" Command="{Binding SynthStopCommand}"
|
||
Style="{StaticResource WarnBtn}" />
|
||
<Button Content="重置谐波(49个0)" Command="{Binding ResetSynthHarmonicsCommand}"
|
||
Style="{StaticResource CmdBtn}"
|
||
ToolTip="谐波范围 2~50 阶共 49 个值(首值对应 2 次):把谐波振幅/相位两框填成 49 个 0(仅改界面文本,需再点「下发并启动 SYNTH」才写入仪器)" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<!-- 日志 -->
|
||
<GroupBox Header="日志" materialDesign:ColorZoneAssist.Mode="PrimaryLight">
|
||
<ScrollViewer Height="150" VerticalScrollBarVisibility="Auto">
|
||
<TextBox Text="{Binding ResponseLog, Mode=OneWay}"
|
||
IsReadOnly="True" TextWrapping="Wrap"
|
||
FontSize="11" FontFamily="Consolas"
|
||
Background="#FAFAFA" BorderThickness="0"
|
||
VerticalAlignment="Top" />
|
||
</ScrollViewer>
|
||
</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>
|