|
|
|
@ -9,51 +9,51 @@
|
|
|
|
|
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
<!-- 定义数据模板 -->
|
|
|
|
|
<DataTemplate x:Key="TaskTemplate">
|
|
|
|
|
<Border BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" Margin="2,5">
|
|
|
|
|
<StackPanel Margin="10,0,0,0">
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="站台号:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding conveyorno}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<DataTemplate x:Key="AGVStateTemplate">
|
|
|
|
|
<Border x:Name="StateBorder" BorderThickness="2" CornerRadius="5" Margin="2,5" >
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="100px"/>
|
|
|
|
|
<ColumnDefinition Width="170px"/>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Grid.Column="0" x:Name="AGVNameTextBlock" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding AgvName}" FontSize="20" FontWeight="Black" Margin="10,0,0,0"/>
|
|
|
|
|
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
|
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
|
|
|
|
<TextBlock Text="工作状态:" FontSize="18" Foreground="White" Margin="0,5,0,5"/>
|
|
|
|
|
<TextBlock Text="{Binding AgvWorkState}" FontSize="18" Foreground="White" Margin="0,5,0,5"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
|
|
|
|
<TextBlock Text="任务状态:" FontSize="18" Foreground="White" Margin="0,5,0,5"/>
|
|
|
|
|
<TextBlock Text="{Binding AgvTaskState}" FontSize="18" Foreground="White" Margin="0,5,0,5"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
|
|
|
|
<TextBlock Text="库存:" FontSize="18" Foreground="White" Margin="0,5,0,5"/>
|
|
|
|
|
<TextBlock Text="{Binding AgvCount}" FontSize="18" Foreground="White" Margin="0,5,0,5"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="航班号:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding flightno}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0">
|
|
|
|
|
<Button Content="入库" FontSize="14" Style="{StaticResource BUTTON_AGREE}"
|
|
|
|
|
Width="80" Height="30" Background="YellowGreen" BorderBrush="YellowGreen" Margin="0,0,0,0"
|
|
|
|
|
Command="{Binding DataContext.HandleTaskCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="任务号:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding taskno}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="任务状态:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding taskstate}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="AGV编号:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding agvno}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="总行李筐数量:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding totalcount}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="已装载筐数量:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
<TextBlock Text="{Binding loadcount}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,10">
|
|
|
|
|
<Button Content="待处理任务" FontSize="14" Style="{StaticResource BUTTON_AGREE}"
|
|
|
|
|
Width="80" Height="30" Background="YellowGreen" BorderBrush="YellowGreen" Margin="40,0,0,0"
|
|
|
|
|
Command="{Binding DataContext.HandleTaskCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
|
|
|
|
|
CommandParameter="{Binding}"/>
|
|
|
|
|
<Button Content="删除任务" FontSize="14" Style="{StaticResource BUTTON_AGREE}"
|
|
|
|
|
Width="80" Height="30" Background="Red" BorderBrush="Red" Margin="20,0,0,0"
|
|
|
|
|
Command="{Binding DataContext.DeleteTaskCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
|
|
|
|
|
CommandParameter="{Binding }"/>
|
|
|
|
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</Border>
|
|
|
|
|
<DataTemplate.Triggers>
|
|
|
|
|
<DataTrigger Binding="{Binding AgvAlarmState}" Value="正常">
|
|
|
|
|
<Setter TargetName="StateBorder" Property="BorderBrush" Value="#1254AB"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding AgvAlarmState}" Value="异常">
|
|
|
|
|
<Setter TargetName="StateBorder" Property="BorderBrush" Value="#FFFF3333"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding AgvType}" Value="1">
|
|
|
|
|
<Setter TargetName="AGVNameTextBlock" Property="Foreground" Value="#FF70E9F9"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding AgvType}" Value="2">
|
|
|
|
|
<Setter TargetName="AGVNameTextBlock" Property="Foreground" Value="#FF92FD4B"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
</DataTemplate.Triggers>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
|
|
<DataTemplate x:Key="LogMsgTemplate">
|
|
|
|
@ -77,23 +77,28 @@
|
|
|
|
|
<Border Grid.Row="0" BorderBrush="#1254AB" BorderThickness="2">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="6*"/>
|
|
|
|
|
<ColumnDefinition Width="4*"/>
|
|
|
|
|
<ColumnDefinition Width="5*"/>
|
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Border Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center">
|
|
|
|
|
<TextBlock Text="AGV状态列表" FontSize="24" Foreground="White" Margin="20,0,0,0"/>
|
|
|
|
|
<Border Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
|
|
<TextBlock Text="AGV状态列表" FontSize="24" Foreground="White" Margin="0,0,0,0"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,0,0,0">
|
|
|
|
|
<Button Content="维护" Command="{Binding AddTaskCommand}" FontSize="14"
|
|
|
|
|
Style="{StaticResource BUTTON_AGREE}" Width="50" Height="30"
|
|
|
|
|
Background="YellowGreen" BorderBrush="YellowGreen" Margin="0,0,0,0"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
|
|
|
|
|
<Border Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
|
|
|
|
|
<Button Content="一键入库" Command="{Binding AddTaskCommand}" FontSize="14"
|
|
|
|
|
Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30"
|
|
|
|
|
Background="YellowGreen" BorderBrush="YellowGreen" Margin="20,0,0,0"/>
|
|
|
|
|
Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,0,0"/>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="2" Margin="0,10,0,0">
|
|
|
|
|
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="0" Margin="0,10,0,0">
|
|
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
|
|
|
|
|
<ItemsControl ItemsSource="{Binding TaskItems}" ItemTemplate="{StaticResource TaskTemplate}" />
|
|
|
|
|
<ItemsControl ItemsSource="{Binding AgvStates}" ItemTemplate="{StaticResource AGVStateTemplate}" />
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
|
|
|
|
|
</Border>
|
|
|
|
@ -105,37 +110,105 @@
|
|
|
|
|
</Border.Background>-->
|
|
|
|
|
<Grid Margin="15,0">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="0.5*"/>
|
|
|
|
|
<RowDefinition Height="6.4*"/>
|
|
|
|
|
<RowDefinition Height="1*"/>
|
|
|
|
|
<RowDefinition Height="13*"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Border Grid.Row="0">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="2.22*"/>
|
|
|
|
|
<ColumnDefinition Width="1.11*"/>
|
|
|
|
|
<ColumnDefinition Width="2.22*"/>
|
|
|
|
|
<ColumnDefinition Width="1.11*"/>
|
|
|
|
|
<ColumnDefinition Width="2.22*"/>
|
|
|
|
|
<ColumnDefinition Width="1.11*"/>
|
|
|
|
|
<ColumnDefinition Width="7*"/>
|
|
|
|
|
<ColumnDefinition Width="1*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Border Grid.Column="1" >
|
|
|
|
|
<Button Content="" Command="{Binding ManualCallCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="YellowGreen" BorderBrush="YellowGreen"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Column="3">
|
|
|
|
|
<Button Content="手动入库" Command="{Binding ManualTerminateCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="Red" BorderBrush="Red"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Column="5">
|
|
|
|
|
|
|
|
|
|
<Border Grid.Column="1">
|
|
|
|
|
<Button Content="终止所有任务" Command="{Binding ResetCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="#FF9900" BorderBrush="#FF9900"/>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Row="1">
|
|
|
|
|
<DataGrid x:Name="AreaTaskDataGrid" Style="{DynamicResource DataGridStyle}" ColumnHeaderHeight="22" RowHeight="40" AutoGenerateColumns="False" RowHeaderWidth="0" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0">
|
|
|
|
|
<DataGrid.Resources>
|
|
|
|
|
<Style x:Key="DataGridStyle" TargetType="DataGrid">
|
|
|
|
|
<Setter Property="AlternationCount" Value="2"/>
|
|
|
|
|
<Setter Property="ColumnHeaderStyle" Value="{DynamicResource DataGridColumnHeaderStyle}"/>
|
|
|
|
|
<Setter Property="CellStyle" Value="{DynamicResource DataGridCellStyle}"/>
|
|
|
|
|
<Setter Property="RowStyle" Value="{DynamicResource DataGridRowStyle}"/>
|
|
|
|
|
</Style>
|
|
|
|
|
<Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="Background" Value="White"/>
|
|
|
|
|
</Style>
|
|
|
|
|
<Style x:Key="DataGridRowStyle" TargetType="{x:Type DataGridRow}">
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type DataGridRow}">
|
|
|
|
|
<Grid x:Name="DGR_Border" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
|
|
|
|
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"/>
|
|
|
|
|
<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter Property="BorderBrush" Value="#00BCD4"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="AlternationIndex" Value="0">
|
|
|
|
|
<Setter Property="Background" Value="#E9F3FD"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsNewItem" Value="True">
|
|
|
|
|
<Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
|
<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
|
|
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
|
|
|
|
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
|
|
|
|
|
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter Property="Foreground" Value="Gray"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</DataGrid.Resources>
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding id}" Header="编号" Width="60"/>
|
|
|
|
|
<!--<DataGridTextColumn Binding="{Binding MachineID}" Header="机台编号" Width="60"/>-->
|
|
|
|
|
<DataGridTextColumn Binding="{Binding taskno}" Header="任务编号" Width="*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding flightno}" Header="航班号" Width="*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding agvno}" Header="AGV" Width="0.6*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding amragvno}" Header="AMR" Width="0.6*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding taskstate}" Header="任务状态" Width="*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding totalcount}" Header="总抓取数量" Width="*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding loadcount}" Header="已抓取数量" Width="*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding starttime,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="开始时间" Width="*"/>
|
|
|
|
|
<DataGridTextColumn Binding="{Binding finishtime,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="完成时间" Width="*"/>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Grid.Column="2" BorderBrush="#1254AB" BorderThickness="0" CornerRadius="5" Background="Transparent">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="1*"/>
|
|
|
|
|
<RowDefinition Height="12*"/>
|
|
|
|
|
<RowDefinition Height="13*"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Border Grid.Row="0" BorderBrush="#1254AB" BorderThickness="2">
|
|
|
|
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Vertical">
|
|
|
|
|