692 lines
43 KiB
XML
692 lines
43 KiB
XML
<UserControl
|
||
x:Class="XplorePlane.Views.Cnc.CncPageView"
|
||
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:local="clr-namespace:XplorePlane.Views.Cnc"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
xmlns:prism="http://prismlibrary.com/"
|
||
xmlns:behaviors="clr-namespace:XplorePlane.Controls"
|
||
xmlns:views="clr-namespace:XplorePlane.Views"
|
||
xmlns:vm="clr-namespace:XplorePlane.ViewModels.Cnc"
|
||
d:DesignHeight="760"
|
||
d:DesignWidth="452"
|
||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||
mc:Ignorable="d">
|
||
|
||
<UserControl.Resources>
|
||
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||
<local:InverseBooleanToVisibilityConverter x:Key="InverseBoolToVisibilityConverter" />
|
||
<local:BoolToDisplayTextConverter x:Key="BoolToDisplayTextConverter" />
|
||
<local:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
|
||
|
||
<SolidColorBrush x:Key="PanelBg" Color="White" />
|
||
<SolidColorBrush x:Key="PanelBorder" Color="#CDCBCB" />
|
||
<SolidColorBrush x:Key="SeparatorBrush" Color="#E5E5E5" />
|
||
<SolidColorBrush x:Key="HeaderBg" Color="#F7F7F7" />
|
||
<SolidColorBrush x:Key="TreeChildLineBrush" Color="#C7D4DF" />
|
||
<FontFamily x:Key="UiFont">Microsoft YaHei UI</FontFamily>
|
||
|
||
<Style x:Key="TreeItemStyle" TargetType="TreeViewItem">
|
||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||
<Setter Property="Padding" Value="0" />
|
||
<Setter Property="Margin" Value="0" />
|
||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||
</Style>
|
||
|
||
<Style x:Key="EditorTitle" TargetType="TextBlock">
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="13" />
|
||
<Setter Property="FontWeight" Value="SemiBold" />
|
||
<Setter Property="Margin" Value="0,0,0,8" />
|
||
</Style>
|
||
|
||
<Style x:Key="LabelStyle" TargetType="TextBlock">
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="11" />
|
||
<Setter Property="Foreground" Value="#666666" />
|
||
<Setter Property="Margin" Value="0,0,0,3" />
|
||
</Style>
|
||
|
||
<Style x:Key="EditorBox" TargetType="TextBox">
|
||
<Setter Property="Height" Value="28" />
|
||
<Setter Property="Padding" Value="8,3" />
|
||
<Setter Property="Margin" Value="0,0,0,8" />
|
||
<Setter Property="BorderBrush" Value="#CFCFCF" />
|
||
<Setter Property="BorderThickness" Value="1" />
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="11" />
|
||
</Style>
|
||
|
||
<Style x:Key="DisplayValueLabel" TargetType="Label">
|
||
<Setter Property="Height" Value="28" />
|
||
<Setter Property="Padding" Value="8,3" />
|
||
<Setter Property="Margin" Value="0,0,0,8" />
|
||
<Setter Property="Background" Value="#F7F8FA" />
|
||
<Setter Property="BorderBrush" Value="#D9DDE3" />
|
||
<Setter Property="BorderThickness" Value="1" />
|
||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="11" />
|
||
<Setter Property="Foreground" Value="#333333" />
|
||
</Style>
|
||
|
||
<Style x:Key="EditorCheck" TargetType="CheckBox">
|
||
<Setter Property="Margin" Value="0,2,0,8" />
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="11" />
|
||
</Style>
|
||
|
||
<Style x:Key="CompactGroupBox" TargetType="GroupBox">
|
||
<Setter Property="Margin" Value="0,0,0,10" />
|
||
<Setter Property="Padding" Value="0" />
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="11" />
|
||
</Style>
|
||
|
||
<Style x:Key="TreeToolbarButton" TargetType="Button">
|
||
<Setter Property="Height" Value="24" />
|
||
<Setter Property="MinWidth" Value="42" />
|
||
<Setter Property="Margin" Value="0,0,4,0" />
|
||
<Setter Property="Padding" Value="8,0" />
|
||
<Setter Property="Background" Value="#F8F8F8" />
|
||
<Setter Property="BorderBrush" Value="#CFCFCF" />
|
||
<Setter Property="BorderThickness" Value="1" />
|
||
<Setter Property="Cursor" Value="Hand" />
|
||
<Setter Property="FontFamily" Value="{StaticResource UiFont}" />
|
||
<Setter Property="FontSize" Value="11" />
|
||
</Style>
|
||
<Style x:Key="TreeToolbarButtonCompact" TargetType="Button" BasedOn="{StaticResource TreeToolbarButton}">
|
||
<Setter Property="Width" Value="28" />
|
||
<Setter Property="Height" Value="28" />
|
||
<Setter Property="MinWidth" Value="28" />
|
||
<Setter Property="Margin" Value="0,0,4,4" />
|
||
<Setter Property="Padding" Value="0" />
|
||
<Setter Property="FontSize" Value="10.5" />
|
||
</Style>
|
||
<Style x:Key="TreeToolbarIcon" TargetType="Image">
|
||
<Setter Property="Width" Value="14" />
|
||
<Setter Property="Height" Value="14" />
|
||
<Setter Property="Margin" Value="0" />
|
||
<Setter Property="Stretch" Value="Uniform" />
|
||
<Setter Property="VerticalAlignment" Value="Center" />
|
||
</Style>
|
||
</UserControl.Resources>
|
||
|
||
<Border
|
||
Width="452"
|
||
MinWidth="452"
|
||
HorizontalAlignment="Left"
|
||
Background="{StaticResource PanelBg}"
|
||
BorderBrush="{StaticResource PanelBorder}"
|
||
BorderThickness="1"
|
||
CornerRadius="4">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="180" />
|
||
<ColumnDefinition Width="1" />
|
||
<ColumnDefinition Width="*" />
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<Grid Grid.Column="0">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="*" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<Border
|
||
Grid.Row="0"
|
||
Padding="6,5"
|
||
Background="{StaticResource HeaderBg}"
|
||
BorderBrush="{StaticResource SeparatorBrush}"
|
||
BorderThickness="0,0,0,1">
|
||
<StackPanel>
|
||
<WrapPanel/>
|
||
<WrapPanel Margin="0,4,0,0" Visibility="Collapsed">
|
||
<Button
|
||
Command="{Binding InsertReferencePointCommand}"
|
||
Content="参考点"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
<Button
|
||
Command="{Binding InsertSavePositionCommand}"
|
||
Content="添加位置"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
<Button
|
||
Command="{Binding InsertInspectionModuleCommand}"
|
||
Content="检测模块"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
<Button
|
||
Command="{Binding InsertInspectionMarkerCommand}"
|
||
Content="检测标记"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
<Button
|
||
Command="{Binding InsertPauseDialogCommand}"
|
||
Content="消息弹窗"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
<Button
|
||
Command="{Binding InsertWaitDelayCommand}"
|
||
Content="插入等待"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
<Button
|
||
Command="{Binding InsertCompleteProgramCommand}"
|
||
Content="完成"
|
||
Style="{StaticResource TreeToolbarButtonCompact}" />
|
||
</WrapPanel>
|
||
<WrapPanel Margin="0,4,0,0">
|
||
<WrapPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="Visibility" Value="Collapsed" />
|
||
</Style>
|
||
</WrapPanel.Resources>
|
||
<Button
|
||
Command="{Binding InsertReferencePointCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="参考点">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/reference.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="参考点" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Command="{Binding InsertSavePositionCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="添加位置">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/add-pos.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="添加位置" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Command="{Binding InsertInspectionModuleCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="检测模块">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/Module.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="检测模块" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Command="{Binding InsertInspectionMarkerCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="检测标记">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/mark.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="检测标记" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Command="{Binding InsertPauseDialogCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="消息弹窗">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/message.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="消息弹窗" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Command="{Binding InsertWaitDelayCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="插入等待">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/wait.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="插入等待" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Command="{Binding InsertCompleteProgramCommand}"
|
||
Style="{StaticResource TreeToolbarButtonCompact}"
|
||
ToolTip="完成">
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Icons/finish.png" Style="{StaticResource TreeToolbarIcon}" />
|
||
<TextBlock Text="完成" />
|
||
</StackPanel>
|
||
</Button>
|
||
</WrapPanel>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<TreeView
|
||
x:Name="CncTreeView"
|
||
Grid.Row="1"
|
||
Padding="3,5"
|
||
Background="Transparent"
|
||
BorderThickness="0"
|
||
ItemsSource="{Binding ProgramTreeRoots}"
|
||
PreviewKeyDown="CncTreeView_PreviewKeyDown"
|
||
SelectedItemChanged="CncTreeView_SelectedItemChanged">
|
||
<TreeView.Resources>
|
||
<HierarchicalDataTemplate
|
||
DataType="{x:Type vm:CncProgramTreeRootViewModel}"
|
||
ItemContainerStyle="{StaticResource TreeItemStyle}"
|
||
ItemsSource="{Binding Children}">
|
||
<Border
|
||
x:Name="ProgramRootCard"
|
||
Margin="0,1,0,3"
|
||
Padding="0,2"
|
||
Background="Transparent"
|
||
BorderBrush="Transparent"
|
||
BorderThickness="1"
|
||
CornerRadius="4">
|
||
<StackPanel Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="1,0,4,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="12"
|
||
Foreground="#2B8A3E"
|
||
Text="◆" />
|
||
<TextBlock
|
||
VerticalAlignment="Center"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="12"
|
||
FontWeight="SemiBold"
|
||
x:Name="ProgramRootNameText"
|
||
Text="{Binding DisplayName}"
|
||
TextTrimming="CharacterEllipsis" />
|
||
</StackPanel>
|
||
</Border>
|
||
<DataTemplate.Triggers>
|
||
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TreeViewItem}}" Value="True">
|
||
<Setter TargetName="ProgramRootCard" Property="Background" Value="#E7F1FB" />
|
||
<Setter TargetName="ProgramRootCard" Property="BorderBrush" Value="#9FC6E8" />
|
||
<Setter TargetName="ProgramRootNameText" Property="Foreground" Value="#111111" />
|
||
</DataTrigger>
|
||
</DataTemplate.Triggers>
|
||
</HierarchicalDataTemplate>
|
||
|
||
<HierarchicalDataTemplate
|
||
DataType="{x:Type vm:CncNodeViewModel}"
|
||
ItemContainerStyle="{StaticResource TreeItemStyle}"
|
||
ItemsSource="{Binding Children}">
|
||
<Border
|
||
x:Name="NodeCard"
|
||
Margin="0,1,0,1"
|
||
Padding="0"
|
||
Background="Transparent"
|
||
BorderBrush="Transparent"
|
||
BorderThickness="1"
|
||
CornerRadius="4">
|
||
<Grid x:Name="NodeRoot" MinHeight="23">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
</Grid.RowDefinitions>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="15" />
|
||
<ColumnDefinition Width="20" />
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="Auto" />
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<Grid Grid.RowSpan="2" Grid.Column="0">
|
||
<Border
|
||
x:Name="ChildStem"
|
||
Width="1"
|
||
Margin="7,0,0,0"
|
||
HorizontalAlignment="Left"
|
||
Background="{StaticResource TreeChildLineBrush}" />
|
||
<Border
|
||
x:Name="ChildBranch"
|
||
Width="8"
|
||
Height="1"
|
||
Margin="7,0,0,0"
|
||
HorizontalAlignment="Left"
|
||
VerticalAlignment="Center"
|
||
Background="{StaticResource TreeChildLineBrush}" />
|
||
</Grid>
|
||
|
||
<Border
|
||
Grid.RowSpan="2"
|
||
Grid.Column="1"
|
||
Width="16"
|
||
Height="16"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Background="Transparent"
|
||
CornerRadius="4">
|
||
<Image
|
||
Width="13"
|
||
Height="13"
|
||
Source="{Binding Icon}"
|
||
Stretch="Uniform" />
|
||
</Border>
|
||
|
||
<TextBlock
|
||
x:Name="NodeNameText"
|
||
Grid.Row="0"
|
||
Grid.Column="2"
|
||
Margin="3,0,0,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="11"
|
||
FontWeight="SemiBold"
|
||
Text="{Binding Name}"
|
||
TextTrimming="CharacterEllipsis" />
|
||
|
||
<StackPanel
|
||
x:Name="NodeActions"
|
||
Grid.Row="0"
|
||
Grid.Column="3"
|
||
Margin="0,0,2,0"
|
||
VerticalAlignment="Center"
|
||
Orientation="Horizontal"
|
||
Visibility="Collapsed">
|
||
<Button
|
||
Width="20"
|
||
Height="20"
|
||
Margin="1,0"
|
||
Background="White"
|
||
BorderBrush="#E05050"
|
||
BorderThickness="1"
|
||
Command="{Binding DataContext.DeleteNodeCommand, RelativeSource={RelativeSource AncestorType=TreeView}}"
|
||
Content="×"
|
||
Cursor="Hand"
|
||
FontSize="10"
|
||
ToolTip="删除" />
|
||
</StackPanel>
|
||
<Grid
|
||
x:Name="WaitDelayProgressHost"
|
||
Grid.Row="1"
|
||
Grid.Column="2"
|
||
Grid.ColumnSpan="2"
|
||
Margin="3,2,6,1"
|
||
Visibility="Collapsed">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="Auto" />
|
||
</Grid.ColumnDefinitions>
|
||
<ProgressBar
|
||
Height="6"
|
||
Minimum="0"
|
||
Maximum="100"
|
||
Value="{Binding ExecutionProgressPercent}" />
|
||
<TextBlock
|
||
Grid.Column="1"
|
||
Margin="6,-4,0,0"
|
||
VerticalAlignment="Center"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="10"
|
||
Foreground="#444444"
|
||
Text="{Binding ExecutionProgressText}" />
|
||
</Grid>
|
||
</Grid>
|
||
</Border>
|
||
<DataTemplate.Triggers>
|
||
<Trigger SourceName="NodeRoot" Property="IsMouseOver" Value="True">
|
||
<Setter TargetName="NodeActions" Property="Visibility" Value="Visible" />
|
||
<Setter TargetName="NodeCard" Property="Background" Value="#F6FAFD" />
|
||
<Setter TargetName="NodeCard" Property="BorderBrush" Value="#DFEAF3" />
|
||
</Trigger>
|
||
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TreeViewItem}}" Value="True">
|
||
<Setter TargetName="NodeActions" Property="Visibility" Value="Visible" />
|
||
<Setter TargetName="NodeCard" Property="Background" Value="#DCEEFF" />
|
||
<Setter TargetName="NodeCard" Property="BorderBrush" Value="#71A9DB" />
|
||
<Setter TargetName="NodeNameText" Property="Foreground" Value="#1F2D3D" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding ExecutionState}" Value="Running">
|
||
<Setter TargetName="NodeCard" Property="Background" Value="#FFD54F" />
|
||
<Setter TargetName="NodeCard" Property="BorderBrush" Value="#C89B00" />
|
||
<Setter TargetName="NodeNameText" Property="Foreground" Value="#1F1F1F" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding ExecutionState}" Value="Succeeded">
|
||
<Setter TargetName="NodeCard" Property="Background" Value="#FF2E7D32" />
|
||
<Setter TargetName="NodeCard" Property="BorderBrush" Value="#FF1B5E20" />
|
||
<Setter TargetName="NodeNameText" Property="Foreground" Value="White" />
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding ExecutionState}" Value="Failed">
|
||
<Setter TargetName="NodeCard" Property="Background" Value="#FFC62828" />
|
||
<Setter TargetName="NodeCard" Property="BorderBrush" Value="#FF8E0000" />
|
||
<Setter TargetName="NodeNameText" Property="Foreground" Value="White" />
|
||
</DataTrigger>
|
||
<MultiDataTrigger>
|
||
<MultiDataTrigger.Conditions>
|
||
<Condition Binding="{Binding IsWaitDelay}" Value="True" />
|
||
<Condition Binding="{Binding IsRunningNode}" Value="True" />
|
||
</MultiDataTrigger.Conditions>
|
||
<Setter TargetName="WaitDelayProgressHost" Property="Visibility" Value="Visible" />
|
||
</MultiDataTrigger>
|
||
</DataTemplate.Triggers>
|
||
</HierarchicalDataTemplate>
|
||
</TreeView.Resources>
|
||
<TreeView.ItemContainerStyle>
|
||
<Style BasedOn="{StaticResource TreeItemStyle}" TargetType="TreeViewItem">
|
||
<Setter Property="behaviors:CncExecutionScrollBehavior.AutoScroll" Value="{Binding IsRunningNode}" />
|
||
</Style>
|
||
</TreeView.ItemContainerStyle>
|
||
</TreeView>
|
||
</Grid>
|
||
|
||
<Rectangle
|
||
Grid.Column="1"
|
||
Width="1"
|
||
Fill="{StaticResource SeparatorBrush}" />
|
||
|
||
<Grid Grid.Column="2">
|
||
<ScrollViewer
|
||
x:Name="NodePropertyEditor"
|
||
VerticalScrollBarVisibility="Auto">
|
||
<Grid Margin="10">
|
||
<StackPanel Visibility="{Binding SelectedNode, Converter={StaticResource NullToVisibilityConverter}}">
|
||
<TextBlock Style="{StaticResource EditorTitle}" Text="节点属性" />
|
||
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="名称" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Name, UpdateSourceTrigger=PropertyChanged}" />
|
||
|
||
<UniformGrid Margin="0,0,0,8" Columns="2">
|
||
<StackPanel Margin="0,0,6,0">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="索引" />
|
||
<Label Style="{StaticResource DisplayValueLabel}" Content="{Binding SelectedNode.Index, Mode=OneWay}" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="类型" />
|
||
<Label Style="{StaticResource DisplayValueLabel}" Content="{Binding SelectedNode.NodeTypeDisplay, Mode=OneWay}" />
|
||
</StackPanel>
|
||
</UniformGrid>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="运动参数"
|
||
Visibility="{Binding SelectedNode.IsMotionSnapshotNode, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<UniformGrid Margin="8,8,8,6" Columns="2">
|
||
<StackPanel Margin="0,0,6,0">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="载物台 X (μm)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.StageX, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="载物台 Y (μm)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.StageY, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel Margin="0,0,6,0">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="射线源 Z (μm)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.SourceZ, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="探测器 Z (μm)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.DetectorZ, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel Margin="0,0,6,0">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="探测器摆动 (°)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.DetectorSwing, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="载物台旋转 (°)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.StageRotation, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel Margin="0,0,6,0">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="夹具旋转 (°)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.FixtureRotation, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="FOD (μm)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.FOD, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel Margin="0,0,6,0">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="FDD (μm)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.FDD, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="放大倍率" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Magnification, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="射线源"
|
||
Visibility="{Binding SelectedNode.IsReferencePoint, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="8,8,8,6">
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="电压 (kV)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Voltage, UpdateSourceTrigger=LostFocus}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="电流 (uA)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Current, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="保存参数"
|
||
Visibility="{Binding SelectedNode.IsSaveNode, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="8,8,8,6">
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="电压 (kV)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Voltage, UpdateSourceTrigger=LostFocus}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="功率 (W)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Power, UpdateSourceTrigger=LostFocus}" />
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="探测器已连接" IsChecked="{Binding SelectedNode.DetectorConnected}" />
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="探测器正在采集" IsChecked="{Binding SelectedNode.DetectorAcquiring}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="帧率" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.FrameRate, UpdateSourceTrigger=LostFocus}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="分辨率" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Resolution, UpdateSourceTrigger=PropertyChanged}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="保存参数"
|
||
Visibility="{Binding SelectedNode.IsSaveNodeWithImage, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="8,8,8,6">
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="电压 (kV)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Voltage, UpdateSourceTrigger=LostFocus}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="功率 (W)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Power, UpdateSourceTrigger=LostFocus}" />
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="探测器已连接" IsChecked="{Binding SelectedNode.DetectorConnected}" />
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="探测器正在采集" IsChecked="{Binding SelectedNode.DetectorAcquiring}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="帧率" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.FrameRate, UpdateSourceTrigger=LostFocus}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="分辨率" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.Resolution, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="图像文件" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.ImageFileName, UpdateSourceTrigger=PropertyChanged}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="位置参数"
|
||
Visibility="{Binding SelectedNode.IsSavePosition, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="8,8,8,6">
|
||
<CheckBox Style="{StaticResource EditorCheck}" Content="保存图像" IsChecked="{Binding SelectedNode.SaveImage}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="检测标记"
|
||
Visibility="{Binding SelectedNode.IsInspectionMarker, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="8,8,8,6">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="标记类型" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.MarkerType, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="MarkerX" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.MarkerX, UpdateSourceTrigger=LostFocus}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="MarkerY" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.MarkerY, UpdateSourceTrigger=LostFocus}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="消息弹窗"
|
||
Visibility="{Binding SelectedNode.IsPauseDialog, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="8,8,8,6">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="标题" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.DialogTitle, UpdateSourceTrigger=PropertyChanged}" />
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="消息内容" />
|
||
<TextBox
|
||
MinHeight="68"
|
||
Margin="0,0,0,8"
|
||
Padding="8,6"
|
||
AcceptsReturn="True"
|
||
BorderBrush="#CFCFCF"
|
||
BorderThickness="1"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="11"
|
||
Text="{Binding SelectedNode.DialogMessage, UpdateSourceTrigger=PropertyChanged}"
|
||
TextWrapping="Wrap" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox
|
||
Style="{StaticResource CompactGroupBox}"
|
||
Header="等待参数"
|
||
Visibility="{Binding SelectedNode.IsWaitDelay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||
<StackPanel Margin="10,8,10,6">
|
||
<TextBlock Style="{StaticResource LabelStyle}" Text="延时 (ms)" />
|
||
<TextBox Style="{StaticResource EditorBox}" Text="{Binding SelectedNode.DelayMilliseconds, UpdateSourceTrigger=LostFocus}" />
|
||
<ProgressBar
|
||
Height="8"
|
||
Margin="0,2,0,0"
|
||
Minimum="0"
|
||
Maximum="100"
|
||
Value="{Binding SelectedNode.ExecutionProgressPercent}"
|
||
Visibility="{Binding SelectedNode.IsDelayProgressVisible, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||
<TextBlock
|
||
Margin="0,4,0,0"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="10"
|
||
Foreground="#666666"
|
||
Text="{Binding SelectedNode.ExecutionProgressText}"
|
||
Visibility="{Binding SelectedNode.IsDelayProgressVisible, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
</StackPanel>
|
||
</Grid>
|
||
</ScrollViewer>
|
||
|
||
<views:PipelineEditorView
|
||
x:Name="InspectionModulePipelineEditor"
|
||
Margin="0"
|
||
Visibility="{Binding EditorVisibility}" />
|
||
|
||
<Border
|
||
x:Name="NodePropertyEmptyState"
|
||
Margin="12"
|
||
Padding="16"
|
||
Background="#FAFAFA"
|
||
BorderBrush="#E6E6E6"
|
||
BorderThickness="1"
|
||
CornerRadius="6">
|
||
<StackPanel>
|
||
<TextBlock
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="13"
|
||
FontWeight="SemiBold"
|
||
Text="未选择节点"
|
||
TextWrapping="Wrap" />
|
||
<TextBlock
|
||
Margin="0,6,0,0"
|
||
FontFamily="{StaticResource UiFont}"
|
||
FontSize="10"
|
||
Foreground="#666666"
|
||
Text="从左侧树中选择一个节点后,这里会显示对应的参数或检测流程。"
|
||
TextWrapping="Wrap" />
|
||
</StackPanel>
|
||
</Border>
|
||
</Grid>
|
||
</Grid>
|
||
</Border>
|
||
</UserControl>
|