MainWindow.xaml 17.7 KB
<Window x:Class="XingYe_ACS.MainWindow"
        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:MyNamespace="clr-namespace:XingYe_ACS"
        xmlns:local="clr-namespace:XingYe_ACS"
        mc:Ignorable="d"
        Title="木牛流马配送" Height="700" Width="1300"  
        WindowStartupLocation="CenterOwner" WindowStyle="None"
        AllowsTransparency="True" Background="Transparent"
        Loaded="Window_Loaded"
        Closed="Window_Closed" Icon="/XingYe_ACS;component/Image/Icon.ico">
    <Border>
        <Grid x:Name="LayoutRoot" Background="White" Margin="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="324*"></ColumnDefinition>
                <ColumnDefinition Width="469*"></ColumnDefinition>
                <ColumnDefinition Width="503*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Name="Sp_Singal" Grid.Column="0" Grid.Row="1">
                <Expander  Name="Exp_SignalMonit" Grid.Row="2" BorderBrush="{StaticResource HHLGRed}" IsExpanded="True" 
                               Height="{Binding ElementName=Sp_Singal, Path=ActualHeight}">
                    <Expander.Header>
                        <Border BorderThickness="1">
                            <TextBlock Foreground="White" Width="{Binding ElementName=Exp_SignalMonit, Path=ActualWidth}" FontWeight="Heavy" Background="{StaticResource HHLGRed}">信号监控</TextBlock>
                        </Border>
                    </Expander.Header>
                    <ScrollViewer VerticalScrollBarVisibility="Visible">
                        <DataGrid Name="DGrid_Agv" CanUserAddRows="False"  AutoGenerateColumns="False" Background="Transparent"
                              CanUserDeleteRows="False"
                              GridLinesVisibility="Vertical">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="AGV编号" Binding="{Binding Path=strAgvNo}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                                <DataGridTextColumn Header="码值" Binding="{Binding Path=strBarcode}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                                <DataGridTextColumn Header="距离" Binding="{Binding Path=intRunDistance}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                                <DataGridTextColumn Header="电量" Binding="{Binding Path=currentCharge}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                                <DataGridTextColumn Header="顶升" Binding="{Binding Path=heightState}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                                <DataGridTextColumn Header="AGV状态" Binding="{Binding Path=agvState}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                                <DataGridCheckBoxColumn Header="在线" Binding="{Binding Path=isOnline}" IsReadOnly="True" CanUserSort="False"></DataGridCheckBoxColumn>
                                <DataGridCheckBoxColumn Header="存在" Binding="{Binding Path=isEnable}" IsReadOnly="True" CanUserSort="False"></DataGridCheckBoxColumn>
                                <DataGridTextColumn Header="心跳接收" Binding="{Binding Path=agvHeart}" IsReadOnly="True" CanUserSort="False"></DataGridTextColumn>
                            </DataGrid.Columns>
                            <DataGrid.ContextMenu>
                                <ContextMenu>
                                    <!--<MenuItem Name="MItem_DisplayPath" Header="显示路径" Click="MItem_DisplayPath_Click"></MenuItem>
                                    <MenuItem Name="MItem_HidePath" Header="隐藏路径" Click="MItem_HidePath_Click"></MenuItem>-->
                                </ContextMenu>
                            </DataGrid.ContextMenu>
                            <DataGrid.RowDetailsTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="1" BorderBrush="Black" Margin="2">
                                        <StackPanel>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock>正在执行任务号:</TextBlock>
                                                <TextBlock Text="{Binding Path=agvTask.strTaskNo}"></TextBlock>
                                            </StackPanel>
                                            <TextBlock>停车原因:</TextBlock>
                                            <TextBlock TextWrapping="Wrap" Text="{Binding Path= strStopReason}"></TextBlock>
                                            <TextBlock>故障信息:</TextBlock>
                                            <TextBlock TextWrapping="Wrap" Text="{Binding Path= strAgvError}"></TextBlock>
                                        </StackPanel>
                                    </Border>
                                </DataTemplate>
                            </DataGrid.RowDetailsTemplate>
                        </DataGrid>
                    </ScrollViewer>
                </Expander>

            </StackPanel>
            <TabControl Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2">
                <TabItem>
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Border BorderBrush="{StaticResource HHLGRed}" BorderThickness="1">
                                <TextBlock>监控界面</TextBlock>
                            </Border>
                            <Border  BorderThickness="1" BorderBrush="{StaticResource HHLGRed}">
                                <TextBlock  Name="TextBlock_OnLineAgvCount" Foreground="White" Width="auto" Background="{StaticResource HHLGRed}">|</TextBlock>
                            </Border>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid Grid.Row="1" Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Name="PathLayOut1" Height="*"></RowDefinition>
                            <RowDefinition Name="PathLayOut2" Height="137"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Border BorderThickness="1" BorderBrush="Black">
                            <ScrollViewer HorizontalScrollBarVisibility="Auto">
                                <Canvas Name="Canvas_Monitor">
                                </Canvas>
                            </ScrollViewer>
                        </Border>
                        <Grid Name="StackMsg" Grid.Row="2" Grid.ColumnSpan="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <StackPanel Name="Canvas_ErrMsg" Grid.Column="0">
                                <StackPanel>
                                    <StackPanel Background="{StaticResource HHLGRed}" Height="2"></StackPanel>
                                    <TabControl>
                                        <TabItem Header="异常信息">
                                            <TextBox Name="TBox_EMessage" TextWrapping="Wrap" MinHeight="100" MaxHeight="100" ScrollViewer.VerticalScrollBarVisibility="Visible" IsReadOnly="True">
                                                <TextBox.ContextMenu>
                                                    <ContextMenu>
                                                        <MenuItem Header="清除异常信息" Click="TBox_EMessage_Clear_Click"></MenuItem>
                                                    </ContextMenu>
                                                </TextBox.ContextMenu>
                                            </TextBox>
                                        </TabItem>
                                    </TabControl>
                                </StackPanel>
                            </StackPanel>
                            <StackPanel Name="Canvas_BussErrMsg"  Grid.Column="1">
                                <StackPanel>
                                    <StackPanel Background="{StaticResource HHLGRed}" Height="2"></StackPanel>
                                    <TabControl>
                                        <TabItem Header="失败信息">
                                            <TextBox Name="TBox_BussErrMsg" TextWrapping="Wrap" MinHeight="100" MaxHeight="100" ScrollViewer.VerticalScrollBarVisibility="Visible" IsReadOnly="True">
                                                <TextBox.ContextMenu>
                                                    <ContextMenu>
                                                        <MenuItem Header="清除异常信息" Click="TBox_BussErrMsg_Clear_Click"></MenuItem>
                                                    </ContextMenu>
                                                </TextBox.ContextMenu>
                                            </TextBox>
                                        </TabItem>
                                    </TabControl>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </TabItem>
            </TabControl>

            <Grid  Name="Spl_title" Grid.Row="0" Grid.ColumnSpan="3">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition Width="auto"></ColumnDefinition>
                    <ColumnDefinition Width="auto"></ColumnDefinition>
                    <ColumnDefinition Width="auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Image Height="40"
                       MouseLeftButtonDown="Image_MouseLeftButtonDown"  Source="Image/华恒logo-ok.png"></Image>
                <Button Name="BtnMin" Click="BtnMin_Click" HorizontalAlignment="Center" Grid.Column="1" Background="{StaticResource HHLGRed}" Foreground="White"  Width="20" Margin="2">-</Button>
                <Button Name="BtnMax" Click="BtnMax_Click" Grid.Column="2" Background="{StaticResource HHLGRed}" Foreground="White"  Width="20" Margin="2">
                    <Button.Content>
                        <Rectangle Height="10" Width="10" Fill="White"></Rectangle>
                    </Button.Content>
                </Button>
                <Button Name="BtnClose" Grid.Column="3" Background="{StaticResource HHLGRed}" Foreground="White"  Width="20" Margin="2" Click="BtnClose_Click">X</Button>
                <StackPanel Grid.Row="1" Grid.ColumnSpan="7" Height="40" Orientation="Horizontal" Style="{StaticResource TitleAreaStyle}"  ButtonBase.Click="StackPanel_Click">
                    <Button Name="Btn_UserManager" Style="{StaticResource TitleButton}" Margin="2" Visibility ="Collapsed">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource User}">
                                    <StackPanel.RenderTransform>
                                        <SkewTransform AngleX="0"></SkewTransform>
                                    </StackPanel.RenderTransform>
                                </StackPanel>
                                <TextBlock VerticalAlignment="Center">用户管理</TextBlock>
                            </StackPanel>
                        </Button.Content>
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                    </Button>
                    <Button Name="Btn_CposManager" Style="{StaticResource TitleButton}" Margin="2" Visibility ="Collapsed">
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource CposManager}"></StackPanel>
                                <TextBlock VerticalAlignment="Center">库位管理</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button Name="Btn_TaskManager" Style="{StaticResource TitleButton}" Margin="2"  Visibility ="Visible">
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource TaskManager}" VerticalAlignment="Center"></StackPanel>
                                <TextBlock VerticalAlignment="Center">任务管理</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button Name="Btn_MachineManager" Style="{StaticResource TitleButton}" Margin="2" Visibility ="Visible">
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource Organization}" VerticalAlignment="Center"></StackPanel>
                                <TextBlock VerticalAlignment="Center">机构管理</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button Name="Btn_Goods" Style="{StaticResource TitleButton}" Margin="2" Visibility="Collapsed">物料管理
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                    </Button>
                    <Button Name="Btn_History" Style="{StaticResource TitleButton}" Margin="2" Visibility ="Collapsed">
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource History}" VerticalAlignment="Center"></StackPanel>
                                <TextBlock VerticalAlignment="Center">历史查询</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button Name="Btn_RunData" Style="{StaticResource TitleButton}" Margin="2" Visibility ="Collapsed">
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource RunData}" VerticalAlignment="Center"></StackPanel>
                                <TextBlock VerticalAlignment="Center">运行数据</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button Name="Btn_Test" Style="{StaticResource TitleButton}" Margin="2" Visibility ="Visible">
                        <Button.RenderTransform>
                            <SkewTransform AngleX="25"></SkewTransform>
                        </Button.RenderTransform>
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Height="30" Width="30" Background="{StaticResource ManuTask}" VerticalAlignment="Center"></StackPanel>
                                <TextBlock VerticalAlignment="Center">手动任务</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                </StackPanel>
            </Grid>
            <Grid Grid.Row="2" Grid.ColumnSpan="3">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <StackPanel Background="{StaticResource HHLGRed}" Height="2"></StackPanel>
                <TextBlock Grid.Row="1" HorizontalAlignment="Center" Foreground="{StaticResource HHAst2}"
                           FontFamily="Times New Roman" >控制台系统</TextBlock>
            </Grid>
        </Grid>
    </Border>
</Window>