增加监控界面
This commit is contained in:
102
CapMachine.Shared/Controls/Meter.xaml
Normal file
102
CapMachine.Shared/Controls/Meter.xaml
Normal file
@@ -0,0 +1,102 @@
|
||||
<UserControl
|
||||
x:Class="CapMachine.Shared.Controls.Meter"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:CapMachine.Shared.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="MeterInstance"
|
||||
d:DesignHeight="160"
|
||||
d:DesignWidth="160"
|
||||
BorderBrush="Gray"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="5*" />
|
||||
<RowDefinition Height="3*" />
|
||||
<RowDefinition Height="2*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Margin="3,3,3,0"
|
||||
Background="#404040"
|
||||
CornerRadius="3" />
|
||||
<StackPanel Margin="3,3,3,0">
|
||||
<DockPanel Margin="5">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Left"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
Text="PV" />
|
||||
<TextBlock
|
||||
Margin="10,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="24"
|
||||
Foreground="White"
|
||||
Text="25.45" />
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Right"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Text="Kg" />
|
||||
</DockPanel>
|
||||
<DockPanel Margin="5,-3,5,0">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Left"
|
||||
FontSize="22"
|
||||
FontStyle="Italic"
|
||||
Foreground="Gold"
|
||||
Text="SV" />
|
||||
<TextBlock
|
||||
Margin="10,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="20"
|
||||
Foreground="Gold"
|
||||
Text="25.45" />
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Right"
|
||||
FontSize="12"
|
||||
Foreground="Gold"
|
||||
Text="Kg" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0,5,0,0">
|
||||
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" ToolTip="手自动" />
|
||||
<TextBlock
|
||||
Margin="0,5,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Foreground="CadetBlue"
|
||||
Text="自动" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="3,3,3,3"
|
||||
Background="Gray"
|
||||
CornerRadius="3">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="20"
|
||||
Foreground="White"
|
||||
Text="吸气温度" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
48
CapMachine.Shared/Controls/Meter.xaml.cs
Normal file
48
CapMachine.Shared/Controls/Meter.xaml.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CapMachine.Shared.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Meter.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Meter : UserControl
|
||||
{
|
||||
public Meter()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仪表名称
|
||||
/// </summary>
|
||||
public string MeterName
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)base.GetValue(MeterConfig.MeterNameProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
base.SetValue(MeterConfig.MeterNameProperty, value);
|
||||
}
|
||||
}
|
||||
public static readonly DependencyProperty MeterNameProperty = DependencyProperty.Register("MeterName", typeof(string), typeof(MeterConfig), new PropertyMetadata("速度"));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user