|
|
@@ -8,70 +8,115 @@
|
|
|
<vm:ViewBViewModel/>
|
|
|
</UserControl.DataContext>
|
|
|
|
|
|
- <Border Background="#0A0E14">
|
|
|
- <ScrollViewer>
|
|
|
- <Grid RowDefinitions="Auto,Auto,Auto" Margin="20">
|
|
|
- <!-- PLC 连接设置 -->
|
|
|
- <Border Grid.Row="0" Background="#2d2d44" CornerRadius="8" Padding="15" Margin="0,0,0,15">
|
|
|
- <StackPanel>
|
|
|
- <TextBlock Text="PLC 连接设置" FontWeight="Bold" FontSize="18" Foreground="White" Margin="0,0,0,15"/>
|
|
|
- <Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto,Auto" Margin="10">
|
|
|
- <!-- IP 地址 -->
|
|
|
- <TextBlock Grid.Row="0" Grid.Column="0" Text="IP 地址:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding PlcIp}" Margin="5"/>
|
|
|
+ <Border Background="{DynamicResource AppBgBrush}">
|
|
|
+ <Grid RowDefinitions="48,*,32">
|
|
|
+ <!-- 顶部 -->
|
|
|
+ <Border Grid.Row="0" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
|
|
|
+ <Grid Margin="16,0">
|
|
|
+ <StackPanel Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
|
|
|
+ <Border Background="{DynamicResource InfoBrush}" Width="3" Height="20" CornerRadius="1"/>
|
|
|
+ <TextBlock Text="PARAMETERS" FontFamily="{DynamicResource MonoFont}" FontSize="16" FontWeight="Bold"
|
|
|
+ Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <TextBlock Text="系统参数配置" FontSize="12" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 内容 -->
|
|
|
+ <ScrollViewer Grid.Row="1" Margin="8,4">
|
|
|
+ <Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto">
|
|
|
+
|
|
|
+ <!-- PLC 连接设置 -->
|
|
|
+ <Border Grid.Row="0" Grid.Column="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
|
|
|
+ BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="12" Margin="0,0,4,4">
|
|
|
+ <StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,12">
|
|
|
+ <Border Background="{DynamicResource InfoBrush}" Width="3" Height="14" CornerRadius="1"/>
|
|
|
+ <TextBlock Text="PLC CONNECTION" FontFamily="{DynamicResource MonoFont}" FontSize="12" FontWeight="Bold"
|
|
|
+ Foreground="{DynamicResource TextSecondaryBrush}"/>
|
|
|
+ </StackPanel>
|
|
|
+ <Grid ColumnDefinitions="100,*" RowDefinitions="Auto,Auto,Auto,Auto" Margin="4,0">
|
|
|
+ <TextBlock Grid.Row="0" Grid.Column="0" Text="IP ADDRESS" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding PlcIp}" Margin="0,4"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="1" Grid.Column="0" Text="PORT" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding PlcPort}" Minimum="1" Maximum="65535" Margin="0,4"/>
|
|
|
|
|
|
- <!-- 端口 -->
|
|
|
- <TextBlock Grid.Row="1" Grid.Column="0" Text="端口:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding PlcPort}"
|
|
|
- Minimum="1" Maximum="65535" Margin="5"/>
|
|
|
+ <TextBlock Grid.Row="2" Grid.Column="0" Text="AUTO CONN" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding AutoConnect}" Margin="0,4"/>
|
|
|
|
|
|
- <!-- 自动连接 -->
|
|
|
- <TextBlock Grid.Row="2" Grid.Column="0" Text="自动连接:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding AutoConnect}" Margin="5"/>
|
|
|
+ <TextBlock Grid.Row="3" Grid.Column="0" Text="STATUS" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Spacing="10" Margin="0,4">
|
|
|
+ <TextBlock Text="{Binding ConnectionStatus}" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <Button Content="TEST" Command="{Binding TestConnectionCommand}" Classes="btn-info"
|
|
|
+ IsEnabled="{Binding !IsConnecting}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
|
|
|
- <!-- 连接状态 -->
|
|
|
- <TextBlock Grid.Row="3" Grid.Column="0" Text="状态:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Spacing="10" Margin="5">
|
|
|
- <TextBlock Text="{Binding ConnectionStatus}" VerticalAlignment="Center" Foreground="White"/>
|
|
|
- <Button Content="测试连接" Command="{Binding TestConnectionCommand}"
|
|
|
- IsEnabled="{Binding !IsConnecting}"/>
|
|
|
+ <!-- 报警阈值设置 -->
|
|
|
+ <Border Grid.Row="0" Grid.Column="1" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
|
|
|
+ BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="12" Margin="4,0,0,4">
|
|
|
+ <StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,12">
|
|
|
+ <Border Background="{DynamicResource WarningBrush}" Width="3" Height="14" CornerRadius="1"/>
|
|
|
+ <TextBlock Text="ALARM THRESHOLDS" FontFamily="{DynamicResource MonoFont}" FontSize="12" FontWeight="Bold"
|
|
|
+ Foreground="{DynamicResource TextSecondaryBrush}"/>
|
|
|
</StackPanel>
|
|
|
- </Grid>
|
|
|
- </StackPanel>
|
|
|
- </Border>
|
|
|
+ <Grid ColumnDefinitions="120,*,60" RowDefinitions="Auto,Auto,Auto" Margin="4,0">
|
|
|
+ <TextBlock Grid.Row="0" Grid.Column="0" Text="LEVEL HIGH" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <NumericUpDown Grid.Row="0" Grid.Column="1" Value="{Binding LevelHighAlarm}" Minimum="0" Maximum="100" FormatString="F1" Margin="0,4"/>
|
|
|
+ <TextBlock Grid.Row="0" Grid.Column="2" Text="%" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
|
|
|
- <!-- 报警阈值设置 -->
|
|
|
- <Border Grid.Row="1" Background="#2d2d44" CornerRadius="8" Padding="15" Margin="0,0,0,15">
|
|
|
- <StackPanel>
|
|
|
- <TextBlock Text="报警阈值设置" FontWeight="Bold" FontSize="18" Foreground="White" Margin="0,0,0,15"/>
|
|
|
- <Grid ColumnDefinitions="Auto,*,Auto,*" RowDefinitions="Auto,Auto,Auto" Margin="10">
|
|
|
- <!-- 液位高报警 -->
|
|
|
- <TextBlock Grid.Row="0" Grid.Column="0" Text="液位高报警:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <NumericUpDown Grid.Row="0" Grid.Column="1" Value="{Binding LevelHighAlarm}"
|
|
|
- Minimum="0" Maximum="100" FormatString="F1" Margin="5"/>
|
|
|
- <TextBlock Grid.Row="0" Grid.Column="2" Text="%" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
+ <TextBlock Grid.Row="1" Grid.Column="0" Text="LEVEL LOW" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding LevelLowAlarm}" Minimum="0" Maximum="100" FormatString="F1" Margin="0,4"/>
|
|
|
+ <TextBlock Grid.Row="1" Grid.Column="2" Text="%" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
|
|
|
- <!-- 液位低报警 -->
|
|
|
- <TextBlock Grid.Row="1" Grid.Column="0" Text="液位低报警:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding LevelLowAlarm}"
|
|
|
- Minimum="0" Maximum="100" FormatString="F1" Margin="5"/>
|
|
|
- <TextBlock Grid.Row="1" Grid.Column="2" Text="%" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
+ <TextBlock Grid.Row="2" Grid.Column="0" Text="FLOW HIGH" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <NumericUpDown Grid.Row="2" Grid.Column="1" Value="{Binding FlowHighAlarm}" Minimum="0" Maximum="1000" FormatString="F1" Margin="0,4"/>
|
|
|
+ <TextBlock Grid.Row="2" Grid.Column="2" Text="m³/h" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ </Grid>
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
|
|
|
- <!-- 流量高报警 -->
|
|
|
- <TextBlock Grid.Row="2" Grid.Column="0" Text="流量高报警:" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- <NumericUpDown Grid.Row="2" Grid.Column="1" Value="{Binding FlowHighAlarm}"
|
|
|
- Minimum="0" Maximum="1000" FormatString="F1" Margin="5"/>
|
|
|
- <TextBlock Grid.Row="2" Grid.Column="2" Text="m³/h" VerticalAlignment="Center" Margin="5" Foreground="White"/>
|
|
|
- </Grid>
|
|
|
- </StackPanel>
|
|
|
- </Border>
|
|
|
+ <!-- 泵频率设置 -->
|
|
|
+ <Border Grid.Row="1" Grid.Column="0" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
|
|
|
+ BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="12" Margin="0,4,4,0">
|
|
|
+ <StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,12">
|
|
|
+ <Border Background="{DynamicResource SuccessBrush}" Width="3" Height="14" CornerRadius="1"/>
|
|
|
+ <TextBlock Text="PUMP SETTINGS" FontFamily="{DynamicResource MonoFont}" FontSize="12" FontWeight="Bold"
|
|
|
+ Foreground="{DynamicResource TextSecondaryBrush}"/>
|
|
|
+ </StackPanel>
|
|
|
+ <Grid ColumnDefinitions="120,*,60" Margin="4,0">
|
|
|
+ <TextBlock Grid.Column="0" Text="FREQUENCY" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ <NumericUpDown Grid.Column="1" Value="{Binding PumpFrequency}" Minimum="0" Maximum="100" FormatString="F1" Margin="0,4"/>
|
|
|
+ <TextBlock Grid.Column="2" Text="Hz" FontFamily="{DynamicResource MonoFont}" FontSize="11" Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
|
|
|
+ </Grid>
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <Border Grid.Row="1" Grid.Column="1" Background="{DynamicResource SurfaceBgBrush}" CornerRadius="2"
|
|
|
+ BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="12" Margin="4,4,0,0">
|
|
|
+ <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="12">
|
|
|
+ <TextBlock Text="ACTIONS" FontFamily="{DynamicResource MonoFont}" FontSize="12" FontWeight="Bold"
|
|
|
+ Foreground="{DynamicResource TextSecondaryBrush}" HorizontalAlignment="Center"/>
|
|
|
+ <StackPanel Orientation="Horizontal" Spacing="12" HorizontalAlignment="Center">
|
|
|
+ <Button Content="SAVE CONFIG" Command="{Binding SaveConfigCommand}" Classes="btn-success"/>
|
|
|
+ <Button Content="RESET DEFAULT" Command="{Binding ResetToDefaultCommand}" Classes="btn-warning"/>
|
|
|
+ </StackPanel>
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
+ </Grid>
|
|
|
+ </ScrollViewer>
|
|
|
|
|
|
- <!-- 操作按钮 -->
|
|
|
- <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
|
|
- <Button Content="保存设置" Command="{Binding SaveConfigCommand}" Width="120" Height="35"/>
|
|
|
- <Button Content="恢复默认" Command="{Binding ResetToDefaultCommand}" Width="120" Height="35"/>
|
|
|
- </StackPanel>
|
|
|
- </Grid>
|
|
|
- </ScrollViewer>
|
|
|
+ <!-- 底部状态栏 -->
|
|
|
+ <Border Grid.Row="2" Background="{DynamicResource SurfaceBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
|
|
|
+ <TextBlock Text="CONFIG v1.0" FontFamily="{DynamicResource MonoFont}" FontSize="10"
|
|
|
+ Foreground="{DynamicResource TextDisabledBrush}" VerticalAlignment="Center" Margin="16,0"/>
|
|
|
+ </Border>
|
|
|
+ </Grid>
|
|
|
</Border>
|
|
|
</UserControl>
|