领胜LDS 键盘AOI检测项目
xcd
2020-06-24 d6c577e17ee7bb5331dd51d803f9b42441b0f0e5
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
<Controls:MetroWindow x:Class="Bro.UI.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:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
                      Dialog:DialogParticipation.Register="{Binding}"
                      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
                      xmlns:sys="clr-namespace:System;assembly=mscorlib"
                      xmlns:local="clr-namespace:Bro.UI"
                      xmlns:CCtrls="clr-namespace:Bro.UI.Ctrls"
                      xmlns:converter="clr-namespace:Bro.UI.Converter"
                      xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
                      xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
                      xmlns:ignore="http://www.galasoft.ch/ignore"
                      mc:Ignorable="d ignore"
                      Height="600"
                      Width="800"
                      Title="{Binding WelcomeTitle}"
                      TitleAlignment="Center"
                      TitlebarHeight="30"
                      DataContext="{Binding Main, Source={StaticResource Locator}}" 
                      BorderThickness="0" 
                      GlowBrush="Black"
                      ResizeMode="CanResizeWithGrip"
                      WindowTransitionsEnabled="False"
                      RightWindowCommandsOverlayBehavior="Always" 
                      WindowState="Maximized" Icon="Logo.ico">
    <Controls:MetroWindow.Resources>
        <converter:InverseConverter x:Key="inverseConverter"/>
        <xcad:MetroTheme x:Key="metroTheme"/>
        <sys:String x:Key="pluse10">-10</sys:String>
    </Controls:MetroWindow.Resources>
 
    <Controls:MetroWindow.RightWindowCommands>
        <Controls:WindowCommands ShowLastSeparator="False">
            <Button>
                <StackPanel Orientation="Horizontal">
                    <iconPacks:PackIconModern Kind="User" />
                    <TextBlock Margin="4 0 0 0" VerticalAlignment="Center" Text="{Binding UserName}" />
                </StackPanel>
            </Button>
        </Controls:WindowCommands>
    </Controls:MetroWindow.RightWindowCommands>
    <Controls:MetroWindow.LeftWindowCommands>
        <Controls:WindowCommands>
            <ToggleButton IsChecked="{Binding ElementName=pFlyout, Path=IsOpen}">
                <StackPanel Orientation="Horizontal" Margin="20,0,0,0">
                    <iconPacks:PackIconModern Width="24" Height="24" Kind="BookOpenInformation" />
                    <TextBlock Margin="4,0,0,0" VerticalAlignment="Center">
                        <Run Text="当前产品:"/>
                        <Run Text="{Binding CurrentCode}"/>
                    </TextBlock>
                </StackPanel>
            </ToggleButton>
        </Controls:WindowCommands>
    </Controls:MetroWindow.LeftWindowCommands>
    <Controls:MetroWindow.Flyouts>
        <Controls:FlyoutsControl>
            <Controls:Flyout x:Name="pFlyout" Header="选择产品" Position="Left" CloseButtonIsCancel="False" CloseButtonVisibility="Visible" Theme="Accent" Width="300">
                <CCtrls:ProductionSelectionCtrl ProductionCodeSource="{Binding CodesSource}" CurrentProductionCode="{Binding CurrentCode, Mode=TwoWay}" IsEnableChangeProduction="{Binding IsProcessStopped,Mode=OneWay}"/>
            </Controls:Flyout>
        </Controls:FlyoutsControl>
    </Controls:MetroWindow.Flyouts>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="35"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0" Grid.Column="0">
            <Border BorderThickness="0" CornerRadius="10" Margin="4" BorderBrush="Transparent" x:Name="runningViewBorder">
                <!--<local:RunningView/>-->
            </Border>
        </Grid>
        <Expander Grid.Row="0" Grid.Column="1" IsExpanded="True" Height="{Binding ElementName=runningViewBorder,Path=ActualHeight, Converter={StaticResource simpleCalculation},ConverterParameter={StaticResource pluse10}}" ExpandDirection="Left" Margin="0,10,0,-9" Background="Transparent" BorderBrush="Transparent" VerticalAlignment="Center" VerticalContentAlignment="Stretch">
             <Grid Width="310" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="100"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" BorderThickness="2" CornerRadius="10" Margin="0,3,3,3" BorderBrush="Silver">
                    <xcad:DockingManager x:Name="_dockingManager" Margin="3,3,3,0" BorderThickness="1" Theme="{Binding Source={StaticResource metroTheme}}"
                           AllowMixedOrientation="True" >
                        <xcad:DockingManager.DocumentHeaderTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding IconSource}" Margin="0,0,4,0" />
                                    <TextBlock Text="{Binding Title}" Width="60" TextAlignment="Center"/>
                                </StackPanel>
                            </DataTemplate>
                        </xcad:DockingManager.DocumentHeaderTemplate>
                        <xcad:LayoutRoot x:Name="_layoutRoot">
                            <xcad:LayoutPanel Orientation="Vertical">
                                <xcad:LayoutDocumentPane DockWidth="*" ShowHeader="True" >
                                    <xcad:LayoutDocument ContentId="Info" Title="信息" CanClose="False">
                                        <!--<CCtrls:InfomationCtrl/>-->
                                        <Grid x:Name="gridInfo"/>
                                    </xcad:LayoutDocument>
                                    <xcad:LayoutDocument ContentId="Log" Title="日志" CanClose="False">
                                        <CCtrls:LogCtrl LogList="{Binding LogList}"/>
                                    </xcad:LayoutDocument>
                                    <xcad:LayoutDocument ContentId="Warning" Title="报警" CanClose="False">
                                    </xcad:LayoutDocument>
                                </xcad:LayoutDocumentPane>
                            </xcad:LayoutPanel>
                        </xcad:LayoutRoot>
                    </xcad:DockingManager>
                </Border>
                <Border Grid.Row="1" BorderThickness="2" CornerRadius="10" Margin="0,0,3,3" BorderBrush="Silver">
                    <CCtrls:OperationCtrl IsRunning="{Binding IsProcessStopped, Mode=OneWay,Converter={StaticResource inverseConverter}}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="RunHandler">
                                <i:InvokeCommandAction Command="{Binding Cmmd_Run}"/>
                            </i:EventTrigger>
                            <i:EventTrigger EventName="StopHandler">
                                <i:InvokeCommandAction Command="{Binding Cmmd_Stop}"/>
                            </i:EventTrigger>
                            <i:EventTrigger EventName="LoadHandler">
                                <i:InvokeCommandAction Command="{Binding Cmmd_Load}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </CCtrls:OperationCtrl>
                </Border>
            </Grid>
        </Expander>
        <StatusBar Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="32">
            <StackPanel Orientation="Horizontal" Margin="5,0,0,0">
                <CCtrls:DeviceStatusCtrl ScrollViewer.VerticalScrollBarVisibility="Hidden" DeviceList="{Binding DeviceList,Mode=OneWay}"/>
            </StackPanel>
        </StatusBar>
    </Grid>
</Controls:MetroWindow>