Files
huadongmocaceshiyi/HomePage.xaml
2026-03-11 16:42:31 +08:00

151 lines
8.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<UserControl x:Class="PLCDataMonitor.HomePage"
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"
xmlns:local="clr-namespace:PLCDataMonitor"
mc:Ignorable="d"
d:DesignHeight="480" d:DesignWidth="960"
FontFamily="Microsoft YaHei">
<!-- 最外层网格,明确划分两行:顶部连接区和数据区 -->
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<!-- 顶部区域自动适应高度 -->
<RowDefinition Height="*"/>
<!-- 数据区域占剩余空间 -->
</Grid.RowDefinitions>
<!-- 顶部PLC连接区域 -->
<!--<Border Grid.Row="0" Background="White" Margin="0,0,0,10" Padding="10" Height="60">
-->
<!-- 这里可以放PLC连接控件示例 -->
<!--
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="PLC连接状态" Margin="5"/>
<TextBlock Text="未连接" Foreground="Red" Margin="5"/>
<Button Content="连接" Margin="10,0" Padding="5,2"/>
</StackPanel>
</Border>-->
<!-- 数据显示区域 -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 工位1压力 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="工位1压力" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="TbStation1Pressure" Text="0.0" FontSize="28" FontWeight="Bold" Foreground="#3498DB"/>
<TextBlock Text=" N" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 工位2压力 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Column="1">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="工位2压力" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="TbStation2Pressure" Text="0.0" FontSize="28" FontWeight="Bold" Foreground="#E74C3C"/>
<TextBlock Text=" N" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 摩擦力1 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="1">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="摩擦力1" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="TbFriction1" Text="0.0" FontSize="28" FontWeight="Bold" Foreground="#F39C12"/>
<TextBlock Text=" N" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 摩擦力2 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="1" Grid.Column="1">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="摩擦力2" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="TbFriction2" Text="0.0" FontSize="28" FontWeight="Bold" Foreground="#9B59B6"/>
<TextBlock Text=" N" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 设定次数 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="2">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="设定次数" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="txtcount1" Text="0" FontSize="28" FontWeight="Bold" Foreground="#F39C12"/>
<TextBlock Text=" 次" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 实际次数 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="2" Grid.Column="1">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="实际次数" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="txtcount2" Text="0" FontSize="28" FontWeight="Bold" Foreground="#9B59B6"/>
<TextBlock Text=" 次" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 设定次数 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="3">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="温度1" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="txtT1" Text="0" FontSize="28" FontWeight="Bold" Foreground="#F39C12"/>
<TextBlock Text=" ℃" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 实际次数 -->
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="3" Grid.Column="1">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="温度2" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="txtT2" Text="0" FontSize="28" FontWeight="Bold" Foreground="#9B59B6"/>
<TextBlock Text=" ℃" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
<Border Background="White" Margin="8" BorderThickness="1" BorderBrush="#E0E0E0" CornerRadius="4" Grid.Row="4" Grid.ColumnSpan="2">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
<TextBlock Text="距离" FontSize="14" FontWeight="Bold" Foreground="#333"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock x:Name="txtDistince" Text="0" FontSize="28" FontWeight="Bold" Foreground="#F39C12"/>
<TextBlock Text=" m" FontSize="16" Foreground="#666" Margin="3,5,0,0"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>