You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

230 lines
23 KiB

<Window x:Class="Gumming.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:local="clr-namespace:Gumming"
xmlns:tool="clr-namespace:GummingCommon;assembly=GummingCommon"
mc:Ignorable="d"
Background="{DynamicResource DefaultWindowBackground}"
Title="优联匀胶显影机" Height="744" Width="1024">
<Window.Resources>
<tool:GroupMenuConverter x:Key="GroupMenuConverter"/>
<tool:RoleMenuConverter x:Key="RoleMenuConverter"/>
<tool:MenuStyleConverter x:Key="MenuStyleConverter"/>
<tool:WarningTagStyleConverter x:Key="WarningTagStyleConverter"/>
<tool:BeepTagStyleConverter x:Key="BeepTagStyleConverter"/>
</Window.Resources>
<Grid Background="Transparent">
<Border CornerRadius="3" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<Border CornerRadius="0" BorderThickness="1" Background="Transparent" Height="Auto" BorderBrush="{DynamicResource DialogInnerBorder}">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="2"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="70"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Grid.Row="2" Grid.Column="1" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}"></Border>
<Border Grid.Row="2" Grid.Column="2" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}"></Border>
<Border Grid.Row="2" Grid.Column="3" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}"></Border>
<Border Grid.Row="3" Grid.Column="0" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource DefaultBorderBrush}"></Border>
<Border Grid.Row="4" Grid.Column="0" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource DefaultBorderBrush}"></Border>
<Border Grid.Row="5" Grid.Column="0" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource DefaultBorderBrush}"></Border>
<Border Grid.Row="2" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="{DynamicResource ContentBackground}">
<Grid Margin="7">
<ContentControl Content="{Binding SubContentControlBack.View}" Height="1" Width="1">
</ContentControl>
<ContentControl IsEnabled="{Binding IsLogin}" Content="{Binding SubContentControl.View}" VerticalAlignment="Stretch">
</ContentControl>
</Grid>
</Border>
<Border Grid.Row="1" Grid.ColumnSpan="3" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="{DynamicResource TopHeaderBackground}" MouseLeftButtonDown="Headerborder_MouseLeftButtonDown">
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="140"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="150"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="150"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Grid.Column="1" Source="/Gumming;component/Resource/Logo.png" Stretch="Fill" Width="120" Height="30">
</Image>
<Border Margin="0,3,0,3" Grid.Column="3" BorderBrush="{DynamicResource DefaultBorderBrush}" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="{DynamicResource DefaultBorderBrush}" BorderThickness="0,0,0,1"></Border>
<TextBlock Margin="5,0,5,0" Text="当前页面:" ToolTip="{Binding PositionDist}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16"></TextBlock>
<TextBox Margin="5,0,5,0" Grid.Row="1" IsReadOnly="True" Text="{Binding PageInfo}" ToolTip="{Binding PositionDist}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16"></TextBox>
</Grid>
</Border>
<Border Margin="0,3,0,3" Grid.Column="5" BorderBrush="{DynamicResource DefaultBorderBrush}" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="{DynamicResource DefaultBorderBrush}" BorderThickness="0,0,0,1"></Border>
<TextBlock Margin="5,0,5,0" Text="当前用户:" ToolTip="{Binding PositionDist}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16"></TextBlock>
<TextBox Margin="5,0,5,0" Grid.Row="1" IsReadOnly="True" Text="{Binding UserInfo}" ToolTip="{Binding PositionDist}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16"></TextBox>
</Grid>
</Border>
<Grid Grid.Column="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="2" Style="{DynamicResource CommonLittleImageButton}" FontSize="16" Command="{Binding LogInCommand}" Tag="LogIn" Content="登入"></Button>
<Button Grid.Column="6" Margin="2" IsEnabled="{Binding IsLogin}" Style="{DynamicResource CommonLittleImageButton}" FontSize="16" Content="自动" Click="BtnAuto" x:Name="Auto"></Button>
<!--<Button Grid.Column="2" Margin="2" IsEnabled="{Binding IsLogin}" Style="{DynamicResource CommonLittleImageButton}" FontSize="16" Command="{Binding LogOutCommand}" Tag="LogOut" Content="登出"></Button>-->
<Button Grid.Column="2" Margin="2" IsEnabled="{Binding IsLogin}" Style="{DynamicResource CommonLittleImageButton}" FontSize="16" Command="{Binding WarningCommand}" Tag="{Binding Path=Alarming,Converter={StaticResource WarningTagStyleConverter}}" Content="报警"></Button>
<Button Grid.Column="4" Margin="2" IsEnabled="{Binding IsLogin}" Style="{DynamicResource CommonLittleImageButton}" FontSize="16" Command="{Binding BeepCommand}" Tag="{Binding Path=Beep,Converter={StaticResource BeepTagStyleConverter}}" Content="蜂鸣"></Button>
<Button Grid.Column="10" Margin="2" IsEnabled="{Binding IsLogin}" Style="{DynamicResource CommonLittleImageButton}" FontSize="16" Content="离线"></Button>
</Grid>
<Grid Grid.Column="9">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button Name="focusButton" Width="0" Height="0"></Button>
<TextBlock Text="{Binding DateHour}" ToolTip="{Binding PositionDist}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16"></TextBlock>
<TextBlock Grid.Row="1" Text="{Binding DateSecond}" ToolTip="{Binding PositionDist}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16"></TextBlock>
</Grid>
</Grid>
</Border>
<Grid Grid.Row="4" Margin="5,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Path=VisibleOperation,ConverterParameter=0,Converter={StaticResource RoleMenuConverter}}" ></ColumnDefinition>
<ColumnDefinition Width="{Binding Path=VisibleFormulaSetting,ConverterParameter=1,Converter={StaticResource RoleMenuConverter}}" ></ColumnDefinition>
<ColumnDefinition Width="{Binding Path=VisibleControlSettting,ConverterParameter=2,Converter={StaticResource RoleMenuConverter}}" ></ColumnDefinition>
<ColumnDefinition Width="{Binding Path=VisibleTools,ConverterParameter=3,Converter={StaticResource RoleMenuConverter}}" ></ColumnDefinition>
<ColumnDefinition Width="{Binding Path=VisibleSystemSetting,ConverterParameter=4,Converter={StaticResource RoleMenuConverter}}" ></ColumnDefinition>
<ColumnDefinition Width="70" ></ColumnDefinition>
<ColumnDefinition Width="70" ></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=1,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding OperationCommand}" Visibility="{Binding VisibleOperation}" Tag="Operate" Content="操作"></Button>
<Button Grid.Column="1" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=3,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding ControlSetttingCommand}" Visibility="{Binding VisibleControlSettting}" Tag="Unit" Content="单元"></Button>
<Button Grid.Column="2" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=2,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding FormulaSettingCommand}" Visibility="{Binding VisibleFormulaSetting}" Tag="Formula" Content="配方"></Button>
<Button Grid.Column="3" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=4,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding ToolsCommand}" Visibility="{Binding VisibleTools}" Tag="Tools" Content="工具"></Button>
<Button Grid.Column="4" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=5,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding SystemSettingCommand}" Visibility="{Binding VisibleSystemSetting}" Tag="Setting" Content="设置"></Button>
<Button Grid.Column="5" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=6,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding SystemSettingCommand}" Visibility="{Binding VisibleSystemSetting}" Tag="Setting" Content="HOTS"></Button>
<Button Grid.Column="6" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding MenuGroup, ConverterParameter=7,Converter={StaticResource MenuStyleConverter}}" FontSize="16" Command="{Binding OEMCommand}" Visibility="{Binding VisibleSystemSetting}" Tag="Setting" Content="OEM"></Button>
</Grid>
<Grid Grid.Column="2" Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=10,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=11,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=12,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=33,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=20,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=21,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=22,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=23,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=30,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=31,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=32,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="0"></RowDefinition>
<RowDefinition Height="{Binding Path=MenuGroup,ConverterParameter=40,Converter={StaticResource GroupMenuConverter}}"></RowDefinition>
<RowDefinition Height="0"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Row="0" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=10,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding HomepageCommand}" Tag="Home" Content="主页"></Button>
<Button Grid.Row="1" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=11,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding LogViewCommand}" Tag="Log" Content="日志"></Button>
<Button Grid.Row="2" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=12,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding MonitorCommand}" Tag="Monitor" Content="监控"></Button>
<Button Grid.Row="10" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=33,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding ReSetControlCommand}" Tag="ReSetControl" Content="初始化"></Button>
<Button Grid.Row="3" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=20,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding SlotControlCommand}" Tag="SlotControl" Content="批配方"></Button>
<Button Grid.Row="4" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=21,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding UnitControlCommand}" Tag="UnitControl" Content="流片配方"></Button>
<Button Grid.Row="5" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=22,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding FormulaControlCommand}" Tag="FormulaControl" Content="单元配方"></Button>
<Button Grid.Row="6" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=23,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding DispenseControlCommand}" Tag="DispenseControl" Content="定期喷洒"></Button>
<Button Grid.Row="7" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=30,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding DoControlCommand}" Tag="DoControl" Content="加工"></Button>
<Button Grid.Row="8" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=31,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding ManualControlCommand}" Tag="ManualControl" Content="手动"></Button>
<Button Grid.Row="9" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=32,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding RototControlCommand}" Tag="RototControl" Content="机器人"></Button>
<Button Grid.Row="12" Margin="2" IsEnabled="{Binding IsLogin}" Style="{Binding Path=SubMenu,ConverterParameter=40,Converter={StaticResource MenuStyleConverter}}" FontSize="15" Command="{Binding UsersCommand}" Tag="Users" Content="用户管理"></Button>
</Grid>
<Button Grid.Column="2" Grid.Row="4" Margin="2" Style="{DynamicResource CommonImageButton}" FontSize="16" Command="{Binding ExitCommand}" Visibility="{Binding VisibleSystemSetting}" Tag="Exit" Content="退出">
</Button>
</Grid>
</Border>
</Border>
<Grid Visibility="{Binding AllowHideTopMenuVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="22"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="1" Foreground="{DynamicResource FontBrush3}" Text="{Binding AppVersion}" FontSize="13" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
</Grid>
<Border Visibility="{Binding IsInProcessVisibility, FallbackValue=Hidden}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Column="0" Grid.Row="0" Background="#BBB" Opacity="0.4"></Border>
<Border Grid.Column="0" Grid.Row="1" Background="#BBB" Opacity="0.4" ></Border>
<Border Grid.Column="0" Grid.Row="2" Background="#BBB" Opacity="0.4" ></Border>
<Border Grid.Column="1" Grid.Row="0" Background="#BBB" Opacity="0.4"></Border>
<Border Grid.Column="1" Grid.Row="2" Background="#BBB" Opacity="0.4" ></Border>
<Border Grid.Column="2" Grid.Row="0" Background="#BBB" Opacity="0.4"></Border>
<Border Grid.Column="2" Grid.Row="1" Background="#BBB" Opacity="0.4" ></Border>
<Border Grid.Column="2" Grid.Row="2" Background="#BBB" Opacity="0.4" ></Border>
<Grid Name="pgBorder" Grid.Column="1" Grid.Row="1" Opacity="1" Background="#BBB" Height="60" Width="250">
<Border CornerRadius="3" BorderBrush="#888" BorderThickness="1" Background="{DynamicResource DefaultWindowBackground}" >
<Border CornerRadius="1" BorderThickness="0" Height="Auto" BorderBrush="{DynamicResource DialogInnerBorder}">
<TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20" Text="{Binding ProgressMessage}" Foreground="#0060FF" FontSize="18" TextWrapping="Wrap" ToolTip="{Binding ProgressMessage}"></TextBlock>
</Border>
</Border>
</Grid>
</Grid>
</Border>
</Grid>
</Window>