#初步CNC编辑界面
This commit is contained in:
@@ -21,7 +21,7 @@ namespace XplorePlane.ViewModels
|
|||||||
{
|
{
|
||||||
public class MainViewModel : BindableBase
|
public class MainViewModel : BindableBase
|
||||||
{
|
{
|
||||||
private const double CncEditorHostWidth = 1162d;
|
private const double CncEditorHostWidth = 710d;
|
||||||
private readonly ILoggerService _logger;
|
private readonly ILoggerService _logger;
|
||||||
private readonly IContainerProvider _containerProvider;
|
private readonly IContainerProvider _containerProvider;
|
||||||
private readonly IEventAggregator _eventAggregator;
|
private readonly IEventAggregator _eventAggregator;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
xmlns:views="clr-namespace:XplorePlane.Views"
|
xmlns:views="clr-namespace:XplorePlane.Views"
|
||||||
xmlns:vm="clr-namespace:XplorePlane.ViewModels.Cnc"
|
xmlns:vm="clr-namespace:XplorePlane.ViewModels.Cnc"
|
||||||
d:DesignHeight="760"
|
d:DesignHeight="760"
|
||||||
d:DesignWidth="600"
|
d:DesignWidth="702"
|
||||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
@@ -69,8 +69,8 @@
|
|||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Width="1162"
|
Width="702"
|
||||||
MinWidth="1162"
|
MinWidth="702"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Background="{StaticResource PanelBg}"
|
Background="{StaticResource PanelBg}"
|
||||||
BorderBrush="{StaticResource PanelBorder}"
|
BorderBrush="{StaticResource PanelBorder}"
|
||||||
@@ -78,11 +78,11 @@
|
|||||||
CornerRadius="4">
|
CornerRadius="4">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="248" />
|
<ColumnDefinition Width="200" />
|
||||||
<ColumnDefinition Width="1" />
|
<ColumnDefinition Width="1" />
|
||||||
<ColumnDefinition Width="292" />
|
<ColumnDefinition Width="250" />
|
||||||
<ColumnDefinition Width="1" />
|
<ColumnDefinition Width="1" />
|
||||||
<ColumnDefinition Width="620" />
|
<ColumnDefinition Width="250" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Column="0">
|
<Grid Grid.Column="0">
|
||||||
@@ -100,15 +100,17 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontFamily="{StaticResource UiFont}"
|
FontFamily="{StaticResource UiFont}"
|
||||||
FontSize="14"
|
FontSize="13"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Text="{Binding ProgramName, TargetNullValue=CNC编辑}" />
|
Text="{Binding ProgramName, TargetNullValue=CNC编辑}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,3,0,0"
|
Margin="0,3,0,0"
|
||||||
FontFamily="{StaticResource UiFont}"
|
FontFamily="{StaticResource UiFont}"
|
||||||
FontSize="10.5"
|
FontSize="10"
|
||||||
Foreground="#666666"
|
Foreground="#666666"
|
||||||
Text="模块节点下会自动显示标记、等待、消息等子节点" />
|
Text="模块节点下会自动显示标记、等待、消息等子节点。"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
@@ -293,7 +295,7 @@
|
|||||||
|
|
||||||
<GroupBox
|
<GroupBox
|
||||||
Style="{StaticResource CompactGroupBox}"
|
Style="{StaticResource CompactGroupBox}"
|
||||||
Header="采集参数"
|
Header="保存参数"
|
||||||
Visibility="{Binding SelectedNode.IsSaveNode, Converter={StaticResource BoolToVisibilityConverter}}">
|
Visibility="{Binding SelectedNode.IsSaveNode, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<StackPanel Margin="8,8,8,6">
|
<StackPanel Margin="8,8,8,6">
|
||||||
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
||||||
@@ -312,7 +314,7 @@
|
|||||||
|
|
||||||
<GroupBox
|
<GroupBox
|
||||||
Style="{StaticResource CompactGroupBox}"
|
Style="{StaticResource CompactGroupBox}"
|
||||||
Header="采集参数"
|
Header="保存参数"
|
||||||
Visibility="{Binding SelectedNode.IsSaveNodeWithImage, Converter={StaticResource BoolToVisibilityConverter}}">
|
Visibility="{Binding SelectedNode.IsSaveNodeWithImage, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<StackPanel Margin="8,8,8,6">
|
<StackPanel Margin="8,8,8,6">
|
||||||
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
<CheckBox Style="{StaticResource EditorCheck}" Content="射线源开启" IsChecked="{Binding SelectedNode.IsRayOn}" />
|
||||||
@@ -398,15 +400,17 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontFamily="{StaticResource UiFont}"
|
FontFamily="{StaticResource UiFont}"
|
||||||
FontSize="14"
|
FontSize="13"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Text="未选择节点" />
|
Text="未选择节点"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,6,0,0"
|
Margin="0,6,0,0"
|
||||||
FontFamily="{StaticResource UiFont}"
|
FontFamily="{StaticResource UiFont}"
|
||||||
FontSize="11"
|
FontSize="10"
|
||||||
Foreground="#666666"
|
Foreground="#666666"
|
||||||
Text="从左侧树中选择一个节点后,这里会显示可编辑的参数。" />
|
Text="从左侧树中选择一个节点后,这里会显示可编辑的参数。"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -434,15 +438,17 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontFamily="{StaticResource UiFont}"
|
FontFamily="{StaticResource UiFont}"
|
||||||
FontSize="14"
|
FontSize="13"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Text="未选择检测模块" />
|
Text="未选择检测模块"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,6,0,0"
|
Margin="0,6,0,0"
|
||||||
FontFamily="{StaticResource UiFont}"
|
FontFamily="{StaticResource UiFont}"
|
||||||
FontSize="11"
|
FontSize="10"
|
||||||
Foreground="#666666"
|
Foreground="#666666"
|
||||||
Text="请选择一个检测模块节点后,在这里拖拽算子并配置参数。" />
|
Text="请选择一个检测模块节点后,在这里拖拽算子并配置参数。"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -11,25 +11,23 @@
|
|||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<SolidColorBrush x:Key="PanelBg" Color="White" />
|
<SolidColorBrush x:Key="PanelBg" Color="White" />
|
||||||
<SolidColorBrush x:Key="PanelBorder" Color="#cdcbcb" />
|
<SolidColorBrush x:Key="PanelBorder" Color="#CDCBCB" />
|
||||||
<SolidColorBrush x:Key="SeparatorBrush" Color="#E0E0E0" />
|
<SolidColorBrush x:Key="SeparatorBrush" Color="#E0E0E0" />
|
||||||
<SolidColorBrush x:Key="AccentBlue" Color="#E3F0FF" />
|
<SolidColorBrush x:Key="AccentBlue" Color="#E3F0FF" />
|
||||||
<FontFamily x:Key="CsdFont">Microsoft YaHei UI</FontFamily>
|
<FontFamily x:Key="CsdFont">Microsoft YaHei UI</FontFamily>
|
||||||
|
|
||||||
<!-- 节点项样式 -->
|
|
||||||
<Style x:Key="PipelineNodeItemStyle" TargetType="ListBoxItem">
|
<Style x:Key="PipelineNodeItemStyle" TargetType="ListBoxItem">
|
||||||
<Setter Property="Padding" Value="0" />
|
<Setter Property="Padding" Value="0" />
|
||||||
<Setter Property="Margin" Value="0" />
|
<Setter Property="Margin" Value="0" />
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- 工具栏按钮样式 -->
|
|
||||||
<Style x:Key="ToolbarBtn" TargetType="Button">
|
<Style x:Key="ToolbarBtn" TargetType="Button">
|
||||||
<Setter Property="Width" Value="28" />
|
<Setter Property="Width" Value="52" />
|
||||||
<Setter Property="Height" Value="28" />
|
<Setter Property="Height" Value="28" />
|
||||||
<Setter Property="Margin" Value="2,0" />
|
<Setter Property="Margin" Value="2,0" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
<Setter Property="BorderBrush" Value="#cdcbcb" />
|
<Setter Property="BorderBrush" Value="#CDCBCB" />
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
<Setter Property="FontFamily" Value="Microsoft YaHei UI" />
|
<Setter Property="FontFamily" Value="Microsoft YaHei UI" />
|
||||||
<Setter Property="FontSize" Value="11" />
|
<Setter Property="FontSize" Value="11" />
|
||||||
@@ -44,21 +42,13 @@
|
|||||||
CornerRadius="4">
|
CornerRadius="4">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<!-- Row 0: 工具栏 -->
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
|
||||||
<!-- Row 2: 流水线节点列表 -->
|
|
||||||
<RowDefinition Height="2*" MinHeight="180" />
|
<RowDefinition Height="2*" MinHeight="180" />
|
||||||
<!-- Row 3: 分隔线 -->
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<!-- Row 4: 参数面板 -->
|
|
||||||
<RowDefinition Height="2*" MinHeight="80" />
|
<RowDefinition Height="2*" MinHeight="80" />
|
||||||
<!-- Row 5: 状态栏 -->
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- 标题栏:流水线名称 + 设备选择 -->
|
|
||||||
<!-- 工具栏 -->
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Padding="6,4"
|
Padding="6,4"
|
||||||
@@ -76,51 +66,23 @@
|
|||||||
Command="{Binding SavePipelineCommand}"
|
Command="{Binding SavePipelineCommand}"
|
||||||
Content="保存"
|
Content="保存"
|
||||||
Style="{StaticResource ToolbarBtn}"
|
Style="{StaticResource ToolbarBtn}"
|
||||||
ToolTip="保存流水线" />
|
ToolTip="保存当前检测模块流水线" />
|
||||||
<Button
|
<Button
|
||||||
Width="43"
|
Width="60"
|
||||||
Command="{Binding SaveAsPipelineCommand}"
|
Command="{Binding SaveAsPipelineCommand}"
|
||||||
Content="另存为"
|
Content="另存为"
|
||||||
Style="{StaticResource ToolbarBtn}"
|
Style="{StaticResource ToolbarBtn}"
|
||||||
ToolTip="另存为" />
|
ToolTip="导出当前检测模块流水线" />
|
||||||
<Button
|
<Button
|
||||||
Width="43"
|
Width="52"
|
||||||
Command="{Binding LoadPipelineCommand}"
|
Command="{Binding LoadPipelineCommand}"
|
||||||
Content="加载"
|
Content="加载"
|
||||||
Style="{StaticResource ToolbarBtn}"
|
Style="{StaticResource ToolbarBtn}"
|
||||||
ToolTip="加载流水线" />
|
ToolTip="将流水线模板加载到当前检测模块" />
|
||||||
<!--
|
|
||||||
<Button
|
|
||||||
Width="64"
|
|
||||||
Command="{Binding LoadImageCommand}"
|
|
||||||
Content="加载图像"
|
|
||||||
Style="{StaticResource ToolbarBtn}"
|
|
||||||
ToolTip="加载输入图像" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
Command="{Binding ExecutePipelineCommand}"
|
|
||||||
Content="▶"
|
|
||||||
Style="{StaticResource ToolbarBtn}"
|
|
||||||
ToolTip="执行流水线" />
|
|
||||||
<Button
|
|
||||||
Command="{Binding CancelExecutionCommand}"
|
|
||||||
Content="■"
|
|
||||||
Style="{StaticResource ToolbarBtn}"
|
|
||||||
ToolTip="取消执行" />
|
|
||||||
<Button
|
|
||||||
Command="{Binding DeletePipelineCommand}"
|
|
||||||
Content="🗑"
|
|
||||||
Style="{StaticResource ToolbarBtn}"
|
|
||||||
ToolTip="工具箱" />
|
|
||||||
-->
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 流水线节点列表(拖拽目标) -->
|
|
||||||
<ListBox
|
<ListBox
|
||||||
x:Name="PipelineListBox"
|
x:Name="PipelineListBox"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
@@ -139,7 +101,6 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- 连接线列:上半段 + 下半段 -->
|
|
||||||
<Line
|
<Line
|
||||||
x:Name="TopLine"
|
x:Name="TopLine"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
@@ -160,7 +121,6 @@
|
|||||||
Y1="0"
|
Y1="0"
|
||||||
Y2="14" />
|
Y2="14" />
|
||||||
|
|
||||||
<!-- 算子图标 -->
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="28"
|
Width="28"
|
||||||
@@ -178,7 +138,6 @@
|
|||||||
Text="{Binding IconPath}" />
|
Text="{Binding IconPath}" />
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- 算子名称 -->
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="6,0,0,0"
|
Margin="6,0,0,0"
|
||||||
@@ -187,7 +146,6 @@
|
|||||||
FontSize="12"
|
FontSize="12"
|
||||||
Text="{Binding DisplayName}" />
|
Text="{Binding DisplayName}" />
|
||||||
|
|
||||||
<!-- 操作按钮:上移 / 下移 / 删除(悬停显示) -->
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
x:Name="NodeActions"
|
x:Name="NodeActions"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -200,11 +158,11 @@
|
|||||||
Height="22"
|
Height="22"
|
||||||
Margin="1,0"
|
Margin="1,0"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="#cdcbcb"
|
BorderBrush="#CDCBCB"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Command="{Binding DataContext.MoveNodeUpCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
Command="{Binding DataContext.MoveNodeUpCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Content="▲"
|
Content="上"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
FontSize="10"
|
FontSize="10"
|
||||||
ToolTip="上移" />
|
ToolTip="上移" />
|
||||||
@@ -213,11 +171,11 @@
|
|||||||
Height="22"
|
Height="22"
|
||||||
Margin="1,0"
|
Margin="1,0"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="#cdcbcb"
|
BorderBrush="#CDCBCB"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Command="{Binding DataContext.MoveNodeDownCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
Command="{Binding DataContext.MoveNodeDownCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Content="▼"
|
Content="下"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
FontSize="10"
|
FontSize="10"
|
||||||
ToolTip="下移" />
|
ToolTip="下移" />
|
||||||
@@ -230,7 +188,7 @@
|
|||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Command="{Binding DataContext.RemoveOperatorCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
Command="{Binding DataContext.RemoveOperatorCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Content="✕"
|
Content="删"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
FontSize="10"
|
FontSize="10"
|
||||||
ToolTip="删除" />
|
ToolTip="删除" />
|
||||||
@@ -247,13 +205,12 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
<!-- 分隔线 -->
|
|
||||||
<Rectangle
|
<Rectangle
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Height="1"
|
Height="1"
|
||||||
Fill="{StaticResource SeparatorBrush}" />
|
Fill="{StaticResource SeparatorBrush}" />
|
||||||
|
|
||||||
<!-- 参数面板 -->
|
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
@@ -284,14 +241,14 @@
|
|||||||
<TextBox
|
<TextBox
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="4,2"
|
Padding="4,2"
|
||||||
BorderBrush="#cdcbcb"
|
BorderBrush="#CDCBCB"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
FontFamily="Microsoft YaHei UI"
|
FontFamily="Microsoft YaHei UI"
|
||||||
FontSize="11"
|
FontSize="11"
|
||||||
Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}">
|
Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}">
|
||||||
<TextBox.Style>
|
<TextBox.Style>
|
||||||
<Style TargetType="TextBox">
|
<Style TargetType="TextBox">
|
||||||
<Setter Property="BorderBrush" Value="#cdcbcb" />
|
<Setter Property="BorderBrush" Value="#CDCBCB" />
|
||||||
<Setter Property="Background" Value="White" />
|
<Setter Property="Background" Value="White" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding IsValueValid}" Value="False">
|
<DataTrigger Binding="{Binding IsValueValid}" Value="False">
|
||||||
@@ -309,7 +266,6 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
<!-- 状态栏 -->
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Padding="6,4"
|
Padding="6,4"
|
||||||
|
|||||||
Reference in New Issue
Block a user