MainWindow.xaml 27.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
<Window
    x:Class="RCS.WinClient.Views.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:MyNamespace="clr-namespace:RCS.WinClient"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:RCS.WinClient.Views"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    Title="木牛流马配送"
    Width="1300"
    Height="700"
    AllowsTransparency="True"
    Background="Transparent"
    Closed="Window_Closed"
    Loaded="Window_Loaded"
    ResizeMode="CanResizeWithGrip"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    mc:Ignorable="d">
    <!--  Icon="/RCS.WinClient;component/Page/Icon.ico"  -->
    <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="0" ResizeBorderThickness="2" />
    </WindowChrome.WindowChrome>

    <Border>
        <Grid
            x:Name="LayoutRoot"
            Margin="2"
            Background="White">
            <Grid.ColumnDefinitions>
                <!--<ColumnDefinition Width="*"></ColumnDefinition>-->
                <ColumnDefinition Width="3*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
            <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 BorderBrush="{StaticResource HHLGRed}" BorderThickness="1">
                                <Button
                                    x:Name="BtnRotote"
                                    Background="White"
                                    Click="BtnRotote_Click">
                                    变化方向
                                </Button>
                            </Border>-->
                            <Border BorderBrush="{StaticResource HHLGRed}" BorderThickness="1">
                                <Button
                                    x:Name="BtnReset"
                                    Background="White"
                                    Click="BtnReset_Click">
                                    复位
                                </Button>
                            </Border>
                            <Border BorderBrush="{StaticResource HHLGRed}" BorderThickness="1">
                                <Button
                                    x:Name="BtnPrint"
                                    Background="White"
                                    Click="BtnPrint_Click">
                                    打印
                                </Button>
                            </Border>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid Grid.Row="1" Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Name="PathLayOut1" Height="*" />
                        </Grid.RowDefinitions>
                        <Border BorderBrush="Black" BorderThickness="1">
                            <ScrollViewer
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                HorizontalScrollBarVisibility="Auto">
                                <Canvas
                                    x:Name="Canvas_Top"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    Background="White"
                                    MouseDown="MonitorPanel_MouseDown"
                                    MouseMove="MonitorPanel_MouseMove"
                                    MouseUp="MonitorPanel_MouseUp"
                                    MouseWheel="Canvas_Monitor_MouseWheel">
                                    <Canvas x:Name="Canvas_Monitor" Background="White" />
                                </Canvas>

                            </ScrollViewer>
                        </Border>
                    </Grid>
                </TabItem>
            </TabControl>

            <Grid
                Name="Spl_title"
                Grid.Row="0"
                Grid.ColumnSpan="3">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="auto" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <!--<Image
                    Height="25"
                    Cursor="Hand"
                    MouseLeftButtonDown="Image_MouseLeftButtonDown"
                    Source="pack://application:,,,/Page/logo-ok.png" />-->
                <Button
                    Name="BtnMin"
                    Grid.Column="1"
                    Width="20"
                    Margin="2"
                    HorizontalAlignment="Center"
                    Background="{StaticResource HHLGRed}"
                    Click="BtnMin_Click"
                    Foreground="White">
                    -
                </Button>
                <Button
                    Name="BtnMax"
                    Grid.Column="2"
                    Width="20"
                    Margin="2"
                    Background="{StaticResource HHLGRed}"
                    Click="BtnMax_Click"
                    Foreground="White">
                    <Button.Content>
                        <Rectangle
                            Width="10"
                            Height="10"
                            Fill="White" />
                    </Button.Content>
                </Button>
                <Button
                    Name="BtnClose"
                    Grid.Column="3"
                    Width="20"
                    Margin="2"
                    Background="{StaticResource HHLGRed}"
                    Click="BtnClose_Click"
                    Foreground="White">
                    X
                </Button>
                <StackPanel
                    Grid.Row="1"
                    Grid.ColumnSpan="7"
                    Height="40"
                    ButtonBase.Click="StackPanel_Click"
                    Orientation="Horizontal"
                    Style="{StaticResource TitleAreaStyle}">
                    <Button
                        Name="Btn_AgvInfoView"
                        Margin="2"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <Button
                                    Name="AgvInfoOpen"
                                    VerticalAlignment="Center"
                                    Foreground="White">
                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <TextBlock Text="AGV信息" />
                                        </ControlTemplate>
                                    </Button.Template>
                                    <Button.Triggers>
                                        <EventTrigger RoutedEvent="MouseRightButtonDown">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation
                                                        Storyboard.TargetName="tt"
                                                        Storyboard.TargetProperty="X"
                                                        Duration="0:0:0.1" />
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </Button.Triggers>
                                </Button>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button
                        Name="Btn_TaskManager"
                        Margin="2"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel
                                    Width="30"
                                    Height="30"
                                    VerticalAlignment="Center"
                                    Background="{StaticResource TaskManager}" />
                                <TextBlock VerticalAlignment="Center">任务管理</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button
                        Name="Btn_MachineManager"
                        Margin="2"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel
                                    Width="30"
                                    Height="30"
                                    VerticalAlignment="Center"
                                    Background="{StaticResource Organization}" />
                                <TextBlock VerticalAlignment="Center">机构管理</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button
                        Name="Btn_Test"
                        Margin="2"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel
                                    Width="30"
                                    Height="30"
                                    VerticalAlignment="Center"
                                    Background="{StaticResource ManuTask}" />
                                <TextBlock VerticalAlignment="Center">手动任务</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button
                        Name="Btn_Parameter"
                        Margin="2"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel
                                    Width="30"
                                    Height="30"
                                    VerticalAlignment="Center"
                                    Background="{DynamicResource Organization}" />
                                <TextBlock VerticalAlignment="Center">参数配置</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button
                        Name="Btn_History"
                        Margin="2"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel
                                    Width="30"
                                    Height="30"
                                    VerticalAlignment="Center"
                                    Background="{DynamicResource Organization}" />
                                <TextBlock VerticalAlignment="Center">历史任务</TextBlock>
                            </StackPanel>
                        </Button.Content>
                    </Button>
                    <Button
                        Name="Btn_LogInfoView"
                        Margin="2"
                        Content="日志信息"
                        Cursor="Hand"
                        Style="{StaticResource TitleButton}"
                        Visibility="Visible" />
                </StackPanel>
            </Grid>
            <Grid Grid.Row="2" Grid.ColumnSpan="3">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <StackPanel Height="2" Background="{StaticResource HHLGRed}" />
                <TextBlock
                    Grid.Row="1"
                    HorizontalAlignment="Center"
                    FontFamily="Times New Roman"
                    Foreground="{StaticResource HHAst2}"
                    Text="控制台系统" />
            </Grid>
            <Border
                Grid.Row="1"
                Width="790"
                Margin="-0,60,-5,600"
                HorizontalAlignment="Left"
                Background="Transparent"
                CornerRadius="0,5,5,0">
                <Border.RenderTransform>
                    <TranslateTransform x:Name="tt" X="-800" />
                </Border.RenderTransform>
                <!--  阴影  -->
                <Border.Effect>
                    <DropShadowEffect
                        BlurRadius="5"
                        Direction="180"
                        Opacity="0.3"
                        ShadowDepth="0"
                        Color="Gray" />
                </Border.Effect>
                <Grid Grid.Row="0" Margin="0,-30,0,0">
                    <StackPanel Name="Sp_Singal">
                        <Expander
                            Name="Exp_SignalMonit"
                            Height="180"
                            HorizontalContentAlignment="Stretch"
                            BorderBrush="{StaticResource HHLGRed}"
                            IsExpanded="True">
                            <Expander.Header>
                                <Grid>
                                    <Border BorderThickness="1">
                                        <TextBlock
                                            Width="{Binding ElementName=Exp_SignalMonit, Path=ActualWidth}"
                                            Background="{StaticResource HHLGRed}"
                                            FontWeight="Heavy"
                                            Foreground="White">
                                            AGV监控
                                        </TextBlock>
                                    </Border>
                                    <Button
                                        Name="AgvInfoClose"
                                        Width="30"
                                        Height="20"
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Top"
                                        BorderThickness="0"
                                        Content="X" />
                                </Grid>
                            </Expander.Header>
                            <ScrollViewer VerticalScrollBarVisibility="Visible">
                                <DataGrid
                                    Name="DGrid_Agv"
                                    HorizontalAlignment="Stretch"
                                    AutoGenerateColumns="False"
                                    Background="Transparent"
                                    CanUserAddRows="False"
                                    CanUserDeleteRows="False"
                                    CanUserResizeColumns="False"
                                    GridLinesVisibility="Vertical"
                                    MouseLeftButtonDown="DataGrid_MouseLeftDown"
                                    RowDetailsVisibilityChanged="DataGrid_RowDetailsVisibilityChanged"
                                    SelectionChanged="DGrid_Agv_SelectionChanged">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn
                                            Binding="{Binding Path=AgvNo}"
                                            CanUserSort="False"
                                            Header="AGV编号"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=Barcode}"
                                            CanUserSort="False"
                                            Header="RCS地标"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=RCSBarcode}"
                                            CanUserSort="False"
                                            Header="AGV地标"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=SensorStatus}"
                                            CanUserSort="False"
                                            Header="货物状态"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=AgvState}"
                                            CanUserSort="False"
                                            Header="AGV状态"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=AgvDirectionByMap}"
                                            CanUserSort="False"
                                            Header="车头方向"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=ActState}"
                                            CanUserSort="False"
                                            Header="动作状态"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=AgvHeight}"
                                            CanUserSort="False"
                                            Header="顶升高度"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=HeightState}"
                                            CanUserSort="False"
                                            Header="顶升状态"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=Voltage}"
                                            CanUserSort="False"
                                            Header="电量"
                                            IsReadOnly="True" />
                                        <DataGridCheckBoxColumn
                                            Binding="{Binding Path=IsOnline}"
                                            CanUserSort="False"
                                            Header="在线"
                                            IsReadOnly="True" />
                                        <DataGridCheckBoxColumn
                                            Binding="{Binding Path=IsEnable}"
                                            CanUserSort="False"
                                            Header="存在"
                                            IsReadOnly="True" />
                                        <DataGridTextColumn
                                            Binding="{Binding Path=Heart, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}"
                                            CanUserSort="False"
                                            Header="心跳接收"
                                            IsReadOnly="True" />
                                    </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>-->
                                            <MenuItem
                                                Name="MItem_LoaclAGV"
                                                Click="MItem_LoaclAGV_Click"
                                                Header="定位AGV位置" />
                                        </ContextMenu>
                                    </DataGrid.ContextMenu>
                                    <DataGrid.RowDetailsTemplate>
                                        <DataTemplate>
                                            <Border
                                                x:Name="Border_AGVDetails"
                                                Width="auto"
                                                Height="auto"
                                                Margin="2"
                                                BorderBrush="Black"
                                                BorderThickness="1,1,1,1">
                                                <StackPanel Width="auto" Height="auto">
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock>正在执行任务号:</TextBlock>
                                                        <TextBlock Text="{Binding Path=AgvTask.TaskNo}" />
                                                    </StackPanel>
                                                    <TextBlock>停车原因:</TextBlock>
                                                    <TextBlock Text="{Binding Path=StopReason}" TextWrapping="Wrap" />
                                                    <TextBlock>故障信息:</TextBlock>
                                                    <TextBlock Text="{Binding Path=Error}" TextWrapping="Wrap" />
                                                </StackPanel>
                                            </Border>
                                        </DataTemplate>
                                    </DataGrid.RowDetailsTemplate>
                                </DataGrid>
                            </ScrollViewer>
                        </Expander>
                    </StackPanel>
                </Grid>
            </Border>
            <Grid Name="StackMsg" Grid.Row="2">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <StackPanel Name="Canvas_ErrMsg" Grid.Column="0">
                    <StackPanel>
                        <StackPanel Height="2" Background="{StaticResource HHLGRed}" />
                        <TabControl>
                            <TabItem Header="异常信息">
                                <TextBox
                                    Name="TBox_EMessage"
                                    MinHeight="100"
                                    MaxHeight="100"
                                    IsReadOnly="True"
                                    ScrollViewer.VerticalScrollBarVisibility="Visible"
                                    TextWrapping="Wrap">
                                    <TextBox.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Click="TBox_EMessage_Clear_Click" Header="清除异常信息" />
                                        </ContextMenu>
                                    </TextBox.ContextMenu>
                                </TextBox>
                            </TabItem>
                        </TabControl>
                    </StackPanel>
                </StackPanel>
                <StackPanel Name="Canvas_BussErrMsg" Grid.Column="1">
                    <StackPanel>
                        <StackPanel Height="2" Background="{StaticResource HHLGRed}" />
                        <TabControl>
                            <TabItem Header="失败信息">
                                <TextBox
                                    Name="TBox_BussErrMsg"
                                    MinHeight="100"
                                    MaxHeight="100"
                                    IsReadOnly="True"
                                    ScrollViewer.VerticalScrollBarVisibility="Visible"
                                    TextWrapping="Wrap">
                                    <TextBox.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Click="TBox_BussErrMsg_Clear_Click" Header="清除异常信息" />
                                        </ContextMenu>
                                    </TextBox.ContextMenu>
                                </TextBox>
                            </TabItem>
                        </TabControl>
                    </StackPanel>
                </StackPanel>
            </Grid>


        </Grid>
    </Border>
    <Window.Resources>

        <ResourceDictionary>
            <Style x:Key="GridStyle" TargetType="Grid">
                <Setter Property="Visibility" Value="Collapsed" />
            </Style>
            <Storyboard x:Key="AgvViewOpen">
                <DoubleAnimation
                    Storyboard.TargetName="tt"
                    Storyboard.TargetProperty="X"
                    To="0"
                    Duration="0:0:0.2" />
            </Storyboard>
            <Storyboard x:Key="AgvViewClose">
                <DoubleAnimation
                    Storyboard.TargetName="tt"
                    Storyboard.TargetProperty="X"
                    Duration="0:0:0.1" />
            </Storyboard>

        </ResourceDictionary>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="Button.Click" SourceName="AgvInfoOpen">
            <BeginStoryboard Storyboard="{StaticResource AgvViewOpen}" />
        </EventTrigger>
        <EventTrigger RoutedEvent="Button.Click" SourceName="AgvInfoClose">
            <BeginStoryboard Storyboard="{StaticResource AgvViewClose}" />
        </EventTrigger>
    </Window.Triggers>
</Window>