123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <UserControl x:Class="Aitex.Sorter.UI.Views.TopView"
- 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:coreControl="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
- xmlns:controls="clr-namespace:Aitex.Sorter.UI.Controls"
- mc:Ignorable="d"
- Background="{StaticResource mainBackgroundColor}"
- d:DesignHeight="130" d:DesignWidth="1920" >
- <UserControl.Resources>
- <LinearGradientBrush x:Key="buttonNormal" StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#9cd7f7" Offset="0" />
- <GradientStop Color="#56b6e6" Offset="1" />
- </LinearGradientBrush>
- <SolidColorBrush x:Key="buttonForground" Color="#035092"></SolidColorBrush>
- <SolidColorBrush x:Key="buttonBorder" Color="#83c7eb"></SolidColorBrush>
- <LinearGradientBrush x:Key="buttonHover" StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#668fa5" Offset="0" />
- <GradientStop Color="#3c6982" Offset="1" />
- </LinearGradientBrush>
- <Style x:Key="txtStatus" TargetType="TextBlock">
- <!--<Setter Property="Background" Value="#035092" />-->
- <Setter Property="Foreground" Value="DarkSlateGray" />
- <Setter Property="Padding" Value="5,5,0,0" />
- <Setter Property="FontSize" Value="18"/>
- </Style>
- <Style x:Key="TopPanelStatus" TargetType="TextBlock">
- <Setter Property="Foreground" Value="DarkSlateGray" />
- <Setter Property="Padding" Value="5" />
- <Setter Property="FontSize" Value="16"/>
- <Setter Property="TextAlignment" Value="Center"/>
- </Style>
- <Style x:Key="logoutButton" TargetType="Button">
- <Setter Property="Background" Value="{StaticResource buttonNormal}"></Setter>
- <Setter Property="Foreground" Value="{StaticResource buttonForground}"></Setter>
- <Setter Property="BorderBrush" Value="{StaticResource buttonBorder}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
- SnapsToDevicePixels="true" CornerRadius="3,3,3,3">
- <ContentPresenter x:Name="contentPresenter"
- Focusable="False"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="{TemplateBinding Padding}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" TargetName="border" Value="{StaticResource buttonHover}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <!--下拉按钮内部背景色-->
- <Border x:Name="Back" Background="#56b6e6" BorderThickness="1" BorderBrush="Transparent">
- <!--下拉按钮内边框-->
- <Path Name="PathFill" Fill="#03ffea" Width="10" Height="6" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform Angle="180"/>
- <TranslateTransform/>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="PathFill" Property="Fill" Value="White"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--Combox-->
- <Style TargetType="ComboBox" x:Key="ComboBoxStyle">
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <!--ComBoxItem-->
- <Style TargetType="ComboBoxItem">
- <Setter Property="MinHeight" Value="22"></Setter>
- <Setter Property="MinWidth" Value="60"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBoxItem">
- <Border Name="Back" Background="{TemplateBinding Background}">
- <ContentPresenter ContentSource="{Binding Source}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" ></ContentPresenter>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBox">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.7*"/>
- <ColumnDefinition Width="0.3*" MaxWidth="30"/>
- </Grid.ColumnDefinitions>
- <!--文字区域背景和边线样式-->
- <TextBox Background="{TemplateBinding Background}" VerticalAlignment="Center" Grid.Column="0" Foreground="{TemplateBinding Foreground}" BorderThickness="0" IsReadOnly="True" VerticalContentAlignment="Center" Text="{TemplateBinding Text}" Margin="0"></TextBox>
- <Border Grid.Column="0" BorderThickness="1" BorderBrush="Gray" CornerRadius="1,0,0,1">
- </Border>
- <!--右侧下拉button设置-->
- <Border Grid.Column="1" BorderThickness="0,1,1,1" BorderBrush="Gray" CornerRadius="0,1,1,0">
- <ToggleButton BorderThickness="3" BorderBrush="Gray" Style="{StaticResource ComboxStyleBtn}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"></ToggleButton>
- </Border>
- <!--弹出popup整体设置-->
- <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide" >
- <!--弹出popup边框-->
- <Border CornerRadius="1" BorderBrush="Gray" BorderThickness="1,0,1,1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
- <Border.Effect>
- <DropShadowEffect Color="LightGray" BlurRadius="2" ShadowDepth="0" Opacity="1"/>
- </Border.Effect>
- <!--下拉幕布边界背景设置 MaxHeight="{TemplateBinding MaxDropDownHeight}"-->
- <ScrollViewer Margin="0,0,0,0" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" BorderBrush="Gray" BorderThickness="2" >
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="LightGray" />
- </ScrollViewer>
- </Border>
- </Popup>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </UserControl.Resources>
- <Grid x:Name="gridAll">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="200" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="50" />
- <ColumnDefinition Width="150" />
- </Grid.ColumnDefinitions>
- <Image Grid.Row="0" Grid.Column="0" Width="200" Grid.RowSpan="2" Source="/Aitex.Sorter.UI;component/Resources/images/Yaskawa_logo.png" HorizontalAlignment="Left" Grid.ColumnSpan="2" Margin="10,-15,0,0"></Image>
- <StackPanel Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Orientation="Horizontal" Margin="20,80,0,0">
- <TextBlock Text="{DynamicResource GlobalLableVersion}" Foreground="white" Style="{StaticResource MainTextBlock}" FontSize="11" Padding="5,0" />
- <TextBlock Text="{Binding SoftwareVersion}" Foreground="white" Style="{StaticResource MainTextBlock}" FontSize="11" Padding="5,0" />
- </StackPanel>
- <Border Grid.Column="1" Background="#c1e2ff" BorderBrush="#0b77c2" CornerRadius="6" Margin="2" >
- <Grid VerticalAlignment="Stretch">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="*" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
-
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="220" />
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Row="0" Text ="System" Margin="5,0,0,0" Grid.Column="0" x:Name="txtTitle" FontSize="25" Foreground="#434668" Style="{StaticResource MainTextBlock}" />
- <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Margin="0" HorizontalAlignment="Center">
- <TextBlock Text="System:" Style="{StaticResource txtStatus}" VerticalAlignment="Center" Padding="0" Margin="5,0,0,0"/>
- <Border BorderThickness="1" BorderBrush="Gray" Margin="10,5" VerticalAlignment="Center" Background="{Binding SystemStatusBackground}" >
- <TextBlock VerticalAlignment="Center" Text="{Binding SystemStatus}" Style="{StaticResource TopPanelStatus}" Width="150" Margin="0,0,0,3" HorizontalAlignment="Center"/>
- </Border>
- <TextBlock Text="LoadPort:" Style="{StaticResource txtStatus}" VerticalAlignment="Center" Padding="0" Margin="5,0,0,0" />
- <Border BorderThickness="1" BorderBrush="Gray" Margin="5,5,2,5" VerticalAlignment="Center" HorizontalAlignment="Center" >
- <TextBlock Text="{Binding LoadPort1Status}" Background="{Binding LoadPort1StatusBackground}" Style="{StaticResource TopPanelStatus}" Width="90" VerticalAlignment="Center" Margin="0,0,0,3"/>
- </Border>
- <Border BorderThickness="1" BorderBrush="Gray" Margin="2,5,10,5" VerticalAlignment="Center">
- <TextBlock Text="{Binding LoadPort2Status}" Background="{Binding LoadPort2StatusBackground}" Style="{StaticResource TopPanelStatus}" Width="90" VerticalAlignment="Center" Margin="0,0,0,3"/>
- </Border>
- <TextBlock Text="Robot:" Style="{StaticResource txtStatus}" VerticalAlignment="Center" Padding="0" Margin="5,0,0,0" />
- <Border BorderThickness="1" BorderBrush="Gray" Margin="10,5" VerticalAlignment="Center">
- <TextBlock Text="{Binding RobotStatus}" Background="{Binding RobotStatusBackground}" Style="{StaticResource TopPanelStatus}" Width="90" VerticalAlignment="Center" Margin="0,0,0,3"/>
- </Border>
- <TextBlock Text="Aligner:" Style="{StaticResource txtStatus}" VerticalAlignment="Center" Padding="0" Margin="5,0,0,0" />
- <Border BorderThickness="1" BorderBrush="Gray" Margin="10,5" VerticalAlignment="Center">
- <TextBlock Text="{Binding AlignerStatus}" Background="{Binding AlignerStatusBackground}" Style="{StaticResource TopPanelStatus}" Width="90" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,3"/>
- </Border>
- <TextBlock Text="Host:" Style="{StaticResource txtStatus}" VerticalAlignment="Center" Padding="0" Margin="5,0,0,0" />
- <Border BorderThickness="1" BorderBrush="Gray" Margin="5,5,2,5" VerticalAlignment="Center">
- <TextBlock Text="{Binding HostCommunicationStatus}" Background="{Binding HostCommunicationStatusBackground}" Style="{StaticResource TopPanelStatus}" Width="150" VerticalAlignment="Center" Margin="0,0,0,3"/>
- </Border>
- <Border BorderThickness="1" BorderBrush="Gray" Margin="2,5,10,5" VerticalAlignment="Center">
- <TextBlock Text="{Binding HostControlStatus}" Background="{Binding HostControlStatusBackground}" Style="{StaticResource TopPanelStatus}" Width="150" VerticalAlignment="Center" Margin="0,0,0,3"/>
- </Border>
-
- </StackPanel>
-
- <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0">
- <Button Content="FA Enable" Height="30" Width="100" IsEnabled="{Binding IsFAEnableButtonEnabled}" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAEnable" />
- <Button Content="FA Disable" Height="30" Width="100" IsEnabled="{Binding IsFADisableButtonEnabled}" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FADisable" />
- </StackPanel>
- <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0">
- <Button Content="Auto" Height="30" Width="100" Command="{Binding InvokeCommand}" CommandParameter="SetAutoMode" IsEnabled="{Binding IsAutoButtonEnabled}" />
- <Button Content="Manual" Height="30" Width="100" IsEnabled="{Binding IsManualButtonEnabled}" Command="{Binding InvokeCommand}" CommandParameter="SetManualMode" />
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
- <TextBlock Text="Event:" Style="{StaticResource txtStatus}" VerticalAlignment="Center" Margin="5"></TextBlock>
- <ComboBox Width="1210" Style="{StaticResource ComboBoxStyle}" x:Name="comboEvent" DropDownClosed="comboEvent_DropDownClosed" Focusable="False" />
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">
- <Button VerticalAlignment="Center" Height="30" Width="100" Content="Reset" Click="btnReset_Click"/>
- <Button VerticalAlignment="Center" Height="30" Width="100" Content="Buzzer OFF" Command="{Binding SwitchOffBuzzerCommand}" />
- </StackPanel>
- </Grid>
- </Border>
- <Border Grid.Row="0" Grid.Column="2" Background="#c1e2ff" BorderBrush="#0b77c2" CornerRadius="6" Margin="8" Padding="4">
- <deviceControl:AITSignalTower Grid.Column="1" x:Name="signalTower" DeviceData="{Binding Path=SignalTower}" Width="30" Margin="-2,15,-2,-15" />
- </Border>
- <Grid Grid.Row="0" Grid.Column="3">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="*" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Column="0" Grid.Row="0" Text="{DynamicResource GlobalLableLogin}" Foreground="White" FontSize="15" Style="{StaticResource MainTextBlock}" Padding="5,0" />
- <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding User}" FontSize="15" Foreground="White" Style="{StaticResource MainTextBlock}" Padding="5,0" />
- <TextBlock Grid.Column="0" Grid.Row="1" Text="{DynamicResource GlobalLableRole}" Foreground="White" FontSize="15" Style="{StaticResource MainTextBlock}" Padding="5,0" />
- <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Role}" FontSize="15" Foreground="White" Style="{StaticResource MainTextBlock}" Padding="5,0" />
- <Button Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Width="90" FontSize="15" Height="30" Padding="0" Margin="3,3" VerticalAlignment="Center" Content="{DynamicResource GlobalLableLogout}" Click="btnLogoff_Click" />
- </Grid>
- </Grid>
- </UserControl>
|