Files
FT479/WPFWCSDemo/Views/DevicesView.xaml
2026-06-29 14:46:32 +08:00

329 lines
18 KiB
XML

<Page x:Class="WPFWCSDemo.Views.DevicesView"
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:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:WPFWCSDemo.Views"
mc:Ignorable="d"
d:DesignHeight="900" d:DesignWidth="1600"
Title="DevicesView">
<Page.Resources>
<!--堆垛机参数【名称】格式-->
<Style x:Key="txtStackerParaName" TargetType="TextBlock">
<Setter Property="FontSize" Value="20"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="Margin" Value="10,0,0,0"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<!--堆垛机参数【值】格式-->
<Style x:Key="txtStackerParaValue" TargetType="TextBlock">
<Setter Property="FontSize" Value="20"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="DimGray"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<!--堆垛机参数【值】颜色指示-->
<Style x:Key="textStateColor" TargetType="TextBlock" BasedOn="{StaticResource txtStackerParaValue}">
<Style.Triggers>
<!--/////////////////////////////////////////////////////////////////////////////////-->
<!--联机自动-->
<DataTrigger Binding="{Binding ElementName=stackerMode_1, Path=Text}" Value="联机自动">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="LimeGreen" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<!--手动-->
<DataTrigger Binding="{Binding ElementName=stackerMode_1, Path=Text}" Value="手动">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Gold" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<!--半自动-->
<DataTrigger Binding="{Binding ElementName=stackerMode_1, Path=Text}" Value="半自动">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="DarkOrange" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<!--单机自动-->
<DataTrigger Binding="{Binding ElementName=stackerMode_1, Path=Text}" Value="单机自动">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="DarkOrange" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<!--/////////////////////////////////////////////////////////////////////////////////-->
<!--设备状态-->
<DataTrigger Binding="{Binding ElementName=stackerDeviceState_1, Path=Text}" Value="待机">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="DimGray" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=stackerDeviceState_1, Path=Text}" Value="运行">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="LimeGreen" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=stackerDeviceState_1, Path=Text}" Value="报警">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Red" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<!--/////////////////////////////////////////////////////////////////////////////////-->
<!--允许下发-->
<DataTrigger Binding="{Binding ElementName=stackerPermission_1, Path=Text}" Value="允许下发">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Black" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=stackerPermission_1, Path=Text}" Value="禁止下发">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Red" Opacity=".5"/>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<!--设备看板背景-->
<Style x:Key="deviceBackGround" TargetType="Border">
<Setter Property="Background" Value="GhostWhite"/>
<Setter Property="CornerRadius" Value="15"/>
<Setter Property="Margin" Value="30,20,30,30"/>
<Setter Property="Padding" Value="30,20,30,10"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="5" BlurRadius="15" Opacity=".8"/>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<!--标题-->
<TextBlock Text="设备状态" Style="{StaticResource screenTitle}"/>
<!--执行中首条任务-->
<GroupBox Grid.Row="1" Margin="30,10" md:ElevationAssist.Elevation="Dp0" Header="任务状态" Style="{StaticResource MaterialDesignGroupBox}">
<TextBlock Margin="6" Text="888" TextWrapping="Wrap" />
</GroupBox>
<!--输送口-->
<ItemsControl Grid.Row="2" ItemsSource="{Binding TaskBars}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="4"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<!--顶部面板x4-->
<Border Background="{Binding Color}" Margin="10" CornerRadius="5">
<!--鼠标悬停阴影-->
<Border.Style>
<Style TargetType="Border">
<Style.Triggers >
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect Color="Gray" ShadowDepth="1" BlurRadius="10"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<!--面板信息-->
<StackPanel>
<md:PackIcon Kind="{Binding Icon}" Foreground="White" Width="30" Height="30" Margin="20 10 10 10"/>
<TextBlock Text="{Binding Title}" FontSize="25" Foreground="White" FontWeight="Bold" FontFamily="微软雅黑" Margin="20 0 10 10"/>
<TextBlock Text="{Binding Content}" FontSize="30" Foreground="White" FontWeight="Bold" FontFamily="微软雅黑" Margin="20 0 10 10"/>
</StackPanel>
<!--图案绘制 ClipToBounds="True"===超出部分裁剪掉-->
<Canvas ClipToBounds="True">
<Border Canvas.Top="20" Canvas.Right="-50" Width="120" Height="120" Background="#FFFFFF" Opacity="0.2" CornerRadius="100"/>
<Border Canvas.Top="80" Canvas.Right="-30" Width="120" Height="120" Background="#FFFFFF" Opacity="0.2" CornerRadius="100"/>
</Canvas>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--设备面板-->
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--堆垛机-->
<Border Style="{StaticResource deviceBackGround}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock x:Name="stackerMode_1" Grid.Row="0" Grid.Column="0" Text="操作模式 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock x:Name="stackerDeviceState_1" Grid.Row="1" Grid.Column="0" Text="设备状态 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="执行阶段 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="3" Grid.Column="0" Text="货叉状态 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="0" Grid.Column="2" Text="任务号 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="0" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock x:Name="stackerPermission_1" Text="允许下发 :" Grid.Row="1" Grid.Column="2" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="1" Grid.Column="3" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock Grid.Row="2" Grid.Column="2" Text="当前位置 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="2" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="3" Grid.Column="2" Text="目标位置 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="3" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
</Grid>
</Border>
<!--堆垛机2-->
<Border Grid.Row="1" Style="{StaticResource deviceBackGround}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock x:Name="stackerMode_2" Grid.Row="0" Grid.Column="0" Text="操作模式 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock x:Name="stackerDeviceState_2" Grid.Row="1" Grid.Column="0" Text="设备状态 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="执行阶段 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="3" Grid.Column="0" Text="货叉状态 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="0" Grid.Column="2" Text="任务号 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="0" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock x:Name="stackerPermission_2" Text="允许下发 :" Grid.Row="1" Grid.Column="2" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="1" Grid.Column="3" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock Grid.Row="2" Grid.Column="2" Text="当前位置 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="2" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="3" Grid.Column="2" Text="目标位置 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="3" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
</Grid>
</Border>
<!--提升机-->
<Border Grid.Column="1" Style="{StaticResource deviceBackGround}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock x:Name="lFTMode_1" Grid.Row="0" Grid.Column="0" Text="操作模式 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock x:Name="lFTDeviceState_1" Grid.Row="1" Grid.Column="0" Text="设备状态 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="执行阶段 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="3" Grid.Column="0" Text="载货台状态 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="0" Grid.Column="2" Text="任务号 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="0" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock x:Name="lFTPermission_1" Text="允许下发 :" Grid.Row="1" Grid.Column="2" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="1" Grid.Column="3" Text="{Binding .}" Style="{StaticResource textStateColor}"/>
<TextBlock Grid.Row="2" Grid.Column="2" Text="当前层 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="2" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
<TextBlock Grid.Row="3" Grid.Column="2" Text="目标层 :" Style="{StaticResource txtStackerParaName}"/>
<TextBlock Grid.Row="3" Grid.Column="3" Text="{Binding .}" Style="{StaticResource txtStackerParaValue}"/>
</Grid>
</Border>
<!--RGV-->
<Border Grid.Row="1" Grid.Column="1" Style="{StaticResource deviceBackGround}">
</Border>
</Grid>
</Grid>
</Page>