添加项目文件。
This commit is contained in:
167
WPFWCSDemo/Views/AlarmHistoryView.xaml
Normal file
167
WPFWCSDemo/Views/AlarmHistoryView.xaml
Normal file
@@ -0,0 +1,167 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.AlarmHistoryView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:AlarmHistoryViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="900" d:DesignWidth="1600"
|
||||
Title="AlarmHistoryView">
|
||||
|
||||
<Page.Resources>
|
||||
<Style x:Key="pageText" TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignTextBlock}">
|
||||
<Setter Property="Foreground" Value="DimGray"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Margin" Value="50 0"/>
|
||||
</Style>
|
||||
<Style x:Key="pageButton" TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
|
||||
<Setter Property="Background" Value="GhostWhite"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Width" Value="50"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="BlueViolet"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="pageButtonSelectedColor" TargetType="Button" BasedOn="{StaticResource pageButton}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="Background" Value="BlueViolet"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>-->
|
||||
<!--标题-->
|
||||
<TextBlock Text="历史记录 - 报警" FontSize="30" FontWeight="Bold" Margin="10,5"/>
|
||||
|
||||
<!--上方搜索区域-->
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--日期-->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="40 10 0 0">
|
||||
<!--开始时间-->
|
||||
<DatePicker Text="{Binding DateStart,Mode=TwoWay}" Width="150" md:HintAssist.Hint="Pick StartDate" Style="{StaticResource MaterialDesignOutlinedDatePicker}" Margin="10,0"/>
|
||||
<md:TimePicker Text="{Binding TimeStart,Mode=TwoWay}" Width="150" md:HintAssist.Hint="Pick StartTime" Is24Hours="True" Style="{StaticResource MaterialDesignOutlinedTimePicker}"/>
|
||||
<!--结束时间-->
|
||||
<DatePicker Text="{Binding DateEnd,Mode=TwoWay}" Width="150" md:HintAssist.Hint="Pick EndDate" Style="{StaticResource MaterialDesignOutlinedDatePicker}" Margin="50,0,10,0"/>
|
||||
<md:TimePicker Text="{Binding TimeEnd,Mode=TwoWay}" Width="150" md:HintAssist.Hint="Pick EndTime" Is24Hours="True" Style="{StaticResource MaterialDesignOutlinedTimePicker}"/>
|
||||
</StackPanel>
|
||||
<!--搜索-->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<ComboBox Text="{Binding ColumnName}" SelectedItem="{Binding ColumnName,Mode=TwoWay}" VerticalAlignment="Bottom" IsReadOnly="True" ItemsSource="{Binding ColumnList}" md:HintAssist.Hint="请选择字段" Style="{StaticResource MaterialDesignOutlinedComboBox}" Width="150" Margin="10,0"/>
|
||||
<TextBox Text="{Binding Keywords,Mode=TwoWay}" Width="150" VerticalAlignment="Bottom" Style="{StaticResource MaterialDesignOutlinedTextBox}" md:HintAssist.Hint="输入关键词"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Column="2" Margin="10 0 50 0" HorizontalAlignment="Right">
|
||||
<Button Width="150" Height="50" Content="查询" Command="{Binding QueryCommand}" CommandParameter="1" Margin="20,0"/>
|
||||
<Button Width="150" Height="50" Content="重置" Command="{Binding ClearCommand}" Background="White" Foreground="BlueViolet" DockPanel.Dock="Right"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
|
||||
<!--表格区域-->
|
||||
<Grid Grid.Row="2" Margin="50,20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid GridLinesVisibility="None" AlternatingRowBackground="Lavender" ItemsSource="{Binding AlarmHistory}" x:Name="taskHistoryDataGrid" RowHeight="50" ColumnHeaderStyle="{StaticResource MaterialDesignRaisedButton}" AutoGenerateColumns="False" ColumnHeaderHeight="50" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="FullRow" >
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<!--<Setter Property="BorderThickness" Value="0"/>-->
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="名称" Binding="{Binding Point_Id}" Width="2*"/>
|
||||
<DataGridTextColumn Header="报警信息" Binding="{Binding Description}" Width="6*"/>
|
||||
<DataGridTextColumn Header="优先级" Binding="{Binding Priority}" Width="auto"/>
|
||||
<DataGridTextColumn Header="设备类别" Binding="{Binding Device_Id}" Width="auto"/>
|
||||
<DataGridTextColumn Header="开始时间" Binding="{Binding Gen_Time, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="3*"/>
|
||||
<!--<DataGridTextColumn Header="复位时间" Binding="{Binding Reset_Time}" Width="190"/>
|
||||
<DataGridTextColumn Header="删除时间" Binding="{Binding Delete_Time}" Width="190"/>-->
|
||||
<DataGridTextColumn Header="结束时间" Binding="{Binding End_Time, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="3*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="1" Height="50" Background="AntiqueWhite">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--每页条数-->
|
||||
<StackPanel Margin="20 0" Orientation="Horizontal">
|
||||
<!--总条数-->
|
||||
<TextBlock Text="{Binding DataCount}" Style="{StaticResource pageText}" Margin="50 0 20 0"/>
|
||||
<TextBlock Text="每页 10 " Style="{StaticResource pageText}" Margin="0"/>
|
||||
<TextBlock Text="条" Style="{StaticResource pageText}" Margin="0"/>
|
||||
</StackPanel>
|
||||
<!--页码选择-->
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Margin="20 0">
|
||||
<Button Content="首页" Style="{StaticResource pageButton}" Command="{Binding PageFirstCommand}"/>
|
||||
<Button Content="上一页" Width="70" Style="{StaticResource pageButton}" Command="{Binding PageBeforeCommand}" CommandParameter="{Binding PageSelected}"/>
|
||||
<!--<ItemsControl ItemsSource="{Binding Pages}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="{Binding PageCount}"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="btnPage" Content="{Binding}" Style="{StaticResource pageButtonSelectedColor}" Command="{Binding PageClickCommand}" CommandParameter="{Binding ElementName=btnPage, Path=Content}"/>
|
||||
<Button x:Name="btnPage" Content="{Binding}" Style="{StaticResource pageButtonSelectedColor}" Command="{Binding DataContext.PageClickCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding ElementName=btnPage,Path=Content}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>-->
|
||||
<Button Content="下一页" Width="70" Style="{StaticResource pageButton}" Command="{Binding PageNextCommand}" CommandParameter="{Binding PageSelected}"/>
|
||||
<Button Content="尾页" Style="{StaticResource pageButton}" Command="{Binding PageLastCommand}"/>
|
||||
</StackPanel>
|
||||
<!--页码跳转-->
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right" Margin="50 0">
|
||||
<!--当前页数-->
|
||||
<TextBlock Text="{Binding PageInfo}" Style="{StaticResource pageText}" Margin="40 0"/>
|
||||
<Button Content="前往" Command="{Binding JumpPageClickCommand}" CommandParameter="{Binding ElementName=txtPageInput, Path=Text}"/>
|
||||
<TextBox x:Name="txtPageInput" Text="{Binding PageInput}" Width="30" HorizontalContentAlignment="Center" Style="{StaticResource MaterialDesignTextBox}" VerticalAlignment="Center" Margin="5 0"/>
|
||||
<TextBlock Text="页" Style="{StaticResource pageText}" Margin="0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/AlarmHistoryView.xaml.cs
Normal file
29
WPFWCSDemo/Views/AlarmHistoryView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// AlarmHistoryView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AlarmHistoryView : Page
|
||||
{
|
||||
public AlarmHistoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.AlarmHistoryViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
72
WPFWCSDemo/Views/AlarmView.xaml
Normal file
72
WPFWCSDemo/Views/AlarmView.xaml
Normal file
@@ -0,0 +1,72 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.AlarmView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="720" d:DesignWidth="1280"
|
||||
Title="AlarmView">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--标题-->
|
||||
<TextBlock Text="实时报警" FontSize="30" FontWeight="Bold" Margin="10,5"/>
|
||||
|
||||
<!--上方搜索区域-->
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="50,10,0,0" HorizontalAlignment="Right">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="50 0">
|
||||
<ListBox SelectedIndex="{Binding AlarmLevelSelectedIndex}" Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" Visibility="Hidden" VerticalAlignment="Center" Margin="0,0,20,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding AlarmLevelSelectItemChangedCommand}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<ListBoxItem Content=" HIGH "/>
|
||||
<ListBoxItem Content=" MEDIUM "/>
|
||||
<ListBoxItem Content=" LOW "/>
|
||||
<!--<ListBoxItem Content=" 默认 "/>-->
|
||||
</ListBox>
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Column="1" Margin="00 0 50 0" HorizontalAlignment="Right">
|
||||
<TextBox Text="{Binding Keywords,Mode=TwoWay}" Width="200" Height="42" Style="{StaticResource MaterialDesignFloatingHintTextBox}" md:HintAssist.Hint="输入关键词"/>
|
||||
<Button Width="150" Height="36" Content="查询" Command="{Binding QueryCommand}" Margin="20,0"/>
|
||||
<Button Width="150" Height="36" Content="重置" Command="{Binding ClearCommand}" Background="White" Foreground="BlueViolet" DockPanel.Dock="Right" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--表格区域-->
|
||||
<DataGrid Grid.Row="2" GridLinesVisibility="None" FontSize="16" Foreground="Red" Background="Black" ItemsSource="{Binding Alarm}" Margin="50,20" x:Name="taskDataGrid" RowHeight="35" ColumnHeaderStyle="{StaticResource MaterialDesignRaisedButton}" AutoGenerateColumns="False" ColumnHeaderHeight="50" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="Cell" >
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<!--<Setter Property="BorderThickness" Value="0"/>-->
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="名称" Binding="{Binding Point_Id}" Width="2*"/>
|
||||
<DataGridTextColumn Header="报警信息" Binding="{Binding Description}" Width="4.5*"/>
|
||||
<DataGridTextColumn Header="优先级" Binding="{Binding Priority}" Width="120"/>
|
||||
<DataGridTextColumn Header="类别" Binding="{Binding Device_Id}" Width="100"/>
|
||||
<DataGridTextColumn Header="开始时间" Binding="{Binding Gen_Time, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2.5*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Page>
|
||||
30
WPFWCSDemo/Views/AlarmView.xaml.cs
Normal file
30
WPFWCSDemo/Views/AlarmView.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// AlarmView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AlarmView : Page
|
||||
{
|
||||
public AlarmView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new AlarmViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
WPFWCSDemo/Views/BlankView.xaml
Normal file
14
WPFWCSDemo/Views/BlankView.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.BlankView"
|
||||
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:WPFWCSDemo.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="720" d:DesignWidth="1280"
|
||||
Title="BlankView">
|
||||
|
||||
<Grid>
|
||||
<TextBlock Text="链接错误,无法获取数据" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
28
WPFWCSDemo/Views/BlankView.xaml.cs
Normal file
28
WPFWCSDemo/Views/BlankView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// BlankView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BlankView : Page
|
||||
{
|
||||
public BlankView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
266
WPFWCSDemo/Views/CircleRGVsView.xaml
Normal file
266
WPFWCSDemo/Views/CircleRGVsView.xaml
Normal file
@@ -0,0 +1,266 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.Devices.CircleRGVsView"
|
||||
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.Devices"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:CircleRGVsViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="800" d:DesignWidth="1600"
|
||||
Title="CircleRGVsView">
|
||||
|
||||
<Page.Resources>
|
||||
<Style x:Key="StateTitle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="FontFamily" Value="黑体"/>
|
||||
<Setter Property="Foreground" Value="DimGray"/>
|
||||
<Setter Property="Margin" Value="5 10"/>
|
||||
<!--<Setter Property="FontStyle" Value="Italic"/>-->
|
||||
</Style>
|
||||
<Style x:Key="StateValue" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="FontFamily" Value="黑体"/>
|
||||
<Setter Property="Margin" Value="5 10"/>
|
||||
<!--<Setter Property="FontStyle" Value="Italic"/>-->
|
||||
</Style>
|
||||
<!--【执行阶段-运行状态】样式-->
|
||||
<Style x:Key="StatePhase" TargetType="TextBlock" BasedOn="{StaticResource StateValue}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=tbPhase,Path=Tag}" Value="5">
|
||||
<Setter Property="Foreground" Value="DarkGreen"/>
|
||||
<Setter Property="Text" Value="执行完成"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbPhase,Path=Tag}" Value="4">
|
||||
<Setter Property="Foreground" Value="LimeGreen"/>
|
||||
<Setter Property="Text" Value="放货中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbPhase,Path=Tag}" Value="3">
|
||||
<Setter Property="Foreground" Value="LimeGreen"/>
|
||||
<Setter Property="Text" Value="放货途中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbPhase,Path=Tag}" Value="2">
|
||||
<Setter Property="Foreground" Value="LimeGreen"/>
|
||||
<Setter Property="Text" Value="取货中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbPhase,Path=Tag}" Value="1">
|
||||
<Setter Property="Foreground" Value="LimeGreen"/>
|
||||
<Setter Property="Text" Value="取货途中"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--【设备状态】样式-->
|
||||
<Style x:Key="StateDeviceState" TargetType="TextBlock" BasedOn="{StaticResource StateValue}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="0">
|
||||
<Setter Property="Foreground" Value="Gray"/>
|
||||
<Setter Property="Text" Value="未知"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="1">
|
||||
<Setter Property="Foreground" Value="LimeGreen"/>
|
||||
<Setter Property="Text" Value="运行中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="2">
|
||||
<Setter Property="Foreground" Value="DarkOrange"/>
|
||||
<Setter Property="Text" Value="手动"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="3">
|
||||
<Setter Property="Foreground" Value="OliveDrab"/>
|
||||
<Setter Property="Text" Value="待机"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="100">
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
<Setter Property="Text" Value="报警"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--【任务类型】样式-->
|
||||
<Style x:Key="StateTaskType" TargetType="TextBlock" BasedOn="{StaticResource StateValue}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskType,Path=Tag}" Value="0">
|
||||
<Setter Property="Foreground" Value="Gray"/>
|
||||
<Setter Property="Text" Value="未知"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskType,Path=Tag}" Value="1">
|
||||
<Setter Property="Foreground" Value="Green"/>
|
||||
<Setter Property="Text" Value="常规任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskType,Path=Tag}" Value="10">
|
||||
<Setter Property="Foreground" Value="Green"/>
|
||||
<Setter Property="Text" Value="实垛任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskType,Path=Tag}" Value="11">
|
||||
<Setter Property="Foreground" Value="Green"/>
|
||||
<Setter Property="Text" Value="空托任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskType,Path=Tag}" Value="2">
|
||||
<Setter Property="Foreground" Value="DarkOrange"/>
|
||||
<Setter Property="Text" Value="进休息区"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskType,Path=Tag}" Value="3">
|
||||
<Setter Property="Foreground" Value="DarkOrange"/>
|
||||
<Setter Property="Text" Value="返回轨道"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--【任务类型】样式-->
|
||||
<Style x:Key="StateMode" TargetType="TextBlock" BasedOn="{StaticResource StateValue}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=tbMode,Path=Tag}" Value="0">
|
||||
<Setter Property="Foreground" Value="Gray"/>
|
||||
<Setter Property="Text" Value="未知"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbMode,Path=Tag}" Value="1">
|
||||
<Setter Property="Foreground" Value="Green"/>
|
||||
<Setter Property="Text" Value="常规任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbMode,Path=Tag}" Value="2">
|
||||
<Setter Property="Foreground" Value="DarkOrange"/>
|
||||
<Setter Property="Text" Value="进休息区"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--【任务号】样式-->
|
||||
<Style x:Key="StateTaskNumber" TargetType="TextBlock" BasedOn="{StaticResource StateValue}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=tbTaskNumber,Path=Text}" Value="0">
|
||||
<Setter Property="Visibility" Value="Hidden"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--背景图-->
|
||||
<Image Grid.RowSpan="2" Source="\Resources\background.jpg" Panel.ZIndex="0" Opacity=".8" Stretch="Fill">
|
||||
<Image.Effect>
|
||||
<BlurEffect Radius="40"/>
|
||||
</Image.Effect>
|
||||
|
||||
</Image>
|
||||
|
||||
<TextBlock Text="环穿状态" Style="{StaticResource screenTitle}"/>
|
||||
<ItemsControl Grid.Row="1" HorizontalAlignment="Center" ItemsSource="{Binding CircleRGVStates}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Rows="2"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Width="200" Height="300" CornerRadius="5" Margin="10 0">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Style.Setters>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Color="Gray" ShadowDepth="10" BlurRadius="10"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style.Setters>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Color="Gray" BlurRadius="20" ShadowDepth="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="0">
|
||||
<Setter Property="Background" Value="LightGray"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="1">
|
||||
<Setter Property="Background" Value="LightCyan"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="2">
|
||||
<Setter Property="Background" Value="LightSalmon"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbDeviceState,Path=Tag}" Value="3">
|
||||
<Setter Property="Background" Value="Lavender"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid Margin="5">
|
||||
<!--设备面板背景-->
|
||||
<Canvas Grid.RowSpan="2" ClipToBounds="True">
|
||||
<Border Canvas.Top="140" Canvas.Right="-50" Width="120" Height="120" Background="#FFFFFF" Opacity="0.3" CornerRadius="100"/>
|
||||
<Border Canvas.Top="200" Canvas.Right="-20" Width="150" Height="150" Background="#FFFFFF" Opacity="0.4" CornerRadius="100"/>
|
||||
<Border Canvas.Top="-30" Canvas.Right="120" Width="100" Height="100" Background="#FFFFFF" Opacity="0.2" CornerRadius="100"/>
|
||||
</Canvas>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding Title}" FontSize="22" FontWeight="Bold" Foreground="Black" Margin="5"/>
|
||||
|
||||
<Grid Grid.Row="1" Margin="10 5 10 0">
|
||||
<Grid.RowDefinitions>
|
||||
<!--<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>-->
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<!--<ColumnDefinition/>
|
||||
<ColumnDefinition/>-->
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--属性-->
|
||||
<StackPanel>
|
||||
<TextBlock Text=" 任务号:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="运行状态:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="设备状态:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="操作模式:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="取货站点:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="目标站点:" Style="{StaticResource StateTitle}"/>
|
||||
</StackPanel>
|
||||
<!--显示的值-->
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock x:Name="tbTaskNumber" Text="{Binding Read_TaskNumber}" Style="{StaticResource StateValue}"/>
|
||||
<TextBlock x:Name="tbPhase" Tag="{Binding Read_Phase}" Style="{StaticResource StatePhase}"/>
|
||||
<TextBlock x:Name="tbDeviceState" Tag="{Binding Read_DeviceState}" Style="{StaticResource StateDeviceState}"/>
|
||||
<TextBlock x:Name="tbMode" Tag="{Binding Read_Mode}" Style="{StaticResource StateMode}"/>
|
||||
<TextBlock x:Name="tbSourceLocation" Text="{Binding Read_SourceLocation}" Style="{StaticResource StateValue}"/>
|
||||
<TextBlock x:Name="tbTargetLocation" Text="{Binding Read_TargetLocation}" Style="{StaticResource StateValue}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--属性-->
|
||||
<!--<StackPanel Grid.Row="1" Grid.Column="0">
|
||||
<TextBlock Text="操作模式:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="取货站点:" Style="{StaticResource StateTitle}"/>
|
||||
<TextBlock Text="目标站点:" Style="{StaticResource StateTitle}"/>
|
||||
</StackPanel>-->
|
||||
<!--显示的值-->
|
||||
<!--<StackPanel Grid.Row="1" Grid.Column="1">
|
||||
<TextBlock x:Name="tbMode" Tag="{Binding Read_Mode}" Style="{StaticResource StateMode}"/>
|
||||
<TextBlock x:Name="tbSourceLocation" Text="{Binding Read_SourceLocation}" Style="{StaticResource StateValue}"/>
|
||||
<TextBlock x:Name="tbTargetLocation" Text="{Binding Read_TargetLocation}" Style="{StaticResource StateValue}"/>
|
||||
</StackPanel>-->
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Page>
|
||||
30
WPFWCSDemo/Views/CircleRGVsView.xaml.cs
Normal file
30
WPFWCSDemo/Views/CircleRGVsView.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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 WPFWCSDemo.Views.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// CircleRGVsView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class CircleRGVsView : Page
|
||||
{
|
||||
public CircleRGVsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = ViewModels.CircleRGVsViewModel.Instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
203
WPFWCSDemo/Views/ControllerView.xaml
Normal file
203
WPFWCSDemo/Views/ControllerView.xaml
Normal file
@@ -0,0 +1,203 @@
|
||||
<Window x:Class="WPFWCSDemo.Views.ControllerView"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
xmlns:vm="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ControllerViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="ControllerView" Height="450" Width="800"
|
||||
x:Name="DeviceController">
|
||||
|
||||
<Window.Resources>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
|
||||
<Setter Property="Width" Value="110"/>
|
||||
<Setter Property="Margin" Value="10 0"/>
|
||||
</Style>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignBody1TextBlock}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
</Style>
|
||||
<Style TargetType="StackPanel" >
|
||||
<Setter Property="Orientation" Value="Horizontal"/>
|
||||
</Style>
|
||||
<Style TargetType="TextBox" BasedOn="{StaticResource MaterialDesignTextBoxBase}">
|
||||
<Setter Property="Width" Value="50"/>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height=".9*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="平台入口"/>
|
||||
<StackPanel>
|
||||
<Button Content="平台出库请求" Command="{Binding ConvPort2StockOutRequestCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort2StockOutRequest}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="2层入库请求" Command="{Binding ConvPort2StockInRequestCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort2StockInRequest}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="空闲" Command="{Binding ConvPort2FreeCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort2Free}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="自动" Command="{Binding ConvPort2ModeCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort2Mode}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="任务号" Command="{Binding ConvPort2TaskNumberCommand}"/>
|
||||
<TextBox Text="{Binding StrConvPort2TaskNumber}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="到位" Command="{Binding ConvPort2InPositionCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort2InPosition}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||
<TextBlock Text="1层入口"/>
|
||||
<StackPanel>
|
||||
<Button Content="1层出库请求" Command="{Binding ConvPort1StockOutRequestCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort1StockOutRequest}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="1层入库请求" Command="{Binding ConvPort1StockInRequestCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort1StockInRequest}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="空闲" Command="{Binding ConvPort1FreeCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort1Free}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="自动" Command="{Binding ConvPort1ModeCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort1Mode}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="任务号" Command="{Binding ConvPort1TaskNumberCommand}"/>
|
||||
<TextBox Text="{Binding StrConvPort1TaskNumber}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="到位" Command="{Binding ConvPort1InPositionCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvPort1InPosition}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--提升机-->
|
||||
<StackPanel Grid.Column="2" Orientation="Vertical">
|
||||
<TextBlock Text="提升机"/>
|
||||
<StackPanel>
|
||||
<Button Content="允许下发" Command="{Binding LFTPermissionCommand}"/>
|
||||
<TextBlock Text="{Binding StrLFTPermission}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="模式" Command="{Binding LFTModeCommand}"/>
|
||||
<TextBlock Text="{Binding StrLFTMode}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="设备状态" Command="{Binding LFTStateCommand}"/>
|
||||
<TextBlock Text="{Binding StrLFTState}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="载货状态" Command="{Binding LFTLoadCommand}"/>
|
||||
<TextBlock Text="{Binding StrLFTLoad}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="阶段" Command="{Binding LFTPhaseCommand}"/>
|
||||
<TextBlock Text="{Binding StrLFTPhase}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="任务号" Command="{Binding LFTTaskNumberCommand}"/>
|
||||
<TextBox Text="{Binding StrLFTTaskNumber}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--RGV-->
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical">
|
||||
<TextBlock Text="RGV"/>
|
||||
<StackPanel>
|
||||
<Button Content="允许下发" Command="{Binding RGVPermissionCommand}"/>
|
||||
<TextBlock Text="{Binding StrRGVPermission}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="状态" Command="{Binding RGVStateCommand}"/>
|
||||
<TextBlock Text="{Binding StrRGVState}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="载货状态" Command="{Binding RGVLoadCommand}"/>
|
||||
<TextBlock Text="{Binding StrRGVLoad}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="阶段" Command="{Binding RGVPhaseCommand}"/>
|
||||
<TextBlock Text="{Binding StrRGVPhase}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="任务号" Command="{Binding RGVTaskNumberCommand}"/>
|
||||
<TextBox Text="{Binding StrRGVTaskNumber}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--巷道口输送机-->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical">
|
||||
<TextBlock Text="巷道口输送机"/>
|
||||
<StackPanel>
|
||||
<Button Content="空闲" Command="{Binding ConvRoad1FreeCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvRoad1Free}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="到位" Command="{Binding ConvRoad1InPositionCommand}"/>
|
||||
<TextBlock Text="{Binding StrConvRoad1InPosition}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="任务号" Command="{Binding ConvRoad1TaskNumberCommand}"/>
|
||||
<TextBox Text="{Binding StrConvRoad1TaskNumber}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--堆垛机-->
|
||||
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical">
|
||||
<TextBlock Text="堆垛机"/>
|
||||
<StackPanel>
|
||||
<Button Content="允许下发" Command="{Binding StackerPermissionCommand}"/>
|
||||
<TextBlock Text="{Binding StrStackerPermission}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="自动/待机/无货" Command="{Binding StackerStateCommand}"/>
|
||||
<TextBlock Text="{Binding StrStackerState}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="阶段" Command="{Binding StackerPhaseCommand}"/>
|
||||
<TextBlock Text="{Binding StrStackerPhase}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="任务号" Command="{Binding StackerTaskNumberCommand}"/>
|
||||
<TextBox Text="{Binding StrStackerTaskNumber}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!--异常-->
|
||||
<StackPanel Grid.Row="1" Grid.Column="3" Orientation="Vertical">
|
||||
<TextBlock Text="异常处理"/>
|
||||
<StackPanel>
|
||||
<Button Content="入库有货"/>
|
||||
<TextBlock Text=""/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="出库无货"/>
|
||||
<TextBlock Text=""/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="重置"/>
|
||||
</StackPanel>
|
||||
<Button Content="Quit" Command="{Binding QuitCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
28
WPFWCSDemo/Views/ControllerView.xaml.cs
Normal file
28
WPFWCSDemo/Views/ControllerView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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.Shapes;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// ControllerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ControllerView : Window
|
||||
{
|
||||
public ControllerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
//DataContext=new ViewModels.ControllerViewModel(DeviceController);
|
||||
}
|
||||
}
|
||||
}
|
||||
47
WPFWCSDemo/Views/CustomComponent/InputDialog.xaml
Normal file
47
WPFWCSDemo/Views/CustomComponent/InputDialog.xaml
Normal file
@@ -0,0 +1,47 @@
|
||||
<Window x:Class="WPFWCSDemo.Views.CustomComponent.InputDialog"
|
||||
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.ViewModels.CustomComponent"
|
||||
d:DataContext="{d:DesignInstance Type=local:InputDialogViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="270"
|
||||
MaxHeight="200"
|
||||
MaxWidth="300"
|
||||
AllowsTransparency="True"
|
||||
Topmost="True"
|
||||
WindowState="Normal"
|
||||
WindowStyle="None"
|
||||
BorderBrush="BlueViolet"
|
||||
BorderThickness="3"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Background="GhostWhite"
|
||||
x:Name="inputWindow">
|
||||
|
||||
<Window.Effect>
|
||||
<DropShadowEffect BlurRadius="20" ShadowDepth="15" Direction="225" Opacity="0.7"/>
|
||||
</Window.Effect>
|
||||
|
||||
<DockPanel>
|
||||
<md:ColorZone x:Name="colorZone" CornerRadius="0" Padding="0" Height="30" md:ElevationAssist.Elevation="Dp4" DockPanel.Dock="Top" Mode="PrimaryMid">
|
||||
<TextBlock Text="{Binding Caption}" VerticalAlignment="Center" Margin="20 0"/>
|
||||
</md:ColorZone>
|
||||
<md:ColorZone Height="6" CornerRadius="0"/>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock TextWrapping="Wrap" Text="请输入密码:" VerticalAlignment="Center" LineHeight="20" Padding="20 20 30 0"/>
|
||||
<TextBox Grid.Row="1" Text="{Binding Content}" VerticalContentAlignment="Bottom" VerticalAlignment="Center" Width="200" />
|
||||
<DockPanel Grid.Row="2" LastChildFill="False" Margin="20,10,20,0">
|
||||
<Button Content="确认" Background="Lavender" Width="100" IsDefault="True" Style="{StaticResource MaterialDesignFlatButton}" Command="{Binding AcceptCommand}"/>
|
||||
<Button Content="取消" Background="Lavender" Width="100" Style="{StaticResource MaterialDesignFlatButton}" DockPanel.Dock="Right" Command="{Binding CancelCommand}" CommandParameter="{Binding InputDialog}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
34
WPFWCSDemo/Views/CustomComponent/InputDialog.xaml.cs
Normal file
34
WPFWCSDemo/Views/CustomComponent/InputDialog.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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.Shapes;
|
||||
|
||||
namespace WPFWCSDemo.Views.CustomComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// InputDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class InputDialog : Window
|
||||
{
|
||||
Action<string> action;
|
||||
public InputDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.CustomComponent.InputDialogViewModel(inputWindow,action);
|
||||
|
||||
colorZone.MouseMove += (s, e) =>
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed) DragMove();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
122
WPFWCSDemo/Views/CustomComponent/LineControlDialog.xaml
Normal file
122
WPFWCSDemo/Views/CustomComponent/LineControlDialog.xaml
Normal file
@@ -0,0 +1,122 @@
|
||||
<Window x:Class="WPFWCSDemo.Views.CustomComponent.LineControlDialog"
|
||||
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:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views.CustomComponent"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:LineManagementViewModel}"
|
||||
mc:Ignorable="d"
|
||||
|
||||
AllowsTransparency="True"
|
||||
WindowState="Normal"
|
||||
WindowStyle="None"
|
||||
BorderBrush="#673AB7"
|
||||
BorderThickness="0"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Background="Transparent"
|
||||
Title="LineControlDialog"
|
||||
Height="400"
|
||||
Width="600"
|
||||
x:Name="lineControlWindow">
|
||||
|
||||
<Window.Resources>
|
||||
<Style x:Key="title" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
|
||||
</Style>
|
||||
|
||||
<Style x:Key="button" TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}">
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Width" Value="90"/>
|
||||
<Setter Property="Height" Value="24"/>
|
||||
<!--<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect BlurRadius="5" ShadowDepth="5"/>
|
||||
</Setter.Value>
|
||||
</Setter>-->
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="1">
|
||||
<Setter Property="Background" Value="DarkGreen"/>
|
||||
<Setter Property="Content" Value="正常"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="0">
|
||||
<Setter Property="Background" Value="OrangeRed"/>
|
||||
<Setter Property="Content" Value="禁止"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border Background=" lavender" CornerRadius="10" Margin="10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="Gray" BlurRadius="10" ShadowDepth="5" Direction="-135" Opacity="0.5"/>
|
||||
</Border.Effect>
|
||||
<DockPanel>
|
||||
<md:ColorZone x:Name="colorZone" CornerRadius="0" Padding="0" Height="30" md:ElevationAssist.Elevation="Dp4" DockPanel.Dock="Top" Mode="PrimaryMid">
|
||||
<Grid Margin="5 0">
|
||||
<TextBlock Text="{Binding Caption}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5 0"/>
|
||||
<Button x:Name="btnClose" Background="DarkOrange" Width="20" Height="20" Content="{md:PackIcon Kind=Close, Size=14}" Margin="2" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFloatingActionButton}"/>
|
||||
</Grid>
|
||||
</md:ColorZone>
|
||||
<md:ColorZone Height="6" CornerRadius="0"/>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBox Text="出口控制" HorizontalAlignment="Center" FontSize="22" Style="{StaticResource MaterialDesignDataGridComboBoxEditableTextBox}" Margin="10 5"/>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Rectangle Fill="Gray" Grid.ColumnSpan="4" Height="1.5" Margin="20 0"/>
|
||||
<TextBlock Grid.Row="1" Text="立库1#实垛口1003" Style="{StaticResource title}"/>
|
||||
<TextBlock Grid.Row="2" Text="立库2#实垛口1005" Style="{StaticResource title}"/>
|
||||
<TextBlock Grid.Row="3" Text="G线实垛出口1011" Style="{StaticResource title}"/>
|
||||
<TextBlock Grid.Row="4" Text="H线实垛出口1012" Style="{StaticResource title}"/>
|
||||
|
||||
<Button Grid.Column="1" Grid.Row="1" Tag="{Binding E1009}" Style="{StaticResource button}" Command="{Binding StateChangeCommand}" CommandParameter="1009"/>
|
||||
<Button Grid.Column="1" Grid.Row="2" Tag="{Binding E1010}" Style="{StaticResource button}" Command="{Binding StateChangeCommand}" CommandParameter="1010"/>
|
||||
<Button Grid.Column="1" Grid.Row="3" Tag="{Binding E1011}" Style="{StaticResource button}" Command="{Binding StateChangeCommand}" CommandParameter="1011"/>
|
||||
<Button Grid.Column="1" Grid.Row="4" Tag="{Binding E1012}" Style="{StaticResource button}" Command="{Binding StateChangeCommand}" CommandParameter="1012"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="1" Text="空托出口1002" Style="{StaticResource title}"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2" Text="空托出口1004" Style="{StaticResource title}"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3" Text="空托出口1006" Style="{StaticResource title}"/>
|
||||
|
||||
<Button Grid.Column="3" Grid.Row="1" Tag="{Binding E1002}" Style="{StaticResource button}" Margin="0 0 20 0" Command="{Binding StateChangeCommand}" CommandParameter="1002"/>
|
||||
<Button Grid.Column="3" Grid.Row="2" Tag="{Binding E1004}" Style="{StaticResource button}" Margin="0 0 20 0" Command="{Binding StateChangeCommand}" CommandParameter="1004"/>
|
||||
<Button Grid.Column="3" Grid.Row="3" Tag="{Binding E1006}" Style="{StaticResource button}" Margin="0 0 20 0" Command="{Binding StateChangeCommand}" CommandParameter="1006"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<DockPanel Grid.Row="2" Margin="20,10,20,10">
|
||||
<Button Content="确认" BorderThickness="1" Width="150" IsDefault="True" Command="{Binding AcceptCommand}" CommandParameter="{Binding LineManagementDialog}" HorizontalAlignment="Center"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
37
WPFWCSDemo/Views/CustomComponent/LineControlDialog.xaml.cs
Normal file
37
WPFWCSDemo/Views/CustomComponent/LineControlDialog.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
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.Input;
|
||||
using System.Windows.Shapes;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
|
||||
namespace WPFWCSDemo.Views.CustomComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// LineControlDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LineControlDialog : Window
|
||||
{
|
||||
public LineControlDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new LineManagementViewModel(lineControlWindow);
|
||||
|
||||
colorZone.MouseMove += (s, e) =>
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed) DragMove();
|
||||
};
|
||||
|
||||
btnClose.Click += (s, e) =>
|
||||
{
|
||||
Close();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
46
WPFWCSDemo/Views/CustomComponent/MessageDialog.xaml
Normal file
46
WPFWCSDemo/Views/CustomComponent/MessageDialog.xaml
Normal file
@@ -0,0 +1,46 @@
|
||||
<Window x:Class="WPFWCSDemo.Views.MessageDialog"
|
||||
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.ViewModels.CustomComponent"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="270"
|
||||
MaxHeight="200"
|
||||
MaxWidth="300"
|
||||
AllowsTransparency="True"
|
||||
Topmost="True"
|
||||
WindowState="Normal"
|
||||
WindowStyle="None"
|
||||
BorderBrush="BlueViolet"
|
||||
BorderThickness="3"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Background="GhostWhite"
|
||||
x:Name="messageWindow"
|
||||
>
|
||||
|
||||
<Window.Effect>
|
||||
<DropShadowEffect BlurRadius="20" ShadowDepth="15" Direction="225" Opacity="0.7"/>
|
||||
</Window.Effect>
|
||||
|
||||
<DockPanel>
|
||||
<md:ColorZone x:Name="colorZone" CornerRadius="0" Padding="0" Height="30" md:ElevationAssist.Elevation="Dp4" DockPanel.Dock="Top" Mode="PrimaryMid">
|
||||
<TextBlock Text="{Binding Caption}" VerticalAlignment="Center" Margin="20 0"/>
|
||||
</md:ColorZone>
|
||||
<md:ColorZone Height="6" CornerRadius="0"/>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Content}" Style="{StaticResource MaterialDesignTextBlock}" VerticalAlignment="Center" LineHeight="20" HorizontalAlignment="Center" Padding="30 20 30 0"/>
|
||||
<DockPanel Grid.Row="2" LastChildFill="False" Margin="20,10,20,0">
|
||||
<Button Content="确定" Background="Lavender" Width="100" IsDefault="True" Style="{StaticResource MaterialDesignFlatButton}" Command="{Binding AcceptCommand}"/>
|
||||
<Button Content="取消" Background="Lavender" Width="100" Style="{StaticResource MaterialDesignFlatButton}" DockPanel.Dock="Right" Command="{Binding CancelCommand}" CommandParameter="{Binding MessageDialog}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
</Window>
|
||||
36
WPFWCSDemo/Views/CustomComponent/MessageDialog.xaml.cs
Normal file
36
WPFWCSDemo/Views/CustomComponent/MessageDialog.xaml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
using WPFWCSDemo.Models;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// MessageDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MessageDialog : Window
|
||||
{
|
||||
public MessageDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.CustomComponent.MessageDialogViewModel(messageWindow);
|
||||
|
||||
colorZone.MouseMove += (s, e) =>
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed) DragMove();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
438
WPFWCSDemo/Views/DataInfoView.xaml
Normal file
438
WPFWCSDemo/Views/DataInfoView.xaml
Normal file
@@ -0,0 +1,438 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.DataInfoView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:DataInfoViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="800" d:DesignWidth="1600"
|
||||
Title="DataInfoView">
|
||||
|
||||
<!--页面样式-->
|
||||
<Page.Resources>
|
||||
<!--任务信息参数名称-->
|
||||
<Style x:Key="taskNameStyle" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="Gray"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontFamily" Value="微软雅黑"/>
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<!--任务信息参数值-->
|
||||
<Style x:Key="taskValueStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontFamily" Value="微软雅黑"/>
|
||||
<Setter Property="FontStyle" Value="Italic"/>
|
||||
<Setter Property="Margin" Value="5,10"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<!--任务类型文本颜色区分-->
|
||||
<Style x:Key="taskTypeTextColor" TargetType="TextBlock" BasedOn="{StaticResource taskValueStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="1">
|
||||
<Setter Property="Foreground" Value="DarkGreen"/>
|
||||
<Setter Property="Text" Value="常规任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="10">
|
||||
<Setter Property="Foreground" Value="DarkGreen"/>
|
||||
<Setter Property="Text" Value="实垛任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="11">
|
||||
<Setter Property="Foreground" Value="DarkOrange"/>
|
||||
<Setter Property="Text" Value="空托任务"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="2">
|
||||
<Setter Property="Foreground" Value="Firebrick"/>
|
||||
<Setter Property="Text" Value="进入休息区"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="3">
|
||||
<Setter Property="Foreground" Value="Firebrick"/>
|
||||
<Setter Property="Text" Value="返回轨道"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--执行阶段文本-->
|
||||
<Style x:Key="scheduleStateTextColor" TargetType="TextBlock" BasedOn="{StaticResource taskValueStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="T6-0">
|
||||
<Setter Property="Foreground" Value="DarkGreen"/>
|
||||
<Setter Property="Text" Value="待执行"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="T6-2">
|
||||
<Setter Property="Foreground" Value="ForestGreen"/>
|
||||
<Setter Property="Text" Value="取货途中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="T6-3">
|
||||
<Setter Property="Foreground" Value="ForestGreen"/>
|
||||
<Setter Property="Text" Value="取货中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="T6-4">
|
||||
<Setter Property="Foreground" Value="ForestGreen"/>
|
||||
<Setter Property="Text" Value="放货途中"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="T6-5">
|
||||
<Setter Property="Foreground" Value="ForestGreen"/>
|
||||
<Setter Property="Text" Value="放货中"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--任务类型背景颜色区分-->
|
||||
<Style x:Key="taskTypeBackColor" TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="10"/>
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Style.Triggers>
|
||||
<!--鼠标悬停阴影-->
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect BlurRadius="10" Color="Gray" ShadowDepth="7" Opacity=".2"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<!--常规任务-->
|
||||
<DataTrigger Binding="{Binding ElementName=tbValueTaskType, Path=Tag}" Value="1">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="PaleGreen" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbValueTaskType, Path=Tag}" Value="10">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="PaleGreen" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbValueTaskType, Path=Tag}" Value="11">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Khaki" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--特殊任务-->
|
||||
<DataTrigger Binding="{Binding ElementName=tbValueTaskType, Path=Tag}" Value="2">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="DarkOrange" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=tbValueTaskType, Path=Tag}" Value="3">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Orange" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--显示空时-->
|
||||
<DataTrigger Binding="{Binding ElementName=tbValueTaskType, Path=Text}" Value="">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Gainsboro" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="TaskBorder" TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<!--<EventTrigger>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonDown">
|
||||
<i:InvokeCommandAction Command="{Binding BorderClickCommand}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</EventTrigger>-->
|
||||
<!--鼠标悬停阴影-->
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Color="Gray" ShadowDepth="10" BlurRadius="20"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
|
||||
<Style.Setters>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Color="Gray" ShadowDepth="5" BlurRadius="10"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<!--页面布局-->
|
||||
<!--页面布局-->
|
||||
<!--页面布局-->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="170"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="10"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="数据统计" Style="{StaticResource screenTitle}"/>
|
||||
<ItemsControl x:Name="ic" Grid.Row="1" ItemsSource="{Binding TaskBars}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--顶部面板x4-->
|
||||
<Border Background="{Binding Color}" Margin="10" CornerRadius="5" Style="{StaticResource TaskBorder}">
|
||||
<!--<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonUp">
|
||||
<i:InvokeCommandAction Command="{Binding ElementName=ic,Path=DataContext.BorderClickCommand}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>-->
|
||||
|
||||
<Grid>
|
||||
<!--面板信息-->
|
||||
<StackPanel x:Name="sp">
|
||||
<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 x:Name="taskCount" 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.3" CornerRadius="100"/>
|
||||
<Border Canvas.Top="80" Canvas.Right="-10" Width="110" Height="110" Background="#FFFFFF" Opacity="0.2" CornerRadius="100"/>
|
||||
|
||||
<Border Canvas.Top="-20" Canvas.Right="180" Width="90" Height="90" Background="#FFFFFF" Opacity="0.2" CornerRadius="100"/>
|
||||
<Border Canvas.Top="-20" Canvas.Right="80" Width="150" Height="150" Background="#FFFFFF" Opacity="0.1" CornerRadius="100"/>
|
||||
|
||||
</Canvas>
|
||||
|
||||
<!--<Button Height="{Binding }" Background="Transparent" BorderThickness="0" Command="{Binding ElementName=ic,Path=DataContext.BorderClickCommand}" CommandParameter="{Binding Target}"/>-->
|
||||
<Button Height="{Binding }" Cursor="Arrow" Background="Transparent" BorderThickness="0" IsEnabled="False" CommandParameter="{Binding Target}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!--其他补充的元素-->
|
||||
<ProgressBar Grid.Row="1" HorizontalAlignment="Center" Margin="0 0 520 23" Width="30" Visibility="{Binding TaskExecutingProgressIsVisible}" Foreground="Ivory" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="80"/>
|
||||
<ProgressBar Grid.Row="1" HorizontalAlignment="Right" Margin="200 0 220 23" Width="30" Visibility="{Binding AlarmProgressIsVisible}" Foreground="Ivory" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="50"/>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--3任务展示-->
|
||||
<Border x:Name="taskPanel" Background="GhostWhite" Grid.Column="0" BorderThickness="0" CornerRadius="15" Margin="10,40,10,10" Padding="0,60,0,30">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="10" Color="Gray" ShadowDepth="2" Opacity=".5"/>
|
||||
</Border.Effect>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding Tasks}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Style="{StaticResource taskTypeBackColor}">
|
||||
|
||||
<!--任务展示-->
|
||||
<StackPanel Orientation="Vertical" Margin="18">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--参数名-->
|
||||
<TextBlock Text="设备编号:" Style="{StaticResource taskNameStyle}"/>
|
||||
<TextBlock Grid.Row="1" Text="任务号:" Style="{StaticResource taskNameStyle}"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="2" Text="执行阶段:" Style="{StaticResource taskNameStyle}"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="2" Text="任务类型:" Style="{StaticResource taskNameStyle}"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="4" Text="源站点:" Style="{StaticResource taskNameStyle}"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="4" Text="目标站点:" Style="{StaticResource taskNameStyle}"/>
|
||||
|
||||
<!--参数值-->
|
||||
<!--作业号-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding JobId}" Style="{StaticResource taskValueStyle}"/>
|
||||
<!--任务号-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding TaskId}" Style="{StaticResource taskValueStyle}"/>
|
||||
<!--执行阶段-->
|
||||
<TextBlock x:Name="tbScheduleState" Grid.Row="0" Grid.Column="3" Tag="{Binding ScheduleState}" Style="{StaticResource scheduleStateTextColor}"/>
|
||||
<!--类型-->
|
||||
<TextBlock x:Name="tbValueTaskType" Grid.Row="1" Grid.Column="3" Tag="{Binding TaskType}" Style="{StaticResource taskTypeTextColor}"/>
|
||||
<!--源站-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="5" Text="{Binding SourceLocation}" Style="{StaticResource taskValueStyle}" Margin="5,10,10,10"/>
|
||||
<!--目标站-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="5" Text="{Binding TargetLocation}" Style="{StaticResource taskValueStyle}" Margin="5,10,10,10"/>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</Border>
|
||||
<!--任务展示标题-->
|
||||
<md:ColorZone Height="70" Width="300" CornerRadius="15" md:ElevationAssist.Elevation="Dp6" Mode="PrimaryMid" Margin="0,10">
|
||||
<TextBlock Text="在执行任务" FontSize="25" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</md:ColorZone>
|
||||
|
||||
|
||||
<!--图表区-->
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.61*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--图表1:总任务量-->
|
||||
<Grid>
|
||||
<!--图表1背景-->
|
||||
<Border Background="GhostWhite" CornerRadius="15" Margin="10,40,10,10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="3" BlurRadius="10" Opacity=".5"/>
|
||||
</Border.Effect>
|
||||
<!--图表1-->
|
||||
<lvc:CartesianChart LegendLocation="Top" Margin="10,20,10,10">
|
||||
<lvc:CartesianChart.Series>
|
||||
<lvc:LineSeries Fill="#DBF3F9" Stroke="#5CD0E1" Values="{Binding LineValuesCount}" Title="任务数" DataLabels="True"/>
|
||||
</lvc:CartesianChart.Series>
|
||||
<lvc:CartesianChart.AxisX>
|
||||
<lvc:Axis Labels="{Binding LineLabels}" Margin="10">
|
||||
<lvc:Axis.Separator>
|
||||
<lvc:Separator StrokeThickness="0.5" Step="1" />
|
||||
</lvc:Axis.Separator>
|
||||
</lvc:Axis>
|
||||
</lvc:CartesianChart.AxisX>
|
||||
<lvc:CartesianChart.AxisY>
|
||||
<lvc:Axis MinValue="0" ShowLabels="True"/>
|
||||
</lvc:CartesianChart.AxisY>
|
||||
</lvc:CartesianChart>
|
||||
</Border>
|
||||
<!--图表1标题-->
|
||||
<md:ColorZone Height="40" Width="300" CornerRadius="15" md:ElevationAssist.Elevation="Dp4" Mode="PrimaryMid" Margin="0,10">
|
||||
<TextBlock Text="月内任务统计/周" FontSize="20" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</md:ColorZone>
|
||||
</Grid>
|
||||
<!--图表2:出入库对比-->
|
||||
<Grid Grid.Row="1" Grid.ColumnSpan="1">
|
||||
<!--图表2背景-->
|
||||
<Border Background="GhostWhite" CornerRadius="15" Margin="10,40,10,10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="3" BlurRadius="10" Opacity=".5"/>
|
||||
</Border.Effect>
|
||||
<!--图表2-->
|
||||
<lvc:CartesianChart Margin="10,20,10,10" LegendLocation="Top">
|
||||
<lvc:CartesianChart.Series>
|
||||
<lvc:LineSeries Stroke="#3BC8D7" Title="实垛任务"
|
||||
PointGeometrySize="0" Values="{Binding LineValuesPallets}" DataLabels="True">
|
||||
<lvc:LineSeries.Fill>
|
||||
<SolidColorBrush Color="#E1F2F6" Opacity=".9"/>
|
||||
</lvc:LineSeries.Fill>
|
||||
</lvc:LineSeries>
|
||||
<lvc:LineSeries Stroke="#FF7261" Title="空托任务"
|
||||
PointGeometrySize="0" Values="{Binding LineValuesGoods}" DataLabels="True">
|
||||
<lvc:LineSeries.Fill>
|
||||
<SolidColorBrush Color="#FFE3E0" Opacity=".9"/>
|
||||
</lvc:LineSeries.Fill>
|
||||
</lvc:LineSeries>
|
||||
</lvc:CartesianChart.Series>
|
||||
<lvc:CartesianChart.AxisX>
|
||||
<lvc:Axis Labels="{Binding LineLabels1}" Margin="10">
|
||||
<lvc:Axis.Separator>
|
||||
<lvc:Separator StrokeThickness="0.5" Step="1" />
|
||||
</lvc:Axis.Separator>
|
||||
</lvc:Axis>
|
||||
</lvc:CartesianChart.AxisX>
|
||||
<lvc:CartesianChart.AxisY>
|
||||
<lvc:Axis MinValue="0" ShowLabels="True"/>
|
||||
</lvc:CartesianChart.AxisY>
|
||||
</lvc:CartesianChart>
|
||||
</Border>
|
||||
<!--图表2标题-->
|
||||
<md:ColorZone Height="40" Width="300" CornerRadius="15" md:ElevationAssist.Elevation="Dp4" Mode="PrimaryMid" Margin="0,10">
|
||||
<TextBlock Text="周内任务" FontSize="20" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</md:ColorZone>
|
||||
<!--图表提示-->
|
||||
<!--<TextBlock Text="数据供参考,具体以实际数据为准" Foreground="Gray" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10 10 10 -20"/>-->
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--图表3:设备运行-->
|
||||
<Grid Grid.Column="1" Grid.RowSpan="2">
|
||||
<Border Background="GhostWhite" CornerRadius="15" Margin="10,40,10,10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="3" BlurRadius="10" Opacity=".5"/>
|
||||
</Border.Effect>
|
||||
|
||||
<!--<lvc:PieChart Height="200" InnerRadius="30" Margin="0,20,36,10" StartingRotationAngle="0" Series="{Binding PieSeriesCollection}" LegendLocation="Right">
|
||||
<lvc:PieChart.ChartLegend>
|
||||
<lvc:DefaultLegend BulletSize="10"></lvc:DefaultLegend>
|
||||
</lvc:PieChart.ChartLegend>
|
||||
<lvc:PieChart.DataTooltip>
|
||||
<lvc:DefaultTooltip BulletSize="10"></lvc:DefaultTooltip>
|
||||
</lvc:PieChart.DataTooltip>
|
||||
</lvc:PieChart>-->
|
||||
|
||||
<lvc:CartesianChart Series="{Binding RowSeriesCollection}" Margin="10 20 10 10">
|
||||
<lvc:CartesianChart.AxisX>
|
||||
<lvc:Axis Title="运行里程数(km)" Labels="{Binding RowValues}"/>
|
||||
</lvc:CartesianChart.AxisX>
|
||||
<lvc:CartesianChart.AxisY>
|
||||
<lvc:Axis Labels="{Binding RowSeriesTitles}"/>
|
||||
</lvc:CartesianChart.AxisY>
|
||||
<lvc:CartesianChart.DataTooltip>
|
||||
<lvc:DefaultTooltip SelectionMode="SharedYValues"/>
|
||||
</lvc:CartesianChart.DataTooltip>
|
||||
</lvc:CartesianChart>
|
||||
|
||||
</Border>
|
||||
|
||||
<!--图表3标题-->
|
||||
<md:ColorZone Height="40" Width="200" CornerRadius="15" md:ElevationAssist.Elevation="Dp4" Mode="PrimaryMid" Margin="0,10">
|
||||
<TextBlock Text="设备运行里程" FontSize="20" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</md:ColorZone>
|
||||
|
||||
<!--图表提示-->
|
||||
<TextBlock Text="数据供参考,具体以实际数据为准" Foreground="Gray" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10 10 10 -20"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Page>
|
||||
35
WPFWCSDemo/Views/DataInfoView.xaml.cs
Normal file
35
WPFWCSDemo/Views/DataInfoView.xaml.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using LiveCharts;
|
||||
using LiveCharts.Wpf;
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// DataInfoView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DataInfoView : Page
|
||||
{
|
||||
|
||||
|
||||
public DataInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = new ViewModels.DataInfoViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
14
WPFWCSDemo/Views/Devices/DeviceListView.xaml
Normal file
14
WPFWCSDemo/Views/Devices/DeviceListView.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.Devices.DeviceListView"
|
||||
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:WPFWCSDemo.Views.Devices"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="850" d:DesignWidth="1600"
|
||||
Title="DeviceListView">
|
||||
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
28
WPFWCSDemo/Views/Devices/DeviceListView.xaml.cs
Normal file
28
WPFWCSDemo/Views/Devices/DeviceListView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 WPFWCSDemo.Views.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceListView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceListView : Page
|
||||
{
|
||||
public DeviceListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
216
WPFWCSDemo/Views/Devices/RGVsView.xaml
Normal file
216
WPFWCSDemo/Views/Devices/RGVsView.xaml
Normal file
@@ -0,0 +1,216 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.Devices.RGVsView"
|
||||
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:WPFWCSDemo.Views.Devices"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="850" d:DesignWidth="1600"
|
||||
Title="RGVsView">
|
||||
|
||||
<Page.Resources>
|
||||
<!--RGV参数【名称】格式-->
|
||||
<Style x:Key="txtRGVParaName" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="Gray"/>
|
||||
<Setter Property="Margin" Value="0,0,0,7"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
<!--RGV参数【值】格式-->
|
||||
<Style x:Key="txtRGVParaValue" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</Style>
|
||||
<!--RGV参数【值】颜色指示-->
|
||||
<Style x:Key="textStateColor" TargetType="TextBlock" BasedOn="{StaticResource txtRGVParaValue}">
|
||||
<Style.Triggers>
|
||||
<!--/////////////////////////////////////////////////////////////////////////////////-->
|
||||
<!--联机自动-->
|
||||
<DataTrigger Binding="{Binding ElementName=RGVMode, Path=Text}" Value="联机自动">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="LimeGreen" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--手动-->
|
||||
<DataTrigger Binding="{Binding ElementName=RGVMode, Path=Text}" Value="手动">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Gold" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--半自动-->
|
||||
<DataTrigger Binding="{Binding ElementName=RGVMode, Path=Text}" Value="半自动">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="DarkOrange" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--单机自动-->
|
||||
<DataTrigger Binding="{Binding ElementName=RGVMode, Path=Text}" Value="单机自动">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="DarkOrange" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--/////////////////////////////////////////////////////////////////////////////////-->
|
||||
<!--设备状态-->
|
||||
<DataTrigger Binding="{Binding ElementName=RGVDeviceState, Path=Text}" Value="待机">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="DimGray" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=RGVDeviceState, Path=Text}" Value="运行">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="LimeGreen" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=RGVDeviceState, Path=Text}" Value="报警">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Red" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<!--/////////////////////////////////////////////////////////////////////////////////-->
|
||||
<!--允许下发-->
|
||||
<DataTrigger Binding="{Binding ElementName=RGVPermission, Path=Text}" Value="允许下发">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Black" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ElementName=RGVPermission, Path=Text}" Value="禁止下发">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="Red" Opacity=".5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!--参数背景-->
|
||||
<Style x:Key="myPanel" TargetType="StackPanel">
|
||||
<Setter Property="Margin" Value="0,0,50,0"/>
|
||||
<Setter Property="Orientation" Value="Vertical"/>
|
||||
</Style>
|
||||
|
||||
<!--设备看板背景-->
|
||||
<Style x:Key="deviceBackGround" TargetType="Border">
|
||||
<Setter Property="Background" Value="GhostWhite"/>
|
||||
<Setter Property="CornerRadius" Value="10"/>
|
||||
<Setter Property="Margin" Value="20,10"/>
|
||||
<Setter Property="Padding" Value="10"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Width" Value="auto"/>
|
||||
<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/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--RGV-->
|
||||
<TextBlock Text="RGV参数" Style="{StaticResource screenTitle}"/>
|
||||
<Grid Grid.Row="1">
|
||||
<ScrollViewer>
|
||||
<ListBox ItemsSource="{Binding RGVsContent}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--RGV-->
|
||||
<Border Grid.Column="1" Style="{StaticResource deviceBackGround}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<WrapPanel>
|
||||
<StackPanel Margin="50,0,50,0">
|
||||
<TextBlock Text="操作模式" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock x:Name="RGVMode" Text="{Binding Receive_ModeContent}" Style="{StaticResource textStateColor}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="设备状态" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock x:Name="RGVDeviceState" Text="{Binding Receive_DeviceStateContent}" Style="{StaticResource textStateColor}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="运行状态" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock x:Name="RGVRunningState" Text="{Binding Receive_RunningStateContent}" Style="{StaticResource textStateColor}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="3" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="执行阶段" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock Text="{Binding Receive_PhaseContent}" Style="{StaticResource txtRGVParaValue}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="4" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="任务号" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock Text="{Binding Receive_TaskNumberContent}" Style="{StaticResource txtRGVParaValue}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="5" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="允许下发" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock x:Name="RGVPermission" Text="{Binding Receive_PermissionContent}" Style="{StaticResource textStateColor}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="6" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="载货状态" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock Text="{Binding Receive_LoadStateContent}" Style="{StaticResource txtRGVParaValue}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="7" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="当前层" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock Text="{Binding Receive_CurrentFloorContent}" Style="{StaticResource txtRGVParaValue}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="8" Style="{StaticResource myPanel}">
|
||||
<TextBlock Text="目标层" Style="{StaticResource txtRGVParaName}"/>
|
||||
<TextBlock Text="{Binding Receive_TargetFloorContent}" Style="{StaticResource txtRGVParaValue}"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Background="DarkOrange" Width="80" Height="80" CornerRadius="50" Margin="0,0,-50,0">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="3" BlurRadius="10" Opacity=".7"/>
|
||||
</Border.Effect>
|
||||
<TextBlock Text="{Binding Number}" Foreground="White" FontSize="20" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
</ScrollViewer>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/Devices/RGVsView.xaml.cs
Normal file
29
WPFWCSDemo/Views/Devices/RGVsView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 WPFWCSDemo.Views.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// RGVsView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RGVsView : Page
|
||||
{
|
||||
public RGVsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
//DataContext = new ViewModels.Devices.RGVsViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
167
WPFWCSDemo/Views/DevicesNavigationView.xaml
Normal file
167
WPFWCSDemo/Views/DevicesNavigationView.xaml
Normal file
@@ -0,0 +1,167 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.DevicesNavigationView"
|
||||
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="850" d:DesignWidth="1600"
|
||||
Title="DevicesNavigationView">
|
||||
|
||||
<Page.Resources>
|
||||
<!--导航按钮的背景样式-->
|
||||
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="md:ButtonAssist.CornerRadius" Value="5"/>
|
||||
<Setter Property="md:ShadowAssist.ShadowDepth" Value="Depth3"/>
|
||||
<!--<Setter Property="Height" Value="{Binding ElementName=deviceNavigationHalfGrid,Path=ActualHeight}"/>-->
|
||||
<!--缩放起始点-->
|
||||
<Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
|
||||
<!--缩放比例-->
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<!--鼠标悬停缩放事件-->
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="1"/>
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.05" Duration="0:0:0.1"/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.05" Duration="0:0:0.1"/>
|
||||
<!--<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.9" Duration="0:0:0.1"/>-->
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.1"/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.1"/>
|
||||
<!--<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.1"/>-->
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<!--鼠标按下--><!--
|
||||
<EventTrigger RoutedEvent="UIElement.MouseLeftButtonDown">
|
||||
<EventTrigger.Actions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
--><!-- 定义鼠标点击时的动画效果 --><!--
|
||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.01" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger.Actions>
|
||||
</EventTrigger>
|
||||
--><!--鼠标放开--><!--
|
||||
<EventTrigger RoutedEvent="UIElement.MouseLeftButtonUp">
|
||||
<EventTrigger.Actions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
--><!-- 定义鼠标点击时的动画效果 --><!--
|
||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.9" Duration="0:0:0.01" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger.Actions>
|
||||
</EventTrigger>-->
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<!--按钮文本元素样式-->
|
||||
<Style x:Key="btnNavigationText" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontSize" Value="40"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="0,10,0,10"/>
|
||||
</Style>
|
||||
<!--按钮图像元素样式-->
|
||||
<Style x:Key="btnNavigationImage" TargetType="Image">
|
||||
<Setter Property="Stretch" Value="None"/>
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<Grid>
|
||||
<!--背景图-->
|
||||
<Image Source="\Resources\仓储系统.jpg" Panel.ZIndex="0" Opacity=".5" Stretch="Fill">
|
||||
<Image.Effect>
|
||||
<BlurEffect Radius="40"/>
|
||||
</Image.Effect>
|
||||
|
||||
</Image>
|
||||
|
||||
<!--按钮布局-->
|
||||
<Grid x:Name="deviceNavigationGrid" Margin="200,120">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition x:Name="deviceNavigationHalfGrid" Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--设备列表Style="{StaticResource devicesButton}"-->
|
||||
<Button x:Name="deviceMain" Grid.RowSpan="2" Background="#673AB7" Command="{Binding OpenDevicePageCommand}" Height="{Binding ElementName=deviceNavigationGrid,Path=Height}">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Image Source="\Resources\齿轮.png" Stretch="None" Style="{StaticResource btnNavigationImage}"/>
|
||||
<TextBlock Text="设备列表" Margin="0,50" Style="{StaticResource btnNavigationText}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!--堆垛机-->
|
||||
<Button Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Background="#f58220" Command="{Binding OpenStackerPageCommand}" Height="{Binding ElementName=deviceNavigationHalfGrid,Path=Height}">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Image Source="\Resources\无底堆垛机.png" Style="{StaticResource btnNavigationImage}"/>
|
||||
<TextBlock Text="堆垛机" Style="{StaticResource btnNavigationText}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!--提升机-->
|
||||
<Button Grid.Row="1" Grid.Column="1" Background="#1d953f" Command="{Binding OpenLiftPageCommand}" Height="{Binding ElementName=deviceNavigationHalfGrid,Path=Height}">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Image Source="\Resources\升降.png" Style="{StaticResource btnNavigationImage}"/>
|
||||
<TextBlock Text="提升机" Style="{StaticResource btnNavigationText}" Margin="0,0,0,30"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!--RGV-->
|
||||
<Button Grid.Row="1" Grid.Column="2" Background="#7a1723" Command="{Binding OpenRGVPageCommand}" Height="{Binding ElementName=deviceNavigationHalfGrid,Path=Height}">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Image Source="\Resources\RGV.png" Style="{StaticResource btnNavigationImage}"/>
|
||||
<TextBlock Text="穿梭车" Style="{StaticResource btnNavigationText}" Margin="0,0,0,30"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!--输送机-->
|
||||
<Button Grid.RowSpan="2" Grid.Column="3" Background="#2F50A0" Command="{Binding OpenConvPageCommand}" Height="{Binding ElementName=deviceNavigationHalfGrid,Path=Height}">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Image Source="\Resources\输送机.png" Style="{StaticResource btnNavigationImage}"/>
|
||||
<TextBlock Text="输送机" Margin="0,50" Style="{StaticResource btnNavigationText}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!--2#输送机-->
|
||||
<!--<Button Grid.Row="1" Grid.Column="3" Background="#00a6ac" Height="{Binding ElementName=deviceNavigationHalfGrid,Path=Height}">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Image Source="\Resources\输送机.png" Style="{StaticResource btnNavigationImage}"/>
|
||||
<TextBlock Text="2#输送机" Style="{StaticResource btnNavigationText}"/>
|
||||
</StackPanel>
|
||||
</Button>-->
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Page>
|
||||
40
WPFWCSDemo/Views/DevicesNavigationView.xaml.cs
Normal file
40
WPFWCSDemo/Views/DevicesNavigationView.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// DevicesNavigationView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DevicesNavigationView : Page
|
||||
{
|
||||
private static Frame _navagationFrame;
|
||||
public DevicesNavigationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.DevicesNavigationViewModel(_navagationFrame);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取主页导航的Frame对象
|
||||
/// </summary>
|
||||
/// <param name="frame"></param>
|
||||
public static void GetMainFrame(Frame frame)
|
||||
{
|
||||
_navagationFrame = frame;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
328
WPFWCSDemo/Views/DevicesView.xaml
Normal file
328
WPFWCSDemo/Views/DevicesView.xaml
Normal file
@@ -0,0 +1,328 @@
|
||||
<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>
|
||||
28
WPFWCSDemo/Views/DevicesView.xaml.cs
Normal file
28
WPFWCSDemo/Views/DevicesView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// DevicesView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DevicesView : Page
|
||||
{
|
||||
public DevicesView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
WPFWCSDemo/Views/HelperView.xaml
Normal file
14
WPFWCSDemo/Views/HelperView.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.HelperView"
|
||||
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:WPFWCSDemo.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="HelperView">
|
||||
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
28
WPFWCSDemo/Views/HelperView.xaml.cs
Normal file
28
WPFWCSDemo/Views/HelperView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// HelperView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class HelperView : Page
|
||||
{
|
||||
public HelperView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
WPFWCSDemo/Views/LineManagementView.xaml
Normal file
36
WPFWCSDemo/Views/LineManagementView.xaml
Normal file
@@ -0,0 +1,36 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.LineManagementView"
|
||||
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:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="800" d:DesignWidth="1600"
|
||||
Title="LineManagementView">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="数据统计" Style="{StaticResource screenTitle}"/>
|
||||
<ItemsControl Grid.Row="1">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Grid.Row="1" Margin="10" Background="Black">
|
||||
<!--<md:Flipper Background="BlueViolet">
|
||||
<md:Flipper.FrontContent md:FlipperAssist.UniformCornerRadius="8" Style="{StaticResource MaterialDesignCardFlipper}">
|
||||
<Button Width="184" Margin="8" Command="{x:Static md:Flipper.FlipCommand}" Content="Rounded Card Flipper 1" Style="{StaticResource MaterialDesignFlatButton}" />
|
||||
</md:Flipper.FrontContent>
|
||||
<md:Flipper.BackContent>
|
||||
<Button Width="184" Margin="8" Command="{x:Static md:Flipper.FlipCommand}" Content="GO BACK" Style="{StaticResource MaterialDesignFlatButton}" />
|
||||
</md:Flipper.BackContent>
|
||||
</md:Flipper>-->
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/LineManagementView.xaml.cs
Normal file
29
WPFWCSDemo/Views/LineManagementView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// LineManagementView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LineManagementView : Page
|
||||
{
|
||||
public LineManagementView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
26
WPFWCSDemo/Views/LogView.xaml
Normal file
26
WPFWCSDemo/Views/LogView.xaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.LogView"
|
||||
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:WPFWCSDemo.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="790" d:DesignWidth="1600"
|
||||
Title="LogView">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--标题-->
|
||||
<TextBlock Text="日志" Style="{StaticResource screenTitle}"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Text="123" TextWrapping="Wrap" />
|
||||
|
||||
<TextBlock Grid.Row="2" Text="{Binding Content}" TextWrapping="Wrap" />
|
||||
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
30
WPFWCSDemo/Views/LogView.xaml.cs
Normal file
30
WPFWCSDemo/Views/LogView.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// LogView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LogView : Page
|
||||
{
|
||||
public LogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new LogViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
134
WPFWCSDemo/Views/MonitorView.xaml
Normal file
134
WPFWCSDemo/Views/MonitorView.xaml
Normal file
@@ -0,0 +1,134 @@
|
||||
<Page
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
xmlns:Points="clr-namespace:LiveCharts.Wpf.Points;assembly=LiveCharts.Wpf" x:Class="WPFWCSDemo.Views.MonitorView"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="760" d:DesignWidth="1600"
|
||||
Title="MonitorView">
|
||||
<Page.Resources>
|
||||
<Storyboard x:Key="Storyboard1">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CircleRgvTest" Storyboard.TargetProperty="(Canvas.Left)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="200"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:11" Value="1280"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:12" Value="1320"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:13" Value="1360"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:14" Value="1390"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:15" Value="1402"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CircleRgvTest" Storyboard.TargetProperty="(Canvas.Top)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:11" Value="50.4"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:12" Value="55.4"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:13" Value="70.4"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:14" Value="100.4"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:15" Value="150"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CircleRgvTest1" Storyboard.TargetProperty="Angle">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:11" Value="0"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:12" Value="10"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:13" Value="40"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:14" Value="60"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:15" Value="90"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
|
||||
|
||||
</Storyboard>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="生产监控" Style="{StaticResource screenTitle}"/>
|
||||
<!--选择层-->
|
||||
<DockPanel Grid.Row="1" LastChildFill="False">
|
||||
<ListBox Margin="50,10" SelectionMode="Single" SelectedIndex="{Binding LayersSelectedIndex}" Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" DockPanel.Dock="Left">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding LayersSelectCommand}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<ListBoxItem Content="1#环穿" />
|
||||
<ListBoxItem Content="2#环穿" />
|
||||
<ListBoxItem Content="3#环穿" />
|
||||
<ListBoxItem Content="4#环穿" />
|
||||
<ListBoxItem Content="5#环穿" />
|
||||
<ListBoxItem Content="6#环穿" />
|
||||
<ListBoxItem Content="7#环穿" />
|
||||
<ListBoxItem Content="8#环穿" />
|
||||
<ListBoxItem Content="9#环穿" />
|
||||
|
||||
</ListBox>
|
||||
<!--图例-->
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="50,5">
|
||||
<Rectangle Fill="YellowGreen" Style="{StaticResource standardSymbolRectangle}"/>
|
||||
<TextBlock Text="待机" Style="{StaticResource standardSymbolText}"/>
|
||||
<Rectangle Fill="LawnGreen" Style="{StaticResource standardSymbolRectangle}"/>
|
||||
<TextBlock Text="运行" Style="{StaticResource standardSymbolText}"/>
|
||||
<Rectangle Fill="Orange" Style="{StaticResource standardSymbolRectangle}"/>
|
||||
<TextBlock Text="维护" VerticalAlignment="Center" FontSize="13" Margin="0,0,10,0"/>
|
||||
<Rectangle Fill="Red" Style="{StaticResource standardSymbolRectangle}"/>
|
||||
<TextBlock Text="禁用" Style="{StaticResource standardSymbolText}"/>
|
||||
</StackPanel>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
|
||||
|
||||
<Canvas Grid.Row="2" Width="1500" Height="650" VerticalAlignment="Top" Background="Transparent">
|
||||
<!--轨道-->
|
||||
<Rectangle RadiusX="100" RadiusY="100" Height="550" Canvas.Left="52" Stroke="#FF827D7D" Canvas.Top="65" Width="1400" HorizontalAlignment="Left" VerticalAlignment="Center" StrokeThickness="20"/>
|
||||
<Grid x:Name="CircleRgvTest" Canvas.Left="200" Canvas.Top="50.4" RenderTransformOrigin="0.5,0.5">
|
||||
<Grid.RenderTransform>
|
||||
<TransformGroup>
|
||||
<RotateTransform x:Name="CircleRgvTest1" Angle="0" />
|
||||
</TransformGroup>
|
||||
</Grid.RenderTransform>
|
||||
<Rectangle RadiusX="5" RadiusY="5" Height="50" Stroke="DarkOrange" Fill="DarkOrange" Width="80" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
||||
<Rectangle.Effect>
|
||||
<DropShadowEffect BlurRadius="15" Color="Gray" ShadowDepth="5" Direction="270"/>
|
||||
</Rectangle.Effect>
|
||||
</Rectangle>
|
||||
|
||||
<!--链条-->
|
||||
<Rectangle Fill="Black" Height="45" Width="7" Margin="52,2,22,2"/>
|
||||
<Rectangle Fill="Black" Height="45" Width="7" Margin="22,2,52,2"/>
|
||||
|
||||
<!--边缘-->
|
||||
<Rectangle Height="50" Width="5" Margin="75,0,0,0">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="1,1" StartPoint="0,1">
|
||||
<GradientStop Color="Black" Offset="0"/>
|
||||
<GradientStop Color="#FFF5C761" Offset="1"/>
|
||||
<GradientStop Color="#FFD0920A"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Rectangle Height="50" Width="5" Margin="0,0,75,0">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0,1" StartPoint="1,1">
|
||||
<GradientStop Color="Black" Offset="0"/>
|
||||
<GradientStop Color="#FFF5C761" Offset="1"/>
|
||||
<GradientStop Color="#FFD0920A"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
|
||||
<!--上部平面-->
|
||||
<Rectangle Fill="Gold" Height="50" Width="15" Margin="60,0,5,0"/>
|
||||
<Rectangle Fill="Gold" Height="50" Width="15" Margin="5,0,60,0"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</Canvas>
|
||||
</Grid>
|
||||
</Page>
|
||||
33
WPFWCSDemo/Views/MonitorView.xaml.cs
Normal file
33
WPFWCSDemo/Views/MonitorView.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
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;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// MonitorView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MonitorView : Page
|
||||
{
|
||||
public MonitorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new MonitorViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
52
WPFWCSDemo/Views/Settings/AboutView.xaml
Normal file
52
WPFWCSDemo/Views/Settings/AboutView.xaml
Normal file
@@ -0,0 +1,52 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.Settings.AboutView"
|
||||
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:WPFWCSDemo.Views.Settings"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="AboutView">
|
||||
|
||||
<Page.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="20"/>
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0">
|
||||
<TextBlock Text="WCS Demo 2023"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<TextBlock Text="版本 1.0.0.1"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal">
|
||||
<TextBlock Text="©" Foreground="Gray" Margin="10,10,0,10"/>
|
||||
<TextBlock Text="2023 · YCTD"/>
|
||||
<TextBlock>
|
||||
<Hyperlink Command="{Binding WebNavigationCommand}">
|
||||
http://www.yctd.cn/
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="3" Text="联系电话:010-60237001 60237002"/>
|
||||
|
||||
<StackPanel Grid.Row="4">
|
||||
<TextBlock Text="保留所有权利。"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/Settings/AboutView.xaml.cs
Normal file
29
WPFWCSDemo/Views/Settings/AboutView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 WPFWCSDemo.Views.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// AboutView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AboutView : Page
|
||||
{
|
||||
public AboutView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.Settings.AboutViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
58
WPFWCSDemo/Views/Settings/SettingView.xaml
Normal file
58
WPFWCSDemo/Views/Settings/SettingView.xaml
Normal file
@@ -0,0 +1,58 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.SettingView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:SettingViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="850" d:DesignWidth="1600"
|
||||
Title="SettingView">
|
||||
|
||||
|
||||
<Grid Margin="0,0,0,30">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="700"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="设置" FontSize="30" FontWeight="Bold" Margin="20"/>
|
||||
<Separator Grid.Row="1" VerticalAlignment="Bottom" Background="Gray" BorderThickness="0.5"/>
|
||||
<Grid Grid.Row="1" Margin="50,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ListBox x:Name="settingMenu" Grid.Row="1" ItemsSource="{Binding Menu}" ItemContainerStyle="{StaticResource myListBoxItemStyle}">
|
||||
<!--添加行为触发(例:通过选中项的改变触发某个事件)-->
|
||||
<i:Interaction.Triggers>
|
||||
<!--设定触发的事件-->
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<!--绑定动作对象的属性-->
|
||||
<i:InvokeCommandAction Command="{Binding SettingNavigateCommand}" CommandParameter="{Binding ElementName=settingMenu,Path=SelectedItem}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Background="Transparent">
|
||||
<md:PackIcon Kind="{Binding Icon}" FontSize="16" Margin="40,20" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Title}" FontSize="16" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Border Grid.Column="1">
|
||||
<Frame x:Name="settingFrame" Background="#FAFAFA" Margin="20 0 0 0"/>
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="3" BlurRadius="10" Direction="200" Color="Black" Opacity="0.3"/>
|
||||
</Border.Effect>
|
||||
</Border>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/Settings/SettingView.xaml.cs
Normal file
29
WPFWCSDemo/Views/Settings/SettingView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// SettingView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingView : Page
|
||||
{
|
||||
public SettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.SettingViewModel(settingFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
58
WPFWCSDemo/Views/Settings/SkinView.xaml
Normal file
58
WPFWCSDemo/Views/Settings/SkinView.xaml
Normal file
@@ -0,0 +1,58 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.Settings.SkinView"
|
||||
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:mdColors="clr-namespace:MaterialDesignColors;assembly=MaterialDesignColors"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views.Settings"
|
||||
xmlns:converters="clr-namespace:WPFWCSDemo.Common.Converters"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="700" d:DesignWidth="1500"
|
||||
Title="SkinView">
|
||||
|
||||
<Page.Resources>
|
||||
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
||||
<DataTemplate x:Key="SwatchColorTemplate" DataType="{x:Type Color}">
|
||||
<Button Width="40"
|
||||
Height="40"
|
||||
Background="{Binding Converter={StaticResource ColorToBrushConverter}}"
|
||||
Command="{Binding DataContext.ChangeHueCommand, RelativeSource={RelativeSource AncestorType=local:SkinView}}"
|
||||
CommandParameter="{Binding}">
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="700" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="10">
|
||||
<TextBlock Text="浅色"/>
|
||||
<ToggleButton Margin="8 0" Command="{Binding }" IsChecked="{Binding IsDarkTheme}"/>
|
||||
<TextBlock Text="深色"/>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
||||
<ItemsControl ItemsSource="{Binding Swatches}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type mdColors:ISwatch}">
|
||||
<StackPanel Orientation="Horizontal" Margin="10,0">
|
||||
<TextBlock Width="90" VerticalAlignment="Center" Text="{Binding Name, Mode=OneTime}" />
|
||||
<ItemsControl ItemTemplate="{StaticResource SwatchColorTemplate}" ItemsSource="{Binding Hues, Mode=OneTime}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/Settings/SkinView.xaml.cs
Normal file
29
WPFWCSDemo/Views/Settings/SkinView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 WPFWCSDemo.Views.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// SkinView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SkinView : Page
|
||||
{
|
||||
public SkinView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.Settings.SkinViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
121
WPFWCSDemo/Views/Settings/SystemView.xaml
Normal file
121
WPFWCSDemo/Views/Settings/SystemView.xaml
Normal file
@@ -0,0 +1,121 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.Settings.SystemView"
|
||||
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.Settings"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="850" d:DesignWidth="1600"
|
||||
Title="SystemView">
|
||||
|
||||
<Page.Resources>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
|
||||
<Setter Property="MinHeight" Value="50"/>
|
||||
<Setter Property="MinWidth" Value="240"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<Setter Property="Margin" Value="0 10"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="CheckBox" BasedOn="{StaticResource MaterialDesignSecondaryCheckBox}">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="md:CheckBoxAssist.CheckBoxSize" Value="30"/>
|
||||
</Style>
|
||||
<Style x:Key="LineButton" TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="50"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="Width" Value="240"/>
|
||||
<Setter Property="Margin" Value="20 10 0 10"/>
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<!--<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=Tag}" Value="true">
|
||||
--><!--<Setter Property="Background" Value="#673AB7"/>--><!--
|
||||
<Setter Property="Background" Value="YellowGreen"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=Tag}" Value="false">
|
||||
<Setter Property="Background" Value="Silver"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>-->
|
||||
</Style>
|
||||
<Style x:Key="LineButtonTitle" TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignBody1TextBlock}">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="Visibility" Value="Hidden"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
<Grid Margin="50 10 50 30">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="系统维护操作" FontSize="20" Margin="0 10 0 10" Style="{StaticResource screenTitle}"/>
|
||||
<!--便利性功能设置-->
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal">
|
||||
<Button Content="数据备份" Command="{Binding GetSqlDBBackupCommand}"/>
|
||||
<CheckBox Content="备份时删除数据" IsChecked="{Binding IsTaskDataDelete}" Visibility="Hidden"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal">
|
||||
<Button Content="删除历史数据" Command="{Binding DeleteDataOutOfTreeMouthsCommand}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" Visibility="Hidden">
|
||||
<Button Content="历史报警记录备份" Command="{Binding AlarmBackupCommand}"/>
|
||||
<CheckBox Content="备份时删除数据" IsChecked="{Binding IsAlarmDataDelete}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="4" Orientation="Horizontal" Visibility="Hidden">
|
||||
<Button Content="初始化生成库存状态表" Background="DarkOrange" Command="{Binding CargoInitializeCommand}"/>
|
||||
<TextBlock Width="150" TextWrapping="Wrap" Text="(使用前请先备份库存记录,否则会导致数据丢失)" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
|
||||
<TextBlock Text=" 实垛输送线-A:" Style="{StaticResource LineButtonTitle}"/>
|
||||
<Button Content="{Binding LineAStr}" Command="{Binding LineAvailableIsResetCommand}" Tag="{Binding LineAIsEnable}" Style="{StaticResource LineButton}" CommandParameter="A"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
|
||||
<TextBlock Text=" 实垛输送线-B:" Style="{StaticResource LineButtonTitle}"/>
|
||||
<Button Content="{Binding LineBStr}" Command="{Binding LineAvailableIsResetCommand}" Tag="{Binding LineBIsEnable}" Style="{StaticResource LineButton}" CommandParameter="B"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||
<TextBlock Text=" 实垛输送线-C:" Style="{StaticResource LineButtonTitle}"/>
|
||||
<Button Content="{Binding LineCStr}" Command="{Binding LineAvailableIsResetCommand}" Tag="{Binding LineCIsEnable}" Style="{StaticResource LineButton}" CommandParameter="C"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
|
||||
<TextBlock Text=" 实垛输送线-D:" Style="{StaticResource LineButtonTitle}"/>
|
||||
<Button Content="{Binding LineDStr}" Command="{Binding LineAvailableIsResetCommand}" Tag="{Binding LineDIsEnable}" Style="{StaticResource LineButton}" CommandParameter="D"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal">
|
||||
<TextBlock Text="空托输送线-AB:" Style="{StaticResource LineButtonTitle}"/>
|
||||
<Button Content="{Binding LineABStr}" Command="{Binding LineAvailableIsResetCommand}" Tag="{Binding LineABIsEnable}" Style="{StaticResource LineButton}" CommandParameter="AB"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal">
|
||||
<TextBlock Text="空托输送线-CD:" Style="{StaticResource LineButtonTitle}"/>
|
||||
<Button Content="{Binding LineCDStr}" Command="{Binding LineAvailableIsResetCommand}" Tag="{Binding LineCDIsEnable}" Style="{StaticResource LineButton}" CommandParameter="CD"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--接口请求测试-->
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
29
WPFWCSDemo/Views/Settings/SystemView.xaml.cs
Normal file
29
WPFWCSDemo/Views/Settings/SystemView.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 WPFWCSDemo.Views.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// SystemView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SystemView : Page
|
||||
{
|
||||
public SystemView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.Settings.SystemViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
165
WPFWCSDemo/Views/TaskHistoryView.xaml
Normal file
165
WPFWCSDemo/Views/TaskHistoryView.xaml
Normal file
@@ -0,0 +1,165 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.TaskHistoryView"
|
||||
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"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:TaskHistoryViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="900" d:DesignWidth="1600"
|
||||
Title="TaskHistoryView">
|
||||
|
||||
<Page.Resources>
|
||||
<Style x:Key="pageText" TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignTextBlock}">
|
||||
<Setter Property="Foreground" Value="DimGray"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Margin" Value="50 0"/>
|
||||
</Style>
|
||||
<Style x:Key="pageButton" TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
|
||||
<Setter Property="Background" Value="GhostWhite"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="Width" Value="50"/>
|
||||
<Setter Property="Margin" Value="1"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="BlueViolet"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="pageButtonSelectedColor" TargetType="Button" BasedOn="{StaticResource pageButton}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="Background" Value="BlueViolet"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--标题-->
|
||||
<TextBlock Text="历史记录 - 调度任务" FontSize="30" FontWeight="Bold" Margin="10,5"/>
|
||||
|
||||
<!--上方搜索区域-->
|
||||
|
||||
<Grid Grid.Row="1" Margin="40 10 0 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--日期-->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--开始时间-->
|
||||
<DatePicker Text="{Binding DateStart,Mode=TwoWay}" SelectedDate="{Binding DateStart}" IsTodayHighlighted="True" Width="150" md:HintAssist.Hint="Pick StartDate" Style="{StaticResource MaterialDesignOutlinedDatePicker}" Margin="10,0"/>
|
||||
<md:TimePicker Text="{Binding TxtTimeStart,Mode=TwoWay}" SelectedTime="{Binding TimeStart}" Is24Hours="True" Width="150" md:HintAssist.Hint="Pick StartTime" Style="{StaticResource MaterialDesignOutlinedTimePicker}"/>
|
||||
<!--结束时间-->
|
||||
<DatePicker Text="{Binding DateEnd,Mode=TwoWay}" SelectedDate="{Binding DateEnd}" IsTodayHighlighted="True" Width="150" md:HintAssist.Hint="Pick EndDate" Style="{StaticResource MaterialDesignOutlinedDatePicker}" Margin="50,0,10,0"/>
|
||||
<md:TimePicker Text="{Binding TxtTimeEnd,Mode=TwoWay}" SelectedTime="{Binding TimeEnd}" Is24Hours="True" Width="150" md:HintAssist.Hint="Pick EndTime" Style="{StaticResource MaterialDesignOutlinedTimePicker}"/>
|
||||
</StackPanel>
|
||||
<!--搜索-->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<ComboBox Text="{Binding ColumnName}" SelectedItem="{Binding ColumnName,Mode=TwoWay}" IsReadOnly="True" ItemsSource="{Binding ColumnList}" md:HintAssist.Hint="请选择字段" Style="{StaticResource MaterialDesignOutlinedComboBox}" Width="150" Margin="10,0"/>
|
||||
<TextBox Text="{Binding Keywords,Mode=TwoWay}" Width="150" Style="{StaticResource MaterialDesignOutlinedTextBox}" md:HintAssist.Hint="输入关键词"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Column="2" Margin="10 0 50 0">
|
||||
<Button Width="150" Height="50" Content="查询" Command="{Binding QueryCommand}" CommandParameter="1" Margin="20,0"/>
|
||||
<Button Width="150" Height="50" Content="重置" Command="{Binding ClearCommand}" Background="White" Foreground="BlueViolet" DockPanel.Dock="Right"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!--表格区域-->
|
||||
<Grid Grid.Row="2" Margin="50,20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataGrid x:Name="taskHistoryDataGrid" GridLinesVisibility="None" AlternatingRowBackground="Lavender" ItemsSource="{Binding TaskHistory}" RowHeight="50" ColumnHeaderStyle="{StaticResource MaterialDesignRaisedButton}" AutoGenerateColumns="False" ColumnHeaderHeight="50" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="FullRow" >
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<!--<Setter Property="BorderThickness" Value="0"/>-->
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="环穿编号" Binding="{Binding JobId}" Width="*"/>
|
||||
<DataGridTextColumn Header="任务号" Binding="{Binding TaskId}" Width="*"/>
|
||||
<!--<DataGridTextColumn Header="托盘号" Binding="{Binding PalletId}"/>-->
|
||||
<DataGridTextColumn Header="任务类型" Binding="{Binding TaskType}" Width="*"/>
|
||||
<DataGridTextColumn Header="源站点" Binding="{Binding SourceLocation}" Width="*"/>
|
||||
<DataGridTextColumn Header="目标站点" Binding="{Binding TargetLocation}" Width="*"/>
|
||||
<DataGridTextColumn Header="任务状态" Binding="{Binding TaskState}" Width="1.5*"/>
|
||||
<DataGridTextColumn Header="调度状态" Binding="{Binding ScheduleState}" Width="2*"/>
|
||||
<DataGridTextColumn Header="生成时间" Binding="{Binding CreateTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
||||
<DataGridTextColumn Header="调度时间" Binding="{Binding ScheduleTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
||||
<DataGridTextColumn Header="结束时间" Binding="{Binding FinishTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="1" Height="50" Background="AntiqueWhite">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--每页条数-->
|
||||
<StackPanel Margin="20 0" Orientation="Horizontal">
|
||||
<!--总条数-->
|
||||
<TextBlock Text="{Binding DataCount}" Style="{StaticResource pageText}" Margin="50 0 20 0"/>
|
||||
<TextBlock Text="每页 10 " Style="{StaticResource pageText}" Margin="0"/>
|
||||
<TextBlock Text="条" Style="{StaticResource pageText}" Margin="0"/>
|
||||
</StackPanel>
|
||||
<!--页码选择-->
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Margin="20 0">
|
||||
<Button Content="首页" Style="{StaticResource pageButton}" Command="{Binding PageFirstCommand}"/>
|
||||
<Button Content="上一页" Style="{StaticResource pageButton}" Width="70" Command="{Binding PageBeforeCommand}" CommandParameter="{Binding PageSelected}"/>
|
||||
<!--<ItemsControl ItemsSource="{Binding Pages}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="{Binding Pages.Count}"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="btnPage" Content="{Binding}" Style="{StaticResource pageButtonSelectedColor}" Command="{Binding DataContext.PageClickCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding ElementName=btnPage,Path=Content}" CommandTarget="{Binding ElementName=taskHistoryDataGrid,Path=DataContext}"/>
|
||||
<Button x:Name="btnPage" Content="{Binding}" Style="{StaticResource pageButtonSelectedColor}" Command="{Binding ElementName=taskHistoryDataGrid, Path=DataContext.PageClickCommand}" CommandParameter="{Binding ElementName=btnPage,Path=Content}" CommandTarget="{Binding ElementName=taskHistoryDataGrid,Path=DataContext.PageClickCommand}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>-->
|
||||
<Button Content="下一页" Style="{StaticResource pageButton}" Width="70" Command="{Binding PageNextCommand}" CommandParameter="{Binding PageSelected}"/>
|
||||
<Button Content="尾页" Style="{StaticResource pageButton}" Command="{Binding PageLastCommand}"/>
|
||||
</StackPanel>
|
||||
<!--页码跳转-->
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal" Margin="50 0">
|
||||
<!--当前页数-->
|
||||
<TextBlock Text="{Binding PageInfo}" Style="{StaticResource pageText}" Margin="40 0"/>
|
||||
<Button Content="前往" Command="{Binding JumpPageClickCommand}" CommandParameter="{Binding ElementName=txtPageInput, Path=Text}"/>
|
||||
<TextBox x:Name="txtPageInput" Text="{Binding PageInput}" Width="30" HorizontalContentAlignment="Center" Style="{StaticResource MaterialDesignTextBox}" VerticalAlignment="Center" Margin="5 0"/>
|
||||
<TextBlock Text="页" Style="{StaticResource pageText}" Margin="0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
32
WPFWCSDemo/Views/TaskHistoryView.xaml.cs
Normal file
32
WPFWCSDemo/Views/TaskHistoryView.xaml.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
using WPFWCSDemo.ViewModels.DbViews;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// TaskHistoryView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TaskHistoryView : Page
|
||||
{
|
||||
public TaskHistoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new TaskHistoryViewModel();
|
||||
DataContext = new TaskHistoryDbViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
207
WPFWCSDemo/Views/TaskView.xaml
Normal file
207
WPFWCSDemo/Views/TaskView.xaml
Normal file
@@ -0,0 +1,207 @@
|
||||
<Page x:Class="WPFWCSDemo.Views.TaskView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:b="clr-namespace:System.Windows.Input;assembly=netstandard"
|
||||
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
||||
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodels:TaskViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="720" d:DesignWidth="1600"
|
||||
Title="TaskView">
|
||||
|
||||
<Page.Resources>
|
||||
<Style TargetType="ComboBox" BasedOn="{StaticResource MaterialDesignComboBox}">
|
||||
<Setter Property="MinWidth" Value="72"/>
|
||||
<Setter Property="IsEditable" Value="True"/>
|
||||
</Style>
|
||||
<Style x:Key="topComboBox" TargetType="ComboBox" BasedOn="{StaticResource MaterialDesignComboBox}">
|
||||
<Setter Property="IsEditable" Value="True"/>
|
||||
<Setter Property="Margin" Value="10,0"/>
|
||||
</Style>
|
||||
|
||||
</Page.Resources>
|
||||
|
||||
<!--弹出对话框-->
|
||||
<md:DialogHost>
|
||||
<!--右侧对话框弹出-->
|
||||
<!--右侧对话框弹出-->
|
||||
<!--右侧对话框弹出-->
|
||||
<md:DrawerHost IsRightDrawerOpen="{Binding IsRightDrawerOpen}" IsTopDrawerOpen="{Binding IsTopDrawerOpen}">
|
||||
<md:DrawerHost.RightDrawerContent>
|
||||
<DockPanel Width="300" LastChildFill="False">
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
|
||||
<Border Width="260" Height="40" HorizontalAlignment="Stretch" CornerRadius="8" Background="Orange" Margin="10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="2" ShadowDepth="2" Opacity=".3" Direction="300"/>
|
||||
</Border.Effect>
|
||||
<!--标题-->
|
||||
<TextBlock Text="新任务" FontSize="20" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Border>
|
||||
<!--提示信息-->
|
||||
<Button Content="{md:PackIcon Kind=InformationOutline}" BorderThickness="0" VerticalAlignment="Center" Background="DarkViolet" Padding="1" Width="20" Height="20" Opacity="0.3"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--选择任务类型-->
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="20">
|
||||
<TextBlock Text="状态:" VerticalAlignment="Center"/>
|
||||
<ComboBox Width="100" IsReadOnly="True" md:HintAssist.Hint="请选择" SelectedIndex="{Binding SelectedTaskTypeIndex}" HorizontalContentAlignment="Center">
|
||||
<ComboBoxItem Content="实垛"/>
|
||||
<ComboBoxItem Content="空托"/>
|
||||
<ComboBoxItem Content="进休息区"/>
|
||||
<ComboBoxItem Content="返回轨道"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<!--参数1-->
|
||||
<!--<TextBox md:HintAssist.Hint="请输入托盘条码" Text="{Binding InputPalletId}" Margin="20" DockPanel.Dock="Top"/>-->
|
||||
<!--参数2-->
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="20">
|
||||
<TextBlock Text="取货站点" FontSize="14" Foreground="Silver" VerticalAlignment="Center"/>
|
||||
<ComboBox md:HintAssist.Hint="" MinWidth="160" ItemsSource="{Binding .}" Text="{Binding SelectedSourceLocation}" Margin="20 0 0 0" HorizontalContentAlignment="Center">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding .}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!--参数3-->
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="20">
|
||||
<TextBlock Text="目标站点" FontSize="14" Foreground="Silver" VerticalAlignment="Center"/>
|
||||
<DockPanel LastChildFill="False" DockPanel.Dock="Top" Margin="20 10">
|
||||
<ComboBox md:HintAssist.Hint="" MinWidth="160" Text="{Binding SelectedTargetLocation}" SelectedValue="{Binding SelectedTargetLocation}" HorizontalContentAlignment="Center"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
|
||||
<Button Content="添加任务" Margin="20" DockPanel.Dock="Top" Command="{Binding AddTaskCommand}"/>
|
||||
</DockPanel>
|
||||
</md:DrawerHost.RightDrawerContent>
|
||||
|
||||
<!--顶部弹出面板-->
|
||||
<!--顶部弹出面板-->
|
||||
<!--顶部弹出面板-->
|
||||
<md:DrawerHost.TopDrawerContent>
|
||||
<Border>
|
||||
<DockPanel Height="70" Margin="0,-10,0,0">
|
||||
<Border Width="160" CornerRadius="15" Background="Orange" Margin="0,10,50,10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="2" ShadowDepth="2" Opacity=".3" Direction="300"/>
|
||||
</Border.Effect>
|
||||
<TextBlock Text="环穿测试" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" FontWeight="Bold"/>
|
||||
</Border>
|
||||
<TextBlock Text="任务类型:" Foreground="Gray" VerticalAlignment="Center"/>
|
||||
<ListBox SelectedIndex="{Binding TestingTaskTypeIndex,Mode=TwoWay}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" Margin="0,0,30,0">
|
||||
<ListBoxItem Content="常规任务"/>
|
||||
<ListBoxItem Content="进入休息区"/>
|
||||
<ListBoxItem Content="返回轨道"/>
|
||||
</ListBox>
|
||||
<!--编号-->
|
||||
<StackPanel Orientation="Horizontal" Margin="30 0 30 0">
|
||||
<TextBlock Text="小车编号:" VerticalAlignment="Center" Foreground="Gray"/>
|
||||
<ComboBox DockPanel.Dock="Left" md:HintAssist.Hint="Numbers..." MinWidth="60" HorizontalContentAlignment="Center" ItemsSource="{Binding RGVNumbers}" SelectedValue="{Binding SelectedRGVNumber}" Style="{StaticResource topComboBox}"/>
|
||||
</StackPanel>
|
||||
<!--取货站点-->
|
||||
<StackPanel Orientation="Horizontal" Margin="10 0 0 0">
|
||||
<TextBlock Text="取货站点:" VerticalAlignment="Center" Foreground="Gray" Margin="10,0"/>
|
||||
<ComboBox DockPanel.Dock="Left" md:HintAssist.Hint="Sources..." MinWidth="120" HorizontalContentAlignment="Center" ItemsSource="{Binding .}" Text="{Binding SelectedSourceLocation}" Style="{StaticResource topComboBox}"/>
|
||||
</StackPanel>
|
||||
<!--目标站点-->
|
||||
<StackPanel Orientation="Horizontal" Margin="30 0 -20 0">
|
||||
<TextBlock Text="目标站点:" VerticalAlignment="Center" Foreground="Gray" Margin="0,0"/>
|
||||
<ComboBox DockPanel.Dock="Left" md:HintAssist.Hint="Targets..." MinWidth="120" HorizontalContentAlignment="Center" ItemsSource="{Binding .}" Text="{Binding SelectedTargetLocation}" Style="{StaticResource topComboBox}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Width="120" Content="下发任务" BorderThickness="0" Margin="10,0" Command="{Binding SendRGVTestCommand}"/>
|
||||
<Button Width="120" Content="清空" Background="GhostWhite" BorderThickness="0" Foreground="DarkOrange" Margin="10,0" Command="{Binding TestClearCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</md:DrawerHost.TopDrawerContent>
|
||||
|
||||
|
||||
<!--主页面内容-->
|
||||
<!--主页面内容-->
|
||||
<!--主页面内容-->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="调度任务" Style="{StaticResource screenTitle}"/>
|
||||
<!--调度任务窗口顶部导航栏-->
|
||||
<DockPanel Grid.Row="1" LastChildFill="True">
|
||||
<StackPanel Orientation="Horizontal" Margin="50,10">
|
||||
<!--<TextBlock Text="列名:" VerticalAlignment="Center" Margin="10"/>
|
||||
<ComboBox Text="{Binding ColumnName,Mode=TwoWay}" IsReadOnly="True" HorizontalContentAlignment="Center" Width="150" ItemsSource="{Binding ColumnList}" md:ComboBoxAssist.MaxLength="2" md:HintAssist.Hint="Search" md:HintAssist.HintOpacity=".26"/>
|
||||
<TextBlock Text="关键字:" VerticalAlignment="Center" Margin="10 0 0 0"/>
|
||||
<TextBox x:Name="tbQuery" Text="{Binding Keywords,Mode=TwoWay}" HorizontalContentAlignment="Left" Width="150" md:HintAssist.Hint="Search..." md:TextFieldAssist.HasClearButton="True" Margin="10"/>-->
|
||||
<!--<ListBox SelectedIndex="{Binding TaskTypeSelectedIndex,Mode=TwoWay}" Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" Margin="10,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding TaskTypeSelectItemChangedCommand}"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<ListBoxItem Content=" 默认 "/>
|
||||
<ListBoxItem Content="常规任务"/>
|
||||
<ListBoxItem Content="其他任务"/>
|
||||
</ListBox>-->
|
||||
<!--<Button Width="100" Content="查询" Command="{Binding QueryCommand}" Margin="20,0" IsDefault="True"/>-->
|
||||
<Button Width="200" Content="重置/刷新" BorderThickness="0" Style="{StaticResource MaterialDesignPaperDarkButton}" Command="{Binding ClearCommand}"/>
|
||||
<!--<Button Width="100" Content="测试" Background="White" Foreground="BlueViolet" Command="{Binding TaskFinishCommand}"/>-->
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="40,0">
|
||||
<!--<Button x:Name="btnScheduleHistory" HorizontalAlignment="Right" Content="历史记录" Command="{Binding ScheduleHistoryCommand}" Margin="10"/>-->
|
||||
<Button x:Name="btnOrder" HorizontalAlignment="Right" Content="环穿写入测试" Command="{Binding StackerTestingCommand}" Background="Orange" Foreground="Black" BorderBrush="Orange" Margin="10"/>
|
||||
<Button x:Name="btnAdd" HorizontalAlignment="Right" Content="+ 添加任务" Command="{Binding NewTaskCommand}" Margin="10"/>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
|
||||
<!--表格区域-->
|
||||
<DataGrid x:Name="myDataGrid" Grid.Row="2" Height="670" GridLinesVisibility="None" VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="False" AlternatingRowBackground="Lavender" Margin="50,0,50,20" VerticalContentAlignment="Center" ItemsSource="{Binding TaskView}" RowHeight="50" ColumnHeaderStyle="{StaticResource MaterialDesignRaisedButton}" AutoGenerateColumns="False" ColumnHeaderHeight="50" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="Cell" >
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="环穿编号" Binding="{Binding JobId}" Width="*"/>
|
||||
<DataGridTextColumn Header="任务号" Binding="{Binding TaskId}" Width="1.2*"/>
|
||||
<DataGridTextColumn Header="任务类型" Binding="{Binding TaskType}" Width="*"/>
|
||||
<DataGridTextColumn Header="源站点" Binding="{Binding SourceLocation}" Width="*"/>
|
||||
<DataGridTextColumn Header="目标站点" Binding="{Binding TargetLocation}" Width="*"/>
|
||||
<DataGridTextColumn Header="任务状态" Binding="{Binding TaskState}" Width="1.2*"/>
|
||||
<DataGridTextColumn Header="调度状态" Binding="{Binding ScheduleState}" Width="2*"/>
|
||||
<DataGridTextColumn Header="生成时间" Binding="{Binding CreateTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
||||
<DataGridTextColumn Header="调度时间" Binding="{Binding ScheduleTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
||||
<!--<DataGridTextColumn Header="取货状态" Binding="{Binding ReportState}" Width="100"/>-->
|
||||
<DataGridTemplateColumn Header="人工处理" Width="3*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 0">
|
||||
<Button Content="完成" FontSize="12" Background="SeaGreen" BorderThickness="0" Width="60" Command="{Binding DataContext.TaskFinishCommand,ElementName=myDataGrid}" CommandParameter="{Binding TaskId}"/>
|
||||
<Button Content="取消" FontSize="12" Background="Crimson" BorderThickness="0" Width="60" Command="{Binding DataContext.TaskDeleteCommand,ElementName=myDataGrid}" CommandParameter="{Binding TaskId}" Margin="10,0"/>
|
||||
<Button Content="重新下发" FontSize="12" Background="DarkOrange" BorderThickness="0" Width="90" Command="{Binding DataContext.UpdateTaskStateToReadyCommand,ElementName=myDataGrid}" CommandParameter="{Binding TaskId}" Margin="0 0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</md:DrawerHost>
|
||||
</md:DialogHost>
|
||||
|
||||
</Page>
|
||||
33
WPFWCSDemo/Views/TaskView.xaml.cs
Normal file
33
WPFWCSDemo/Views/TaskView.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
using WPFWCSDemo.ViewModels;
|
||||
using WPFWCSDemo.ViewModels.DbViews;
|
||||
|
||||
namespace WPFWCSDemo.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// TaskView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TaskView : Page
|
||||
{
|
||||
public TaskView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new TaskViewModel();
|
||||
DataContext = new TaskDbViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user