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.

212 lines
15 KiB

<UserControl x:Class="Gumming.FormulaCPView"
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"
mc:Ignorable="d"
xmlns:local="clr-namespace:Gumming"
xmlns:tool="clr-namespace:GummingCommon;assembly=GummingCommon"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
d:DesignHeight="700" d:DesignWidth="1000"
Background="Transparent"
x:Name="rootControl">
<UserControl.Resources>
<tool:RadioButtonConverter x:Key="RadioConverter"/>
<tool:BooleanToOpacityConverter x:Key="OpacityConverter"/>
<tool:EditorTextConverter x:Key="TextBrushConverter"/>
<tool:EditorBorderConverter x:Key="BorderBrushConverter"/>
<tool:PathTypeToThemeConverter x:Key="PathTypeConverter"/>
<tool:StepStyleConverter x:Key="StepStyleConverter"/>
<tool:StepTextConverter x:Key="StepBrushConverter"/>
<tool:BoolenToTextConverter x:Key="BoolenToTextConverter"/>
<tool:ListViewDisabledStyleConverter x:Key="ListViewDisabledStyleConverter"/>
<DataTemplate x:Key="PortFieldMapping">
<Border Name="ItemBorder" Width="80" BorderThickness="0" BorderBrush="Black">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36"></RowDefinition>
<RowDefinition Height="36"></RowDefinition>
</Grid.RowDefinitions>
<Border BorderThickness="0,1,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" >
<TextBlock Text="{Binding StepIndex, Mode=TwoWay}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"></TextBlock>
</Border>
<Border Grid.Row="1" BorderThickness="0,0,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}">
<local:FloatBox MaxValue="1000" Style="{DynamicResource ListViewTextBoxStyle}" Text="{Binding StepTime, Mode=TwoWay,UpdateSourceTrigger=LostFocus,StringFormat=F1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14">
<TextBox.Background>
<MultiBinding Converter="{StaticResource StepBrushConverter}">
<Binding Path="StepTime" />
<Binding Path="Copy.StepTime" />
</MultiBinding>
</TextBox.Background>
</local:FloatBox>
</Border>
<!--<Border Grid.Row="2" BorderThickness="0,0,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" >
<Grid>
<Border>
<Border.Background>
<MultiBinding Converter="{StaticResource StepBrushConverter}">
<Binding Path="Empty" />
<Binding Path="Copy.Empty" />
</MultiBinding>
</Border.Background>
<CheckBox IsChecked="{Binding Path=Empty}" Content="{Binding Path=Empty,Converter={StaticResource BoolenToTextConverter}}" Cursor="Hand"></CheckBox>
</Border>
</Grid>
</Border>-->
</Grid>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type ListViewItem}}, Path=IsSelected}" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="#DDD"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Row="2" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="36"></RowDefinition>
<RowDefinition Height="36"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border BorderThickness="1,1,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="步骤" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
<Border Grid.Row="1" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="1.步骤时间[s]" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>
<!--<Border Grid.Row="2" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<TextBlock Text="2.吸真空(OFF/ON)" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
</Border>-->
</Grid>
<ListView Grid.Column="1" x:Name="FieldMappingView" tool:TouchScrolling.IsEnabled="True" Grid.Row="2" ItemTemplate="{DynamicResource PortFieldMapping}" ItemsSource="{Binding HardFormulaCPs}"
Template="{DynamicResource HSListViewItemMapping}" ItemContainerStyle="{Binding Path=AllowEdit,Converter={StaticResource ListViewDisabledStyleConverter}}" BorderThickness="0" IsHitTestVisible="True"
SelectedItem="{Binding SelectedStep, Mode=TwoWay}" SelectionMode="Extended" Foreground="{DynamicResource FontBrush4}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<tool:ExecuteCommandAction Command="{Binding SelectStepCommand}" CommandParameter="{Binding SelectedItems, ElementName=FieldMappingView}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListView>
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220"></ColumnDefinition>
<ColumnDefinition Width="140"></ColumnDefinition>
<ColumnDefinition Width="230"></ColumnDefinition>
<ColumnDefinition Width="230"></ColumnDefinition>
<ColumnDefinition Width="230"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="配方名称:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" Text="{Binding FormulaName}" MaxLength="20" IsEnabled="{Binding AllowEdit}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
<Border Grid.Column="1" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="创建人:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" Text="{Binding CreateBy}" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
<Border Grid.Column="2" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="创建时间:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" Text="{Binding SelectedFormula.CreateTime, StringFormat='yyyy-MM-dd HH:mm:ss'}" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
<Border Grid.Column="3" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="目标温度[℃]:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
<Border Grid.Column="4" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource DefaultBorderBrush}" Background="Transparent" >
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="8"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Text="报警温度[℃]:" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBlock>
<TextBox Grid.Column="3" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
</Grid>
<Grid Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="3"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding InsertStepCommand}" Content="插入步骤"></Button>
<Button Grid.Column="2" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding AddStepCommand}" Content="添加步骤"></Button>
<Button Grid.Column="4" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding DeleteStepCommand}" Content="删除步骤"></Button>
<Button Grid.Column="6" Margin="2" FontSize="15" IsEnabled="{Binding AllowEdit}" Style="{DynamicResource CommonIconButton}" Command="{Binding CopyStepCommand}" Content="复制步骤"></Button>
</Grid>
</Grid>
</Grid>
</UserControl>