|
- <UserControl x:Class="BPASmartClient.DosingSystem.View.SendCtrlView"
- 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:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
- xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
- xmlns:cv ="clr-namespace:BPASmartClient.DosingSystem.Converter"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:SendCtrlViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <cv:RunStateConvert x:Key="runStateConvert"/>
- <cv:AutoConvert x:Key="autoConvert"/>
- <cv:VisibleConvert x:Key="visibleConvert"/>
- <Style x:Key="CheckState" TargetType="CheckBox">
- <Setter Property="Margin" Value="1" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#ddd" />
- <Setter Property="VerticalContentAlignment" Value="Bottom" />
- <Setter Property="Margin" Value="2,5" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="FontFamily" Value="Consolas" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Border
- Name="radiobutton"
- Background="{TemplateBinding Background}"
- CornerRadius="5"
- Opacity="0.85">
- <Grid>
- <!--<Border
- x:Name="back_border"
- BorderBrush="Black"
- BorderThickness="0"
- CornerRadius="1">
- <Border.Effect>
- <BlurEffect KernelType="Gaussian" Radius="2" />
- </Border.Effect>
- </Border>
- <Border
- x:Name="fore_border"
- Margin="2"
- BorderBrush="White"
- BorderThickness="0"
- CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
- Opacity="0.7">
- <Border.Effect>
- <BlurEffect KernelType="Gaussian" Radius="2" />
- </Border.Effect>
- </Border>-->
-
-
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- TextBlock.FontFamily="{TemplateBinding FontFamily}"
- TextBlock.FontSize="{TemplateBinding FontSize}"
- TextBlock.Foreground="{TemplateBinding Foreground}" />
-
- <Image
- Name="im"
- Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
- Stretch="Fill" />
- </Grid>
- </Border>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
- <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
- <Setter Property="Background" Value=" #4169E1" />-->
- <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
-
- </Trigger>
-
- <Trigger Property="IsChecked" Value="False">
- <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
- </Trigger>
-
- <Trigger Property="IsMouseOver" Value="True">
- <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
- <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
- <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
- <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- </Setter.Value>
-
- </Setter>
-
- </Style>
- <Style x:Key="RadioState" TargetType="RadioButton">
- <Setter Property="Margin" Value="1" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#ddd" />
- <Setter Property="VerticalContentAlignment" Value="Bottom" />
- <Setter Property="Margin" Value="2,5" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="FontFamily" Value="Consolas" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RadioButton">
- <Border
- Name="radiobutton"
- Background="{TemplateBinding Background}"
- CornerRadius="5"
- Opacity="0.85">
- <Grid>
- <!--<Border
- x:Name="back_border"
- BorderBrush="Black"
- BorderThickness="0"
- CornerRadius="1">
- <Border.Effect>
- <BlurEffect KernelType="Gaussian" Radius="2" />
- </Border.Effect>
- </Border>
- <Border
- x:Name="fore_border"
- Margin="2"
- BorderBrush="White"
- BorderThickness="0"
- CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
- Opacity="0.7">
- <Border.Effect>
- <BlurEffect KernelType="Gaussian" Radius="2" />
- </Border.Effect>
- </Border>-->
-
-
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- TextBlock.FontFamily="{TemplateBinding FontFamily}"
- TextBlock.FontSize="{TemplateBinding FontSize}"
- TextBlock.Foreground="{TemplateBinding Foreground}" />
-
- <Image
- Name="im"
- Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
- Stretch="Fill" />
- </Grid>
- </Border>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
- <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
- <Setter Property="Background" Value=" #4169E1" />-->
- <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
-
- </Trigger>
-
- <Trigger Property="IsChecked" Value="False">
- <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
- </Trigger>
-
- <Trigger Property="IsMouseOver" Value="True">
- <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
- <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
- <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
- <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- </Setter.Value>
-
- </Setter>
-
- </Style>
- </UserControl.Resources>
- <Grid Margin="20">
- <Grid.RowDefinitions>
- <RowDefinition Height="60"/>
- <RowDefinition/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
- <TextBlock Text="手自动控制:" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
- <TextBlock Margin="10,0,0,0" Text="{Binding AutoCtrl,Converter={StaticResource autoConvert}}" Foreground="Red" Style="{StaticResource TextBlockStyle}" FontSize="18"/>
- </StackPanel>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Orientation="Horizontal">
- <RadioButton Margin="10" Content="手动" Style="{DynamicResource RadioState}" IsChecked="{Binding HandCtrl}"/>
- <RadioButton Margin="10" Content="自动" Style="{DynamicResource RadioState}" IsChecked="{Binding AutoCtrl}"/>
- </StackPanel>
- <StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
- <CheckBox Margin="10" IsEnabled="False" Content="料仓输送限制" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.SendInfo}"/>
- <CheckBox Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Content="{Binding RunState,Converter={StaticResource runStateConvert}}" Style="{StaticResource CheckState}" IsChecked="{Binding RunState}"/>
- </StackPanel>
- </Grid>
- <Grid Grid.Row="1">
- <UniformGrid Columns="2" Rows="2">
- <TextBlock Text="桶到位光电状态" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
- <TextBlock Text="气缸状态" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
- <UniformGrid Columns="2" Rows="2">
- <CheckBox Margin="5" IsEnabled="False" Content="进桶1光电" Style="{StaticResource CheckState}" />
- <CheckBox Margin="5" IsEnabled="False" Content="出桶1光电" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.OutputOptical_1}"/>
- <CheckBox Margin="5" IsEnabled="False" Content="出桶2光电" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.OutputOptical_2}"/>
- <CheckBox Margin="5" IsEnabled="False" Content="出桶3光电" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.OutputOptical_3}"/>
- </UniformGrid>
-
- <Grid Margin="5">
- <ListBox
- ItemsSource="{Binding SendCtrlModel.CylinderModels}"
- Background="Transparent"
- BorderThickness="0"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="HorizontalAlignment" Value="Stretch"/>
- <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
- <Setter Property="VerticalAlignment" Value="Stretch"/>
- <Setter Property="VerticalContentAlignment" Value="Stretch"/>
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Rows="3"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Margin="10" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
- <StackPanel Margin="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="{Binding Name}" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
- <CheckBox Height="30" Margin="5" IsEnabled="false" Content="开" Style="{DynamicResource CheckState}" IsChecked="{Binding OnStatus}"/>
- <CheckBox Height="30" Margin="5" Content="关" IsEnabled="false" Style="{DynamicResource CheckState}" IsChecked="{Binding OffStatus}"/>
- </StackPanel>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
-
- </UniformGrid>
- </Grid>
-
-
- <Grid Margin="20,0,20,40" Grid.Row="2" >
- <UniformGrid Columns="3" Rows="3">
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="进口输送" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.InSend}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.InSend}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBox Text="{Binding SendCtrlModel.InSendSp}" x:Name="sp1" Width="80" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <Button Margin="5" Content="复位1" Width="140" Height="30" Style="{StaticResource ImageButtonStyle}" Command="{Binding SendCtrl.Reset}" CommandParameter="{Binding ElementName=sp1}"/>
- </StackPanel >
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="气缸1" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.Clinder_1}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.Clinder_1}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="出口输送" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.OutSend}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.OutSend}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBox Text="{Binding SendCtrlModel.OutSendSp}" x:Name="sp2" Width="80" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <Button Margin="5" Content="复位2" Width="140" Height="30" Style="{StaticResource ImageButtonStyle}" Command="{Binding SendCtrl.Reset}" CommandParameter="{Binding ElementName=sp2}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="气缸2" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.Clinder_2}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.Clinder_2}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="缓存输送" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.CacheSend}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.CacheSend}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBox Text="{Binding SendCtrlModel.CacheSendSp}" Width="80" x:Name="sp3" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <Button Margin="5" Content="复位3" Width="140" Height="30" Style="{StaticResource ImageButtonStyle}" Command="{Binding SendCtrl.Reset}" CommandParameter="{Binding ElementName=sp3}"/>
- </StackPanel>
- <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
- <TextBlock Text="气缸3" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.Clinder_2}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.Clinder_3}"/>
- </StackPanel>
-
- </UniformGrid>
- </Grid>
-
- </Grid>
- </UserControl>
|