参数配置界面弹窗添加
This commit is contained in:
@@ -290,8 +290,84 @@
|
||||
Margin="0,0,0,12">
|
||||
<StackPanel>
|
||||
<TextBlock Text="连接参数" FontWeight="Bold" FontSize="14" Margin="0,0,0,10"/>
|
||||
<TextBlock Foreground="#888" FontSize="12" TextWrapping="Wrap"
|
||||
Text="此处将根据设备类型显示对应的连接参数(如串口波特率、CAN 比特率、IP 端口等),当前为占位区域。"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="连接方式:"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,4"/>
|
||||
<ComboBox Grid.Row="0" Grid.Column="1"
|
||||
Margin="0,4"
|
||||
ItemsSource="{Binding ConnectionTypes}"
|
||||
SelectedItem="{Binding SelectedDevice.ConnectionType}"/>
|
||||
<Button Grid.Row="0" Grid.Column="2"
|
||||
Content="配置..."
|
||||
Margin="8,4,0,4" Padding="14,2"
|
||||
Command="{Binding OpenConnectionConfigCommand}"/>
|
||||
|
||||
<!-- TCP 参数预览 -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
Margin="0,4,0,0" Orientation="Horizontal">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedDevice.ConnectionType}" Value="TCP">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
<TextBlock Foreground="#666" FontSize="12">
|
||||
<Run Text="IP:"/>
|
||||
<Run Text="{Binding SelectedDevice.TcpConfig.IPAddress}"/>
|
||||
<Run Text=" 端口:"/>
|
||||
<Run Text="{Binding SelectedDevice.TcpConfig.Port}"/>
|
||||
<Run Text=" 发送/接收超时:"/>
|
||||
<Run Text="{Binding SelectedDevice.TcpConfig.SendTimeout}"/>
|
||||
<Run Text="/"/>
|
||||
<Run Text="{Binding SelectedDevice.TcpConfig.ReceiveTimeout}"/>
|
||||
<Run Text=" ms"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 串口参数预览 -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
Margin="0,4,0,0" Orientation="Horizontal">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SelectedDevice.ConnectionType}" Value="Serial">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
<TextBlock Foreground="#666" FontSize="12">
|
||||
<Run Text="串口:"/>
|
||||
<Run Text="{Binding SelectedDevice.SerialPortConfig.PortName}"/>
|
||||
<Run Text=" 波特率:"/>
|
||||
<Run Text="{Binding SelectedDevice.SerialPortConfig.BaudRate}"/>
|
||||
<Run Text=" 数据/停止/校验:"/>
|
||||
<Run Text="{Binding SelectedDevice.SerialPortConfig.DataBits}"/>
|
||||
<Run Text="/"/>
|
||||
<Run Text="{Binding SelectedDevice.SerialPortConfig.StopBits}"/>
|
||||
<Run Text="/"/>
|
||||
<Run Text="{Binding SelectedDevice.SerialPortConfig.Parity}"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user