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.
159 lines
12 KiB
159 lines
12 KiB
<UserControl x:Class="Gumming.TemperatureView"
|
|
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:TagStyleConverter x:Key="TagStyleConverter"/>
|
|
<DataTemplate x:Key="PortFieldMapping">
|
|
<Border Name="ItemBorder" Height="30" BorderThickness="0">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="100"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
<Border BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBlock Padding="2" Text="{Binding DTMName, Mode=TwoWay}" ToolTip="{Binding DTMName}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="1" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBlock Visibility="{Binding CoolHide}" Padding="2" Text="{Binding PValue, Mode=TwoWay}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="2" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBlock Visibility="{Binding CoolHide}" Padding="2" Text="{Binding IValue, Mode=TwoWay}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="3" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBlock Visibility="{Binding CoolHide}" Padding="2" Text="{Binding DValue, Mode=TwoWay}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="4" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBox Visibility="{Binding CoolHide}" Style="{DynamicResource EditTextBoxStyle}" Text="{Binding OffsetEdit, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=N1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14" FontWeight="Bold">
|
|
</TextBox>
|
|
</Border>
|
|
<Border Grid.Column="7" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<Button Visibility="{Binding CoolHide}" Content="自整定" Style="{Binding Path=AutoStatus,Converter={StaticResource TagStyleConverter}}" Tag="{Binding AutoStatus}" CommandParameter="{Binding RecId}" Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.AutoSetCommand}"></Button>
|
|
</Border>
|
|
<Border Grid.Column="6" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBlock Padding="2" Text="{Binding PVValue, Mode=TwoWay,StringFormat=N1}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="14" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="5" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBox Style="{DynamicResource EditTextBoxStyle}" Text="{Binding HPSV, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=N1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14" FontWeight="Bold">
|
|
</TextBox>
|
|
</Border>
|
|
<!--<Border Grid.Column="8" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<TextBox Style="{DynamicResource EditTextBoxStyle}" Text="{Binding AlmOffset, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=N1}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14" FontWeight="Bold">
|
|
</TextBox>
|
|
</Border>
|
|
<Border Grid.Column="9" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource BaseBrushBorder}" >
|
|
<Button Content="设置" CommandParameter="{Binding RecId}" Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.ManualSetCommand}"></Button>
|
|
</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="30"></RowDefinition>
|
|
<RowDefinition Height="*"></RowDefinition>
|
|
<RowDefinition Height="5"></RowDefinition>
|
|
<RowDefinition Height="30"></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto"></ColumnDefinition>
|
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="100"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
<ColumnDefinition Width="120"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
<Border BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="名称" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="1" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="P" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="2" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="I" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="3" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="D" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="4" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="PV读取[℃]" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="5" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="SV设定[℃]" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="6" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="Offset补偿" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
<Border Grid.Column="7" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource BaseBrushBorder}" Background="Transparent" >
|
|
<TextBlock Padding="2" Text="AT自整定" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" FontSize="12" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
|
|
</Border>
|
|
</Grid>
|
|
<ListView x:Name="FieldMappingView" tool:TouchScrolling.IsEnabled="True" Grid.Row="2" ItemTemplate="{DynamicResource PortFieldMapping}" ItemsSource="{Binding Temperatures}"
|
|
Template="{DynamicResource ListViewItemMapping}" ItemContainerStyle="{DynamicResource ListViewItemContainerStyle}" BorderThickness="0"
|
|
SelectedValue="{Binding SelectedTemperature}" SelectionMode="Single" Foreground="{DynamicResource FontBrush4}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel></StackPanel>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<tool:ExecuteCommandAction CommandParameter="{Binding SelectedItems, ElementName=FieldMappingView}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ListView>
|
|
<Grid Grid.Row="0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
|
<ColumnDefinition Width="3"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
<ColumnDefinition Width="3"></ColumnDefinition>
|
|
<ColumnDefinition Width="80"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
</Grid>
|
|
<Grid Grid.Row="4">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
|
<ColumnDefinition Width="500"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
<ContentControl Grid.Column="1" Content="{Binding PagerControlViewer.View}"></ContentControl>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|