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

69 lines
3.6 KiB
XML

<UserControl x:Class="PLCDataMonitor.CurvePage"
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="800" d:DesignWidth="1200"
FontFamily="Microsoft YaHei"
Loaded="UserControl_Loaded"
Unloaded="UserControl_Unloaded">
<Grid>
<!-- 主网格布局 -->
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 标题 -->
<TextBlock Text="实时摩擦力曲线" FontSize="24" FontWeight="Bold"
Foreground="#2C3E50" Margin="20,20,20,10" Grid.Row="0"/>
<!-- 控制面板 -->
<!--<Border Background="White" Margin="20,0,20,10" Padding="15" Grid.Row="1"
BorderBrush="#DDD" BorderThickness="1" CornerRadius="5">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="时间范围:" FontSize="14" Foreground="#2C3E50"
VerticalAlignment="Center" Margin="0,0,10,0"/>
<ComboBox x:Name="TimeRangeComboBox" Width="150" Height="30" FontSize="12" Margin="0,0,20,0"
BorderBrush="#BDC3C7" BorderThickness="1" SelectionChanged="TimeRangeComboBox_SelectionChanged">
<ComboBoxItem Content="最近1分钟" Tag="60" IsSelected="True"/>
<ComboBoxItem Content="最近5分钟" Tag="300"/>
<ComboBoxItem Content="最近30分钟" Tag="1800"/>
</ComboBox>
<Button Content="清空曲线" Width="90" Height="30" FontSize="12"
Background="#E74C3C" Foreground="White" BorderThickness="0"
Margin="0,0,20,0" Click="ClearCurveButton_Click"/>
</StackPanel>
</Border>-->
<!-- 曲线显示区域 -->
<Border Background="#F9F9F9" Margin="20" Grid.Row="2"
BorderBrush="#DDD" BorderThickness="1" CornerRadius="5">
<Grid>
<Canvas x:Name="CurveCanvas" Background="Transparent">
<!-- 曲线 -->
<Polyline x:Name="Friction1Polyline" Stroke="#3498DB" StrokeThickness="3" StrokeLineJoin="Round"/>
<Polyline x:Name="Friction2Polyline" Stroke="#9B59B6" StrokeThickness="3" StrokeLineJoin="Round"/>
</Canvas>
</Grid>
</Border>
<!-- 图例 -->
<Border Background="White" Padding="10" CornerRadius="5" BorderThickness="1" BorderBrush="#DDD"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="40,130,0,0" Grid.Row="2">
<StackPanel Orientation="Horizontal" Margin="5">
<Rectangle Width="20" Height="3" Fill="#3498DB" Margin="0,0,5,0" VerticalAlignment="Center"/>
<TextBlock Text="工位1摩擦力" FontSize="12" Foreground="#2C3E50" Margin="0,0,15,0"/>
<Rectangle Width="20" Height="3" Fill="#9B59B6" Margin="0,0,5,0" VerticalAlignment="Center"/>
<TextBlock Text="工位2摩擦力" FontSize="12" Foreground="#2C3E50"/>
</StackPanel>
</Border>
</Grid>
</UserControl>