HalconFlowEditorView.xaml 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <UserControl x:Class="Plugins.Halcon.Views.HalconFlowEditorView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:loc="clr-namespace:TeamAAS.Localization;assembly=TeamAAS.Global"
  5. xmlns:hc="https://handyorg.github.io/handycontrol"
  6. xmlns:fe="clr-namespace:TeamAAS.FlowEditor;assembly=TeamAAS.FlowEngine"
  7. xmlns:v="clr-namespace:Plugins.Halcon.Views"
  8. Background="{DynamicResource SecondaryRegionBrush}">
  9. <DockPanel>
  10. <!-- 顶部工具栏 -->
  11. <Border DockPanel.Dock="Top" Height="36"
  12. Background="{DynamicResource RegionBrush}"
  13. BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
  14. <Grid>
  15. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,0">
  16. <TextBlock x:Name="TxtTitle" Text="{loc:Translate 'Halcon流程'}" FontSize="14" FontWeight="Bold"
  17. Foreground="{DynamicResource PrimaryTextBrush}" VerticalAlignment="Center" Margin="0,0,16,0"/>
  18. <TextBlock Text="{loc:Translate '(工具箱仅显示 HALCON 节点,按视觉类别分组;点节点查看该节点图层)'}" FontSize="11"
  19. Foreground="{DynamicResource SecondaryTextBrush}" VerticalAlignment="Center"/>
  20. </StackPanel>
  21. <Button x:Name="BtnProperties" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,0"
  22. Width="Auto" Height="Auto" Cursor="Hand"
  23. Background="Transparent" BorderThickness="0"
  24. Tag="{loc:Translate '打开 HALCON 流程属性设置(输入/输出参数映射、循环次数)'}"
  25. Click="BtnProperties_Click">
  26. <Path Data="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.97,5.03C9.38,5.27,8.85,5.59,8.35,5.97L5.96,5.01C5.73,4.92,5.49,5.01,5.37,5.23L3.45,8.55 c-0.12,0.21-0.08,0.47,0.12,0.61l2.03,1.58C5.55,11.04,5.53,11.36,5.53,11.69c0,0.32,0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.37,2.22 c0.04,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.43-0.17,0.47-0.41l0.37-2.22c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.75c-2.07,0-3.75-1.68-3.75-3.75 c0-2.07,1.68-3.75,3.75-3.75c2.07,0,3.75,1.68,3.75,3.75C15.75,14.07,14.07,15.75,12,15.75z"
  27. Width="22" Height="22" Stretch="Uniform"
  28. Fill="{DynamicResource PrimaryTextBrush}"/>
  29. </Button>
  30. </Grid>
  31. </Border>
  32. <!-- 主体:子流程编辑器。视觉显示面板在构造时注入其右侧面板(替换「节点信息」区) -->
  33. <Grid x:Name="EditorRoot">
  34. <fe:FlowEditorView x:Name="SubFlowEditor"/>
  35. <!-- 视觉显示面板:构造时经 SubFlowEditor.ReplaceNodeInfoPanel 注入右侧面板,不在此处布局 -->
  36. <Grid x:Name="VisionPanel" Visibility="Collapsed" MinHeight="320"
  37. Background="{DynamicResource RegionBrush}">
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="Auto"/> <!-- 标题 + 图层筛选 -->
  40. <RowDefinition Height="*"/> <!-- 大显示窗 -->
  41. <RowDefinition Height="Auto"/> <!-- 运行状态行 -->
  42. </Grid.RowDefinitions>
  43. <Grid Grid.Row="0" Margin="6,4,6,4">
  44. <TextBlock Text="{loc:Translate '视觉显示'}" FontSize="13" FontWeight="Bold"
  45. Foreground="{DynamicResource PrimaryTextBrush}" VerticalAlignment="Center"/>
  46. <ComboBox x:Name="LayerCombo" Width="170" HorizontalAlignment="Right"
  47. FontSize="12" ToolTip="{loc:Translate '筛选要显示的节点图层'}"
  48. SelectionChanged="LayerCombo_SelectionChanged"/>
  49. </Grid>
  50. <!-- 大显示窗(右键菜单含 缩放/适应/保存/绘制ROI) -->
  51. <ContentControl x:Name="DisplayHost" Grid.Row="1" Focusable="False"/>
  52. <!-- 运行状态行:当前显示的节点/图层数/批次 -->
  53. <TextBlock x:Name="RunStatusText" Grid.Row="2" Margin="6,4,6,4" FontSize="11" TextTrimming="CharacterEllipsis"
  54. Foreground="{DynamicResource SecondaryTextBrush}"
  55. Text="{loc:Translate '等待运行…(节点运行后自动显示其图层)'}"/>
  56. </Grid>
  57. </Grid>
  58. </DockPanel>
  59. </UserControl>