2025-07-14 21:08:46 +08:00
|
|
|
<UserControl x:Class="VisionFrame.Views.FlowTabView"
|
|
|
|
|
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:VisionFrame.Views"
|
2025-07-15 19:14:03 +08:00
|
|
|
xmlns:extensions="clr-namespace:VisionFrame.Extensions"
|
2025-07-14 21:08:46 +08:00
|
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
|
|
xmlns:n="clr-namespace:VisionFrame.Nodes"
|
|
|
|
|
xmlns:base="clr-namespace:VisionFrame.Base.TemplateSelector;assembly=VisionFrame.Base"
|
|
|
|
|
xmlns:c="clr-namespace:VisionFrame.Base.Converter;assembly=VisionFrame.Base"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
d:DesignHeight="450" d:DesignWidth="1000">
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
<BooleanToVisibilityConverter x:Key="b2v"/>
|
|
|
|
|
<c:StringToNodeConverter x:Key="s2n"/>
|
|
|
|
|
<c:SizeConverter x:Key="sc"/>
|
|
|
|
|
<c:LocationConverter x:Key="lc"/>
|
|
|
|
|
|
|
|
|
|
<DataTemplate x:Key="folder_temp">
|
|
|
|
|
<Grid Grid.Row="1" Height="30">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="24"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="{Binding ArgName}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding ArgType}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding Direction}" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
|
|
|
|
|
<!--Mode=2的情况-->
|
|
|
|
|
<Border Grid.Column="3" CornerRadius="3" BorderBrush="#DDD"
|
|
|
|
|
BorderThickness="1" Height="24" Margin="0,0,3,0" Name="bor1">
|
|
|
|
|
<TextBox Text="{Binding ArgValue,UpdateSourceTrigger=PropertyChanged}" Grid.Column="3" BorderThickness="0"
|
|
|
|
|
Margin="3" VerticalAlignment="Center"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<Button Grid.Column="4" Content="···" Margin="0,0,2,0" Height="24" FontWeight="Normal"
|
|
|
|
|
Style="{x:Null}" Foreground="#333" Name="btn1"
|
|
|
|
|
Command="{Binding DataContext.SelectFolderCommand,ElementName=root}"
|
|
|
|
|
CommandParameter="{Binding}">
|
|
|
|
|
<Button.Template>
|
|
|
|
|
<ControlTemplate TargetType="Button">
|
|
|
|
|
<Border Background="#EEE" CornerRadius="3" x:Name="border">
|
|
|
|
|
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter TargetName="border" Property="Background" Value="#DDD"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Button.Template>
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
<DataTemplate x:Key="dropdown_temp">
|
|
|
|
|
<Grid Grid.Row="1" Height="30">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="24"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="{Binding ArgName}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding ArgType}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding Direction}" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
|
|
|
|
|
<!--Mode=0-->
|
|
|
|
|
<Border Grid.Column="3" CornerRadius="3" BorderBrush="#DDD"
|
|
|
|
|
BorderThickness="1" Height="26" Margin="0,0,3,0" Name="bor3">
|
|
|
|
|
<ComboBox Grid.Column="3" Height="24" VerticalContentAlignment="Center"
|
|
|
|
|
BorderThickness="0" Background="Transparent"
|
|
|
|
|
SelectedIndex="-1"
|
|
|
|
|
SelectedValue="{Binding ArgValue}"
|
|
|
|
|
Text="{Binding ArgValue}"
|
|
|
|
|
ItemsSource="{Binding DataContext.ArgumentList,ElementName=root}"
|
|
|
|
|
DisplayMemberPath="ArgName"
|
|
|
|
|
SelectedValuePath="ArgName"/>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
<DataTemplate x:Key="textbox_temp">
|
|
|
|
|
<Grid Grid.Row="1" Height="30">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="24"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="{Binding ArgName}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding ArgType}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding Direction}" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
|
|
|
|
|
<!--Mode=1的情况-->
|
|
|
|
|
<Border Grid.Column="3" CornerRadius="3" BorderBrush="#DDD"
|
|
|
|
|
BorderThickness="1" Height="24" Margin="0,0,3,0" Name="bor2">
|
|
|
|
|
<TextBox Text="{Binding ArgValue,UpdateSourceTrigger=PropertyChanged}" Grid.Column="3" BorderThickness="0"
|
|
|
|
|
Margin="3" VerticalAlignment="Center"/>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
<DataTemplate x:Key="compare_temp">
|
|
|
|
|
<Grid Grid.Row="1" Height="30">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="24"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="{Binding ArgName}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding ArgType}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding Direction}" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
|
|
|
|
|
<!--Mode=3-->
|
|
|
|
|
<Border Grid.Column="3" CornerRadius="3" BorderBrush="#DDD"
|
|
|
|
|
BorderThickness="1" Height="26" Margin="0,0,3,0" Name="bor3">
|
|
|
|
|
<ComboBox Grid.Column="3" Height="24" VerticalContentAlignment="Center"
|
|
|
|
|
BorderThickness="0" Background="Transparent"
|
|
|
|
|
SelectedItem="{Binding ArgValue}"
|
|
|
|
|
Text="{Binding ArgValue}"
|
|
|
|
|
ItemsSource="{Binding DataContext.Operator,ElementName=root}"/>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
<Grid Name="root" ClipToBounds="True">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="360"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<!--网格背景-->
|
|
|
|
|
<Border Name="border_flow_back" ClipToBounds="True">
|
|
|
|
|
<Border.Background>
|
|
|
|
|
<VisualBrush TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,14,14">
|
|
|
|
|
<VisualBrush.Visual>
|
|
|
|
|
<Border Width="14" Height="14"
|
|
|
|
|
Background="#9FFF"
|
|
|
|
|
BorderBrush="#EEE"
|
|
|
|
|
BorderThickness="0,0,1,1"/>
|
|
|
|
|
</VisualBrush.Visual>
|
|
|
|
|
</VisualBrush>
|
|
|
|
|
</Border.Background>
|
|
|
|
|
|
|
|
|
|
<Canvas>
|
|
|
|
|
<!--画布部分-->
|
|
|
|
|
<Grid Width="{Binding ElementName=border_flow_back,Path=ActualWidth,Converter={StaticResource sc},ConverterParameter=2}"
|
|
|
|
|
Height="{Binding ElementName=border_flow_back,Path=ActualHeight,Converter={StaticResource sc},ConverterParameter=2}"
|
|
|
|
|
Name="flow_canvas" RenderTransformOrigin="0.5,0.5"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
Tag="{Binding ElementName=hwakeye_border}">
|
|
|
|
|
<Grid.Margin>
|
|
|
|
|
<MultiBinding Converter="{StaticResource lc}">
|
|
|
|
|
<Binding ElementName="border_flow_back" Path="ActualWidth"/>
|
|
|
|
|
<Binding ElementName="border_flow_back" Path="ActualHeight"/>
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
</Grid.Margin>
|
|
|
|
|
<Grid.RenderTransform>
|
|
|
|
|
<TransformGroup>
|
|
|
|
|
<ScaleTransform ScaleX="{Binding MainZoom}"
|
|
|
|
|
ScaleY="{Binding MainZoom}"/>
|
|
|
|
|
<TranslateTransform X="{Binding DragX}"
|
|
|
|
|
Y="{Binding DragY}"/>
|
|
|
|
|
</TransformGroup>
|
|
|
|
|
</Grid.RenderTransform>
|
|
|
|
|
<i:Interaction.Triggers>
|
|
|
|
|
<i:EventTrigger EventName="MouseWheel">
|
|
|
|
|
<i:CallMethodAction TargetObject="{Binding}"
|
|
|
|
|
MethodName="DoMainZoom"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="MouseRightButtonDown">
|
|
|
|
|
<i:InvokeCommandAction Command="{Binding CanvasMouseDownCommand}"
|
|
|
|
|
PassEventArgsToCommand="True"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="PreviewMouseMove">
|
|
|
|
|
<!--<i:InvokeCommandAction Command="{Binding CanvasMouseMoveCommand}"
|
|
|
|
|
PassEventArgsToCommand="True"/>-->
|
|
|
|
|
<i:CallMethodAction TargetObject="{Binding}"
|
|
|
|
|
MethodName="DoCanvasMouseMove"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="MouseRightButtonUp">
|
|
|
|
|
<i:InvokeCommandAction Command="{Binding CanvasMouseUpCommand}"
|
|
|
|
|
PassEventArgsToCommand="True"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
</i:Interaction.Triggers>
|
|
|
|
|
|
|
|
|
|
<!--动态生成的节点-->
|
|
|
|
|
<ItemsControl ItemsSource="{Binding NodeList}"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
AllowDrop="True">
|
|
|
|
|
<i:Interaction.Triggers>
|
|
|
|
|
<i:EventTrigger EventName="Drop">
|
|
|
|
|
<i:InvokeCommandAction Command="{Binding DragDropCommand}"
|
|
|
|
|
PassEventArgsToCommand="True"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="MouseLeftButtonDown">
|
|
|
|
|
<i:InvokeCommandAction Command="{Binding NodeMouseDownCommand}"
|
|
|
|
|
PassEventArgsToCommand="True"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="MouseMove">
|
|
|
|
|
<i:InvokeCommandAction Command="{Binding NodeMouseMoveCommand}"
|
|
|
|
|
PassEventArgsToCommand="True"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="MouseLeftButtonUp">
|
|
|
|
|
<i:InvokeCommandAction Command="{Binding NodeMouseUpCommand}"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
</i:Interaction.Triggers>
|
|
|
|
|
<ItemsControl.ItemContainerStyle>
|
|
|
|
|
<Style TargetType="ContentPresenter">
|
|
|
|
|
<Setter Property="Canvas.Left" Value="{Binding X}"/>
|
|
|
|
|
<Setter Property="Canvas.Top" Value="{Binding Y}"/>
|
|
|
|
|
</Style>
|
|
|
|
|
</ItemsControl.ItemContainerStyle>
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<Canvas/>
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<ContentControl Content="{Binding TargetNodeObject,Converter={StaticResource s2n}}"
|
|
|
|
|
Width="{Binding W}"
|
|
|
|
|
Height="{Binding H}">
|
|
|
|
|
<i:Interaction.Triggers>
|
|
|
|
|
<i:EventTrigger EventName="MouseLeftButtonDown">
|
|
|
|
|
<i:InvokeCommandAction
|
|
|
|
|
Command="{Binding DataContext.NodeMouseDownCommand,
|
|
|
|
|
RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
|
|
PassEventArgsToCommand="True"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
</i:Interaction.Triggers>
|
|
|
|
|
</ContentControl>
|
|
|
|
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
<!--生成连线的集合控件-->
|
|
|
|
|
<ItemsControl ItemsSource="{Binding LinkList}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<Canvas/>
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<!--<Line X1="{Binding StartX}" Y1="{Binding StartY}"
|
|
|
|
|
X2="{Binding EndX}" Y2="{Binding EndY}"
|
|
|
|
|
Stroke="Orange"
|
|
|
|
|
StrokeThickness="2"/>-->
|
|
|
|
|
<n:LineNode X1="{Binding StartX}" Y1="{Binding StartY}"
|
|
|
|
|
X2="{Binding EndX}" Y2="{Binding EndY}"
|
|
|
|
|
StartAnchor="{Binding StartAnchor}"
|
|
|
|
|
EndAnchor="{Binding EndAnchor}"/>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--节点参数区域-->
|
|
|
|
|
<Canvas Visibility="{Binding CurrentNodeModel.IsShowProperties,Converter={StaticResource b2v}}">
|
|
|
|
|
<Border Width="400" Height="auto"
|
|
|
|
|
Background="{x:Null}"
|
|
|
|
|
Canvas.Top="{Binding CurrentNodeModel.Y}"
|
|
|
|
|
Canvas.Left="{Binding CurrentNodeModel.X}">
|
|
|
|
|
<Border Background="White" Margin="0,40,0,0" CornerRadius="5">
|
|
|
|
|
<Border.Effect>
|
|
|
|
|
<DropShadowEffect Color="Gray" BlurRadius="5" ShadowDepth="0" Opacity="0.3"/>
|
|
|
|
|
</Border.Effect>
|
|
|
|
|
<Grid Margin="0,0,0,5">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="auto"/>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Border Background="#1000" CornerRadius="5,5,0,0"/>
|
|
|
|
|
<Grid Height="26" TextBlock.Foreground="#888">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition Width="60"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="20"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="参数名称" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="数据类型" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="传递方向" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="目标值" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<ItemsControl ItemsSource="{Binding CurrentNodeModel.Arguments}"
|
|
|
|
|
Grid.Row="1">
|
|
|
|
|
<ItemsControl.ItemTemplateSelector>
|
|
|
|
|
<base:NodeArgTemplateSelector
|
|
|
|
|
DropdownTempalte="{StaticResource dropdown_temp}"
|
|
|
|
|
TextBoxTempalte="{StaticResource textbox_temp}"
|
|
|
|
|
SelectFolderTempalte="{StaticResource folder_temp}"
|
|
|
|
|
CompareOpratorTempalte="{StaticResource compare_temp}"
|
|
|
|
|
/>
|
|
|
|
|
</ItemsControl.ItemTemplateSelector>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</Border>
|
|
|
|
|
</Border>
|
|
|
|
|
</Canvas>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<!--鹰眼视图-->
|
|
|
|
|
<Border Width="{Binding ElementName=border_flow_back,Path=ActualWidth,Converter={StaticResource sc},ConverterParameter=0.2}"
|
|
|
|
|
Height="{Binding ElementName=border_flow_back,Path=ActualHeight,Converter={StaticResource sc},ConverterParameter=0.2}"
|
|
|
|
|
Canvas.Bottom="10" Canvas.Right="10" BorderBrush="#DDD" BorderThickness="1"
|
|
|
|
|
Background="#F7F9FA"
|
|
|
|
|
Name="hwakeye_border"
|
|
|
|
|
Tag="{Binding ElementName=flow_canvas}">
|
|
|
|
|
<i:Interaction.Triggers>
|
|
|
|
|
<i:EventTrigger EventName="MouseMove">
|
|
|
|
|
<i:CallMethodAction TargetObject="{Binding}"
|
|
|
|
|
MethodName="HwakeyeMouseMove"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
<i:EventTrigger EventName="MouseLeftButtonUp">
|
|
|
|
|
<i:CallMethodAction TargetObject="{Binding}"
|
|
|
|
|
MethodName="HwakeyeMouseUp"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
</i:Interaction.Triggers>
|
|
|
|
|
<Border>
|
|
|
|
|
<Border.Background>
|
|
|
|
|
<BitmapCacheBrush Target="{Binding ElementName=flow_canvas}"/>
|
|
|
|
|
</Border.Background>
|
|
|
|
|
<Border BorderBrush="ForestGreen" BorderThickness="1"
|
|
|
|
|
Width="{Binding ElementName=hwakeye_border,Path=Width,Converter={StaticResource sc},ConverterParameter=0.5}"
|
|
|
|
|
Height="{Binding ElementName=hwakeye_border,Path=Height,Converter={StaticResource sc},ConverterParameter=0.5}"
|
|
|
|
|
Background="#8FFF"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5">
|
|
|
|
|
<Border.RenderTransform>
|
|
|
|
|
<TransformGroup>
|
|
|
|
|
<TranslateTransform X="{Binding HwakeyeDragX}" Y="{Binding HwakeyeDragY}"/>
|
|
|
|
|
<ScaleTransform ScaleX="{Binding HwakeyeZoom}" ScaleY="{Binding HwakeyeZoom}"/>
|
|
|
|
|
</TransformGroup>
|
|
|
|
|
</Border.RenderTransform>
|
|
|
|
|
|
|
|
|
|
<i:Interaction.Triggers>
|
|
|
|
|
<i:EventTrigger EventName="MouseLeftButtonDown">
|
|
|
|
|
<i:CallMethodAction TargetObject="{Binding}"
|
|
|
|
|
MethodName="HwakeyeViewMouseDown"/>
|
|
|
|
|
</i:EventTrigger>
|
|
|
|
|
</i:Interaction.Triggers>
|
|
|
|
|
</Border>
|
|
|
|
|
</Border>
|
|
|
|
|
</Border>
|
|
|
|
|
</Canvas>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--工具-->
|
|
|
|
|
<Border VerticalAlignment="Top" HorizontalAlignment="Left"
|
|
|
|
|
Height="26" CornerRadius="13" Background="#2000"
|
|
|
|
|
Margin="10">
|
|
|
|
|
<Grid Margin="8,0">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="auto"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}"
|
|
|
|
|
Command="{Binding RunCommand}"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="1" FontSize="18"
|
|
|
|
|
Command="{Binding CircleCommand}"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="2"
|
|
|
|
|
Command="{Binding StepCommand}"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="3"
|
|
|
|
|
Command="{Binding StopCommand}"/>
|
|
|
|
|
<Border Background="#EEE" Grid.Column="4" Width="1"
|
|
|
|
|
Margin="3,5"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="5" FontSize="18"
|
|
|
|
|
Command="{Binding ZoomIncreaseCommand}"
|
|
|
|
|
CommandParameter="{Binding ElementName=flow_canvas}"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="6" FontSize="18"
|
|
|
|
|
Command="{Binding ZoomReduceCommand}"
|
|
|
|
|
CommandParameter="{Binding ElementName=flow_canvas}"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="7" FontSize="18"
|
|
|
|
|
Command="{Binding ZoomResetCommand}"
|
|
|
|
|
CommandParameter="{Binding ElementName=flow_canvas}"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--图像显示、参数、日志-->
|
|
|
|
|
<Grid Grid.Column="1" Margin="3,0,0,0">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="auto"/>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<!--图像显示-->
|
|
|
|
|
<Border Grid.Column="1" Height="220">
|
|
|
|
|
<Border.Background>
|
|
|
|
|
<VisualBrush Viewport="0,0,16,16" ViewportUnits="Absolute" TileMode="Tile">
|
|
|
|
|
<VisualBrush.Visual>
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Border Background="#8C8C8C" Width="1" Height="1"/>
|
|
|
|
|
<Border Background="#767676" Width="1" Height="1" Grid.Column="1"/>
|
|
|
|
|
<Border Background="#767676" Width="1" Height="1" Grid.Row="1"/>
|
|
|
|
|
<Border Background="#8C8C8C" Width="1" Height="1" Grid.Row="1" Grid.Column="1"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</VisualBrush.Visual>
|
|
|
|
|
</VisualBrush>
|
|
|
|
|
</Border.Background>
|
|
|
|
|
<Image Stretch="UniformToFill" Source="{Binding PreviewImage}"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<Border Height="26" CornerRadius="13" Background="#656565" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5">
|
|
|
|
|
<Grid Margin="8,0">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="0" FontSize="18" Foreground="#5FFF"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="1" FontSize="18" Foreground="#5FFF"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="2" FontSize="18" Foreground="#5FFF"/>
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
Style="{StaticResource ToolButtonStyle}" Grid.Column="3" FontSize="16" Foreground="#5FFF"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--参数与日志-->
|
|
|
|
|
<TabControl Grid.Row="1" Margin="0,5,0,0"
|
|
|
|
|
BorderThickness="0,1,0,0" BorderBrush="#1f71e5"
|
|
|
|
|
Background="#5FFF" Padding="0">
|
2025-07-15 19:14:03 +08:00
|
|
|
|
2025-07-14 21:08:46 +08:00
|
|
|
<TabItem Style="{StaticResource NormalTabStyle}">
|
|
|
|
|
<TabItem.Header>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
2025-07-15 19:14:03 +08:00
|
|
|
<TextBlock Text="" FontFamily="{StaticResource Iconfont}"
|
2025-07-14 21:08:46 +08:00
|
|
|
FontSize="16" VerticalAlignment="Center" Margin="0,0,3,0"/>
|
2025-07-15 19:14:03 +08:00
|
|
|
<TextBlock Text="运行日志" VerticalAlignment="Center"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</TabItem.Header>
|
|
|
|
|
<ScrollViewer extensions:ScrollViewerExtensions.AlwaysScrollToEnd="True" VerticalScrollBarVisibility="Hidden">
|
|
|
|
|
<ItemsControl ItemsSource="{Binding LogList}">
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
|
|
|
|
<Grid Height="28" Margin="3,1">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="50"/>
|
|
|
|
|
<ColumnDefinition Width="80"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="{Binding Time ,StringFormat=HH:mm:ss}"
|
|
|
|
|
VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
|
|
|
Foreground="#888"/>
|
|
|
|
|
<TextBlock Text="{Binding NodeName}" Foreground="#333"
|
|
|
|
|
Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
|
|
|
<TextBlock Text="{Binding LogMessage}" Grid.Column="2" Foreground="#333"
|
|
|
|
|
VerticalAlignment="Center"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
</TabItem>
|
|
|
|
|
|
|
|
|
|
<TabItem Style="{StaticResource NormalTabStyle}">
|
|
|
|
|
<TabItem.Header>
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="" FontFamily="{StaticResource Iconfont}"
|
|
|
|
|
FontSize="16" VerticalAlignment="Center" Margin="0,0,3,0"/>
|
2025-07-14 21:08:46 +08:00
|
|
|
<TextBlock Text="流程参数管理" VerticalAlignment="Center"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</TabItem.Header>
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition />
|
|
|
|
|
<RowDefinition Height="auto"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<ListBox Background="Transparent" BorderThickness="0"
|
2025-07-15 19:14:03 +08:00
|
|
|
ItemsSource="{Binding ArgumentList}">
|
2025-07-14 21:08:46 +08:00
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Grid Height="30">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="120"/>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<Border Margin="3,3,1,3" CornerRadius="3" Background="#FFF">
|
|
|
|
|
<TextBox Text="{Binding ArgName,UpdateSourceTrigger=PropertyChanged}"
|
2025-07-15 19:14:03 +08:00
|
|
|
VerticalContentAlignment="Center"
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
Margin="2" FontWeight="Normal"
|
|
|
|
|
Foreground="#555"/>
|
2025-07-14 21:08:46 +08:00
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
<ComboBox Grid.Column="1" SelectedItem="{Binding ArgType}"
|
2025-07-15 19:14:03 +08:00
|
|
|
Margin="1,3" BorderThickness="0"
|
|
|
|
|
ItemsSource="{Binding DataContext.ArgTypeList,RelativeSource={RelativeSource AncestorType=UserControl}}">
|
2025-07-14 21:08:46 +08:00
|
|
|
|
|
|
|
|
</ComboBox>
|
|
|
|
|
|
|
|
|
|
<Button Content="" FontFamily="{StaticResource Iconfont}"
|
2025-07-15 19:14:03 +08:00
|
|
|
Grid.Column="2" Style="{StaticResource DeleteElementButtonStyle}"
|
|
|
|
|
FontSize="10" Width="22" Height="22"
|
|
|
|
|
Margin="0" Background="Transparent"
|
|
|
|
|
Command="{Binding DataContext.DelArgumentCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
|
|
CommandParameter="{Binding}"/>
|
2025-07-14 21:08:46 +08:00
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
|
<ListBox.ItemContainerStyle>
|
|
|
|
|
<Style TargetType="ListBoxItem">
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="ListBoxItem">
|
|
|
|
|
<Border Margin="3,1" CornerRadius="5" Background="#09000000">
|
|
|
|
|
<ContentPresenter/>
|
|
|
|
|
</Border>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
|
</ListBox>
|
|
|
|
|
|
|
|
|
|
<Border Height="1" Background="#DDD" VerticalAlignment="Top"
|
2025-07-15 19:14:03 +08:00
|
|
|
Grid.Row="1" Margin="5,0"/>
|
2025-07-14 21:08:46 +08:00
|
|
|
<Button Grid.Row="1" Height="30" Content="添加参数" Width="120"
|
2025-07-15 19:14:03 +08:00
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
Margin="5" Command="{Binding AddArgumentCommand}"/>
|
2025-07-14 21:08:46 +08:00
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</TabItem>
|
|
|
|
|
</TabControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</UserControl>
|