| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585 |
- <Window
- x:Class="SHJX.Service.View.MainForm"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:MainLibrarys="clr-namespace:SHJX.Service.Librarys.MainLibrarys;assembly=SHJX.Service.Librarys"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pu="clr-namespace:Panuon.UI.Silver;assembly=Panuon.UI.Silver"
- Title="MainWindow"
- Width="1200"
- Height="1000"
- ResizeMode="CanMinimize"
- SizeChanged="Window_SizeChanged"
- WindowStartupLocation="CenterScreen"
- WindowState="Maximized"
- WindowStyle="None"
- mc:Ignorable="d">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Loaded">
- <ei:CallMethodAction MethodName="MainLoaded" TargetObject="{Binding}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <Window.Resources>
- <!--#region 刷新按钮样式-->
- <Style x:Key="FocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle
- Margin="2"
- SnapsToDevicePixels="true"
- Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD" />
- <SolidColorBrush x:Key="Button.Static.Border" Color="Transparent" />
- <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD" />
- <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1" />
- <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6" />
- <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B" />
- <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4" />
- <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5" />
- <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383" />
- <Style x:Key="ButtonStyle_User_Frush" TargetType="{x:Type Button}">
- <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
- <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
- <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="1" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border
- x:Name="border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="true">
- <ContentPresenter
- x:Name="contentPresenter"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Focusable="False"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsDefaulted" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="border" Property="Background" Value="Transparent" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="border" Property="Background" Value="Transparent" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="border" Property="Background" Value="{StaticResource Button.Disabled.Background}" />
- <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Disabled.Border}" />
- <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
- <!--#region 下面这段代码不用,不能变成Uniform的样式-->
- <Style x:Key="ItemContainerStyle" TargetType="{x:Type ListViewItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListViewItem}">
- <Border
- x:Name="Bd"
- Background="Transparent"
- BorderBrush="Transparent"
- BorderThickness="0">
- <ContentPresenter />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter TargetName="Bd" Property="Background" Value="Transparent" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- endregion -->
- <!--#region 消解位模板-->
- <DataTemplate x:Key="DissolveItemTemplate">
- <MainLibrarys:DissolveElement
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- DissolveText="{Binding DisplayText}"
- ProcessValue="{Binding DisplayValue}" />
- </DataTemplate>
- <!--#endregion-->
- <!--#region 样品位模板-->
- <DataTemplate x:Key="SampleDetailTemplate">
- <MainLibrarys:DetailElement
- CurrentDetailInfo="{Binding DetailInfo}"
- CurrentName="{Binding UIName}"
- CurrentResult="{Binding Result}"
- CurrentTagColor="{Binding TagColor}"
- CurrentTagNo="{Binding TagNo}"
- CurrentVolume="{Binding Volume}" />
- </DataTemplate>
- <!--#endregion-->
- <!--#region 中间位模板-->
- <DataTemplate x:Key="CenterControlTemplate">
- <MainLibrarys:CenterControl
- Margin="3"
- BackColor="{Binding BackColor}"
- CenterText="{Binding CenterText}"
- TagNameText="{Binding TagText}" />
- </DataTemplate>
- <!--#endregion-->
- </Window.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="2.3*" />
- <RowDefinition Height="22*" />
- <RowDefinition Height="0.7*" />
- </Grid.RowDefinitions>
- <!--#region 顶部标题栏-->
- <Grid
- Name="mainwindow_tag"
- Grid.Row="0"
- Background="#99CCCC">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="8*" />
- <ColumnDefinition Width="1*" />
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0" Orientation="Horizontal">
- <MainLibrarys:TagElement x:Name="beiginTask"
- HorizontalAlignment="Left"
- ClickCommand="{Binding TaskStartCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/开始.png"
- IsEnabled="False"
- TagDetail="开始任务" Cursor="Hand" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding TaskPauseCommand}"
- DisplayImage="{Binding PauseIcon}"
- TagDetail="{Binding PauseText}" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- DisplayImage="/SHJX.Service.Resource;component/Resources/演示.png"
- TagDetail="演示作业" />
- <!--<MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding ClearPipeCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/清洗.png"
- TagDetail="清洗管路" />-->
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding ManualControlCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/手动.png"
- TagDetail="手动控制" Cursor="Hand" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding ExportWordCommand}"
- DisplayImage="{Binding ExportWordIcon}"
- TagDetail="结果导出" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding TemplateCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/模板.png"
- TagDetail="模板操作" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding SettingCommand}"
- Cursor="Hand"
- DisplayImage="/SHJX.Service.Resource;component/Resources/配置.png"
- TagDetail="配置管理" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding ScreenCaptureCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/截图.png"
- TagDetail="屏幕截图" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding AboutSystemCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/关于.png"
- TagDetail="关于系统" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding MinSizeCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/最小化.png"
- TagDetail="最小化" />
- <MainLibrarys:TagElement
- HorizontalAlignment="Left"
- ClickCommand="{Binding MainCloseCommand}"
- DisplayImage="/SHJX.Service.Resource;component/Resources/关闭.png"
- TagDetail="关闭系统" />
- </StackPanel>
- <StackPanel
- Grid.Column="1"
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Orientation="Vertical">
- <pu:DropDown
- Margin="0,0,20,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- BorderBrush="Transparent"
- Cursor="Hand">
- <Grid Width="50">
- <Button
- Width="50"
- Height="50"
- HorizontalAlignment="Center"
- pu:ButtonHelper.CornerRadius="30"
- Background="Transparent"
- BorderBrush="White"
- BorderThickness="1">
- <Image
- Width="40"
- Height="40"
- Source="{Binding WashIcon}" />
- </Button>
- </Grid>
- <pu:DropDown.Child>
- <StackPanel
- Width="150"
- Height="140"
- Background="Transparent">
- <Button
- Width="55"
- Height="55"
- Margin="0,10,0,0"
- pu:ButtonHelper.ClickStyle="Sink"
- pu:ButtonHelper.CornerRadius="30"
- pu:ButtonHelper.HoverBrush="#66CCCC"
- Background="#99CCCC"
- BorderBrush="#99CCCC"
- BorderThickness="2"
- Command="{Binding ClearPipeCommand}"
- Cursor="Hand">
- <!--<Image
- Width="45"
- Height="45"
- Source="/SHJX.Service.Resource;component/Resources/清洗.png" />-->
- 清洗
- </Button>
- <!--<TextBlock
- HorizontalAlignment="Center"
- FontFamily="幼圆"
- FontSize="16"
- FontWeight="Black"
- Foreground="#99CCCC"
- Text="清洗管路" />-->
- <Image Margin="0,10,0,0" Source="/SHJX.Service.Resource;component/Resources/按键分割线_横.png" />
- <CheckBox
- x:Name="CbWash"
- Grid.Row="0"
- Height="50"
- HorizontalAlignment="Center"
- pu:CheckBoxHelper.BoxHeight="16"
- pu:CheckBoxHelper.BoxWidth="24"
- pu:CheckBoxHelper.CheckBoxStyle="Switch"
- pu:CheckBoxHelper.CheckedBackground="#99CCCC"
- Command="{Binding WashChooseCommand}"
- Content="润洗管路"
- Cursor="Hand"
- FontFamily="幼圆"
- FontSize="16"
- FontWeight="Black"
- Foreground="#99CCCC"
- IsChecked="{Binding WhetherWash, Mode=OneWayToSource}" />
- </StackPanel>
- </pu:DropDown.Child>
- </pu:DropDown>
- </StackPanel>
- </Grid>
- </Grid>
- <!--#endregion-->
- <!--#region 中间主体-->
- <Grid Grid.Row="1" Grid.Column="0">
- <Grid Grid.Column="0">
- <Grid.RowDefinitions>
- <RowDefinition Height="2*" />
- <RowDefinition Height="6*" />
- </Grid.RowDefinitions>
- <Border
- Grid.Row="0"
- BorderBrush="#99CCCC"
- BorderThickness="0,0,0,2" />
- <ListView
- Grid.Row="0"
- Background="Transparent"
- BorderBrush="Transparent"
- ItemContainerStyle="{StaticResource ItemContainerStyle}"
- ItemTemplate="{StaticResource ResourceKey=DissolveItemTemplate}"
- ItemsSource="{Binding DissolvePositions}">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="12" Rows="2" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- <Grid Grid.Row="1" Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="6*" />
- <ColumnDefinition Width="1*" />
- <ColumnDefinition Width="6*" />
- </Grid.ColumnDefinitions>
- <ListView
- Grid.Column="0"
- Background="Transparent"
- BorderBrush="Transparent"
- ItemContainerStyle="{StaticResource ItemContainerStyle}"
- ItemTemplate="{StaticResource ResourceKey=SampleDetailTemplate}"
- ItemsSource="{Binding LeftSampleAreas}">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="6" Rows="4" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- <ListView
- Grid.Column="1"
- Background="Transparent"
- BorderBrush="Transparent"
- ItemContainerStyle="{StaticResource ItemContainerStyle}"
- ItemTemplate="{StaticResource ResourceKey=CenterControlTemplate}"
- ItemsSource="{Binding CenterControls}">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="1" Rows="5" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- <ListView
- Grid.Column="2"
- Background="Transparent"
- BorderBrush="Transparent"
- ItemContainerStyle="{StaticResource ItemContainerStyle}"
- ItemTemplate="{StaticResource ResourceKey=SampleDetailTemplate}"
- ItemsSource="{Binding RightSampleAreas}">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="6" Rows="4" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- </Grid>
- </Grid>
- </Grid>
- <!--#endregion-->
- <!--#region 底部栏-->
- <Grid
- Grid.Row="2"
- Grid.ColumnSpan="2"
- Background="#99CCCC">
- <StackPanel
- Grid.Column="5"
- Margin="0,0,20,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="幼圆"
- FontWeight="UltraBold"
- FontSize="12"
- Foreground="White"
- Text="相机数量:" />
- <ComboBox
- x:Name="cameraNumCombobox"
- Width="35"
- Height="22"
- Margin="0,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- pu:ComboBoxHelper.CornerRadius="4"
- FontSize="15"
- FontFamily="幼圆"
- FontWeight="Regular"
- Visibility="Visible"
- IsSynchronizedWithCurrentItem="False" SelectionChanged="cameraNumCombobox_SelectionChanged" DropDownClosed="cameraNumCombobox_DropDownClosed" >
- <ComboBoxItem Content="0" IsSelected="True"/>
- <ComboBoxItem Content="1"/>
- <ComboBoxItem Content="2"/>
- </ComboBox>
- <!--<Image Source="/SHJX.Service.Resource;component/Resources/按键分割线.png" />-->
- <!--<CheckBox
- Height="25"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- pu:CheckBoxHelper.BoxHeight="16"
- pu:CheckBoxHelper.BoxWidth="25"
- pu:CheckBoxHelper.CheckBoxStyle="Switch"
- pu:CheckBoxHelper.CheckedBackground="#99CCCC"
- Command="{Binding CameraDetect}"
- Content="空压机开启"
- Cursor="Hand"
- FontFamily="幼圆"
- FontSize="12"
- FontWeight="UltraBold"
- Foreground="White"
- IsChecked="{Binding WhetherCameraDetect, Mode=OneWayToSource}" />-->
- <Image Source="/SHJX.Service.Resource;component/Resources/按键分割线.png" />
- <CheckBox x:Name="coldWater"
- Height="25"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- pu:CheckBoxHelper.BoxHeight="16"
- pu:CheckBoxHelper.BoxWidth="25"
- pu:CheckBoxHelper.CheckBoxStyle="Switch"
- pu:CheckBoxHelper.CheckedBackground="#99CCCC"
- Command="{Binding WaterMachine}"
- Content="冷凝水机开启"
- Cursor="Hand"
- FontFamily="幼圆"
- FontSize="12"
- FontWeight="UltraBold"
- Foreground="White"
- IsChecked="{Binding WaterMachineOpen, Mode=OneWayToSource}"
- Checked="WaterMachineOpenClick"
- Unchecked="WaterMachineCloseClick"/>
- <Image Source="/SHJX.Service.Resource;component/Resources/按键分割线.png" />
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="幼圆"
- FontSize="12"
- FontWeight="UltraBold"
- Foreground="White"
- Text="通信端口:" />
- <TextBlock
- Margin="0,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="幼圆"
- FontSize="12"
- FontWeight="UltraBold"
- Foreground="White"
- Text="{Binding ClientName}" />
- <Image Source="/SHJX.Service.Resource;component/Resources/按键分割线.png" />
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="幼圆"
- FontSize="12"
- FontWeight="UltraBold"
- Foreground="White"
- Text="连接状态:" />
- <pu:Badge
- Width="20"
- Height="20"
- Margin="0,0,10,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="{Binding PortClientColor}"
- IsWaving="{Binding PortClientState}" />
- <Button
- Width="20"
- Height="20"
- Margin="0,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding FrushClientCommand}"
- Cursor="Hand"
- RenderTransformOrigin="0.5,0.5"
- Style="{DynamicResource ButtonStyle_User_Frush}">
- <Image
- Width="15"
- Height="15"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Source="/SHJX.Service.Resource;component/Resources/Cycle.png" />
- <Button.RenderTransform>
- <RotateTransform x:Name="trans" Angle="0" />
- </Button.RenderTransform>
- <Button.Triggers>
- <EventTrigger RoutedEvent="Button.Click">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation
- RepeatBehavior="1x"
- Storyboard.TargetName="trans"
- Storyboard.TargetProperty="Angle"
- From="0"
- To="-540"
- Duration="0:0:1" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Button.Triggers>
- </Button>
- <Image Source="/SHJX.Service.Resource;component/Resources/按键分割线.png" />
- <CheckBox
- Height="25"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- pu:CheckBoxHelper.BoxHeight="16"
- pu:CheckBoxHelper.BoxWidth="25"
- pu:CheckBoxHelper.CheckBoxStyle="Switch"
- pu:CheckBoxHelper.CheckedBackground="#99CCCC"
- Command="{Binding LockDestCommand}"
- Content="屏幕锁定"
- Cursor="Hand"
- FontFamily="幼圆"
- FontSize="12"
- FontWeight="UltraBold"
- Foreground="White"
- IsChecked="{Binding WhetherLockMain, Mode=OneWayToSource}" />
- </StackPanel>
- <Label Content="*" HorizontalAlignment="Center" VerticalAlignment="Center" MouseDoubleClick="Label_MouseDoubleClick"/>
- </Grid>
- <!--#endregion-->
- <!--#region 遮蔽层(用于锁定界面)-->
- <Grid
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Background="#45FFFFFF"
- Visibility="{Binding MainHiddenValue}" />
- <!-- endregion -->
- </Grid>
- </Window>
|