增加CAN FD和规则的功能
This commit is contained in:
1073
CapMachine.Wpf/Views/CANFDConfigView.xaml
Normal file
1073
CapMachine.Wpf/Views/CANFDConfigView.xaml
Normal file
File diff suppressed because it is too large
Load Diff
28
CapMachine.Wpf/Views/CANFDConfigView.xaml.cs
Normal file
28
CapMachine.Wpf/Views/CANFDConfigView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CapMachine.Wpf.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// CANFDConfigView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class CANFDConfigView : UserControl
|
||||
{
|
||||
public CANFDConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
327
CapMachine.Wpf/Views/DialogLogicRuleView.xaml
Normal file
327
CapMachine.Wpf/Views/DialogLogicRuleView.xaml
Normal file
@@ -0,0 +1,327 @@
|
||||
<UserControl
|
||||
x:Class="CapMachine.Wpf.Views.DialogLogicRuleView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:CapMachine.Wpf.Views"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
Width="1600"
|
||||
Height="800"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<DataGrid
|
||||
Name="MainDatagrid"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
HeadersVisibility="Column"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ListLogicRuleDto}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="180"
|
||||
Binding="{Binding Name}"
|
||||
Header="规则名称" />
|
||||
<DataGridTextColumn
|
||||
Width="180"
|
||||
Binding="{Binding ParameterType}"
|
||||
Header="参数类型" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding Expression}"
|
||||
Header="表达式" />
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Binding="{Binding Description}"
|
||||
Header="描述" />
|
||||
</DataGrid.Columns>
|
||||
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<prism:InvokeCommandAction Command="{Binding GridSelectionChangedCmd}" CommandParameter="{Binding ElementName=MainDatagrid, Path=SelectedItem}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
<!-- 右侧编辑面板 -->
|
||||
<Grid Grid.Column="1" Margin="10,5,5,5">
|
||||
<Grid.Resources>
|
||||
<Style x:Key="EditLabelStyle" TargetType="TextBlock">
|
||||
<Setter Property="Width" Value="100" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5,0" />
|
||||
</Style>
|
||||
<Style x:Key="EditTextBoxStyle" TargetType="TextBox">
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="10,5" />
|
||||
<Setter Property="Padding" Value="5,3" />
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题 -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5"
|
||||
Padding="10,5"
|
||||
Background="#2196F3"
|
||||
CornerRadius="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="22"
|
||||
Foreground="White"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
Text="规则详情" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 名称 -->
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,5"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Text="" />
|
||||
<TextBlock Style="{StaticResource EditLabelStyle}" Text="规则名称" />
|
||||
<TextBox
|
||||
Width="250"
|
||||
Style="{StaticResource EditTextBoxStyle}"
|
||||
Text="{Binding SelectedRule.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 描述 -->
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,5"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Text="" />
|
||||
<TextBlock Style="{StaticResource EditLabelStyle}" Text="规则描述" />
|
||||
<TextBox
|
||||
Width="250"
|
||||
Style="{StaticResource EditTextBoxStyle}"
|
||||
Text="{Binding SelectedRule.Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 参数类型 -->
|
||||
<StackPanel
|
||||
Grid.Row="3"
|
||||
Margin="0,5"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Text="" />
|
||||
<TextBlock Style="{StaticResource EditLabelStyle}" Text="参数类型" />
|
||||
<TextBox
|
||||
Width="250"
|
||||
Style="{StaticResource EditTextBoxStyle}"
|
||||
Text="{Binding SelectedRule.ParameterType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<!-- 表达式 -->
|
||||
<StackPanel
|
||||
Grid.Row="4"
|
||||
Margin="0,5"
|
||||
Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
Style="{StaticResource EditLabelStyle}"
|
||||
Text="规则表达式:"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
<Border
|
||||
Margin="3,5"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<!--<RichTextBox 1)可输入公式;2)输入值用value 代替;3)公式需符合三元表达式,可嵌套
|
||||
Height="200"
|
||||
materialDesign:HintAssist.Hint="规则输入"
|
||||
AcceptsReturn="True"
|
||||
IsDocumentEnabled="True"
|
||||
IsReadOnly="False"
|
||||
SpellCheck.IsEnabled="True"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<FlowDocument>
|
||||
<Paragraph>
|
||||
<Run FontWeight="Bold">
|
||||
注意:
|
||||
1)可输入公式;
|
||||
2)输入值用value 代替;
|
||||
3)公式需符合三元表达式,可嵌套
|
||||
</Run>
|
||||
<LineBreak />
|
||||
<Run
|
||||
FontStyle="Normal"
|
||||
FontWeight="Bold"
|
||||
Foreground="Blue"
|
||||
Text="{Binding SelectedRule.Expression}" />
|
||||
<LineBreak />
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</RichTextBox>-->
|
||||
|
||||
<TextBox
|
||||
Height="360"
|
||||
Margin="0"
|
||||
Padding="5"
|
||||
AcceptsReturn="True"
|
||||
Background="#404040"
|
||||
FontSize="16"
|
||||
FontWeight="Bold"
|
||||
Foreground="WhiteSmoke"
|
||||
Text="{Binding SelectedRule.Expression, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
Text="1)可输入公式;2)输入值用value 代替;3)公式需符合三元表达式,可嵌套"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<StackPanel
|
||||
Grid.Row="5"
|
||||
Margin="0,20,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="5,0"
|
||||
Padding="15,5"
|
||||
Command="{Binding RuleCmd}"
|
||||
CommandParameter="Create">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Foreground="White"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Text="新建" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
Margin="5,0"
|
||||
Padding="15,5"
|
||||
Command="{Binding RuleCmd}"
|
||||
CommandParameter="Update">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Foreground="White"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Text="更新" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
Margin="5,0"
|
||||
Padding="15,5"
|
||||
Command="{Binding RuleCmd}"
|
||||
CommandParameter="Delete">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="18"
|
||||
Foreground="White"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Text="删除" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="10,10"
|
||||
Command="{Binding SaveCmd}"
|
||||
Content="确定"
|
||||
Foreground="White" />
|
||||
<!--<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding CancelCmd}"
|
||||
Content="取消"
|
||||
Foreground="White" />-->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
CapMachine.Wpf/Views/DialogLogicRuleView.xaml.cs
Normal file
28
CapMachine.Wpf/Views/DialogLogicRuleView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CapMachine.Wpf.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// DialogLogicRuleView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DialogLogicRuleView : UserControl
|
||||
{
|
||||
public DialogLogicRuleView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user