200 lines
9.2 KiB
Plaintext
200 lines
9.2 KiB
Plaintext
|
|
<UserControl x:Class="HME_MoistureLossMeter.Views.ManualControlView"
|
||
|
|
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"
|
||
|
|
mc:Ignorable="d"
|
||
|
|
d:DesignHeight="700" d:DesignWidth="1024">
|
||
|
|
|
||
|
|
<Grid Background="{StaticResource BackgroundBrush}" Margin="10">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<!-- 左侧:参数设置 -->
|
||
|
|
<Border Grid.Row="0" Grid.RowSpan="2" Grid.Column="0"
|
||
|
|
Style="{StaticResource PanelBorderStyle}"
|
||
|
|
Margin="0,0,10,0">
|
||
|
|
<Grid>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<TextBlock Text="参数设置"
|
||
|
|
FontSize="16"
|
||
|
|
FontWeight="Bold"
|
||
|
|
Foreground="{StaticResource PrimaryBrush}"
|
||
|
|
Margin="0,0,0,15"/>
|
||
|
|
|
||
|
|
<Grid Grid.Row="1">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="120"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="Auto"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
||
|
|
Text="手动速度"
|
||
|
|
FontWeight="SemiBold"
|
||
|
|
VerticalAlignment="Center"/>
|
||
|
|
<TextBox Grid.Row="0" Grid.Column="1"
|
||
|
|
Text="{Binding ManualSpeed, StringFormat='{}{0:F2}'}"
|
||
|
|
Margin="5,0,5,0"/>
|
||
|
|
<TextBlock Grid.Row="0" Grid.Column="2"
|
||
|
|
Text="mm/MIN"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Foreground="#7F8C8D"/>
|
||
|
|
|
||
|
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
||
|
|
Text="潮气量系数"
|
||
|
|
FontWeight="SemiBold"
|
||
|
|
VerticalAlignment="Center"/>
|
||
|
|
<TextBox Grid.Row="1" Grid.Column="1"
|
||
|
|
Text="{Binding TidalCoeff, StringFormat='{}{0:F2}'}"
|
||
|
|
Margin="5,0,5,0"/>
|
||
|
|
|
||
|
|
<TextBlock Grid.Row="2" Grid.Column="0"
|
||
|
|
Text="频率系数"
|
||
|
|
FontWeight="SemiBold"
|
||
|
|
VerticalAlignment="Center"/>
|
||
|
|
<TextBox Grid.Row="2" Grid.Column="1"
|
||
|
|
Text="{Binding FreqCoeff, StringFormat='{}{0:F2}'}"
|
||
|
|
Margin="5,0,5,0"/>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
Margin="0,10,0,0">
|
||
|
|
<Button Content="保存参数"
|
||
|
|
Command="{Binding SaveParametersCommand}"
|
||
|
|
Width="100" Height="35"
|
||
|
|
Background="{StaticResource SuccessBrush}"/>
|
||
|
|
<Button Content="刷新"
|
||
|
|
Command="{Binding RefreshParametersCommand}"
|
||
|
|
Width="80" Height="35"
|
||
|
|
Margin="10,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
</Grid>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<!-- 右侧:手动控制 -->
|
||
|
|
<Border Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"
|
||
|
|
Style="{StaticResource PanelBorderStyle}"
|
||
|
|
Margin="10,0,0,0">
|
||
|
|
<Grid>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<TextBlock Text="手动控制"
|
||
|
|
FontSize="16"
|
||
|
|
FontWeight="Bold"
|
||
|
|
Foreground="{StaticResource PrimaryBrush}"
|
||
|
|
Margin="0,0,0,15"/>
|
||
|
|
|
||
|
|
<!-- 控制按钮 -->
|
||
|
|
<Grid Grid.Row="1">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<!-- 方向控制 -->
|
||
|
|
<Button Grid.Row="0" Grid.Column="1"
|
||
|
|
Content="▲ 上升"
|
||
|
|
Command="{Binding MoveUpCommand}"
|
||
|
|
Height="40"
|
||
|
|
Background="{StaticResource WarningBrush}"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<Button Grid.Row="1" Grid.Column="0"
|
||
|
|
Content="◄ 左"
|
||
|
|
Command="{Binding MoveLeftCommand}"
|
||
|
|
Height="40"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<Button Grid.Row="1" Grid.Column="1"
|
||
|
|
Content="校零"
|
||
|
|
Command="{Binding ZeroCalibrationCommand}"
|
||
|
|
Height="40"
|
||
|
|
Background="{StaticResource AccentBrush}"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<Button Grid.Row="1" Grid.Column="2"
|
||
|
|
Content="右 ►"
|
||
|
|
Command="{Binding MoveRightCommand}"
|
||
|
|
Height="40"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<Button Grid.Row="2" Grid.Column="1"
|
||
|
|
Content="▼ 下降"
|
||
|
|
Command="{Binding MoveDownCommand}"
|
||
|
|
Height="40"
|
||
|
|
Background="{StaticResource WarningBrush}"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<!-- 呼吸控制 -->
|
||
|
|
<Button Grid.Row="3" Grid.Column="0"
|
||
|
|
Content="手动呼"
|
||
|
|
Command="{Binding ManualExhaleCommand}"
|
||
|
|
Height="40"
|
||
|
|
Background="{StaticResource DangerBrush}"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<Button Grid.Row="3" Grid.Column="1"
|
||
|
|
Content="停止"
|
||
|
|
Command="{Binding StopTestCommand}"
|
||
|
|
Height="40"
|
||
|
|
Background="{StaticResource DangerBrush}"
|
||
|
|
Margin="5"/>
|
||
|
|
|
||
|
|
<Button Grid.Row="3" Grid.Column="2"
|
||
|
|
Content="手动吸"
|
||
|
|
Command="{Binding ManualInhaleCommand}"
|
||
|
|
Height="40"
|
||
|
|
Background="{StaticResource SuccessBrush}"
|
||
|
|
Margin="5"/>
|
||
|
|
</Grid>
|
||
|
|
|
||
|
|
<!-- 状态显示 -->
|
||
|
|
<Border Grid.Row="2" Background="#F8F9FA" CornerRadius="4" Padding="5" Margin="0,10,0,0">
|
||
|
|
<StackPanel Orientation="Horizontal">
|
||
|
|
<TextBlock Text="PLC状态: " FontWeight="Bold" FontSize="12"/>
|
||
|
|
<TextBlock Text="{Binding ConnectionStatus}"
|
||
|
|
Foreground="{Binding IsConnected, Converter={StaticResource BoolToVisibilityConverter},
|
||
|
|
ConverterParameter=SuccessBrush, FallbackValue={StaticResource DangerBrush}}"
|
||
|
|
FontWeight="Bold"/>
|
||
|
|
<TextBlock Text=" | 手动速度: " FontWeight="Bold" FontSize="12" Margin="15,0,0,0"/>
|
||
|
|
<TextBlock Text="{Binding ManualSpeed, StringFormat='{}{0:F2} mm/MIN'}" FontSize="12"/>
|
||
|
|
</StackPanel>
|
||
|
|
</Border>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
</Grid>
|
||
|
|
</UserControl>
|