逻辑规则的初步增加工能:

1)规则的界面的增删改查
2)规则服务的初步测试,目前测试是OK的
This commit is contained in:
2025-04-21 17:10:11 +08:00
parent 5f85aed486
commit a7fc676b82
24 changed files with 1583 additions and 58 deletions

View File

@@ -10,7 +10,7 @@ namespace CapMachine.Model.CANLIN
/// <summary>
/// CAN和LIN的配置数据内容
/// </summary>
[Table(Name = "CanLinConfigContent")]
[Table(Name = "CanLinRWConfig")]
public class CanLinRWConfig
{
/// <summary>
@@ -61,5 +61,13 @@ namespace CapMachine.Model.CANLIN
public long CanLinConfigProId { get; set; }
public CanLinConfigPro? CanLinConfigPro { get; set; }
public long LogicRuleId { get; set; }
/// <summary>
/// CanLinConfig的逻辑转换规则
/// 比如速度下发的数据SV是4000但是下发到CAN的值是40可能是其他的逻辑转换规则这里就是保存其中的逻辑规则
/// </summary>
public LogicRule? LogicRule { get; set; }
}
}

View File

@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FreeSql" Version="3.5.102" />
<PackageReference Include="FreeSql" Version="3.5.202" />
</ItemGroup>
<ItemGroup>
<Folder Include="ProExecuteModel\" />

View File

@@ -0,0 +1,58 @@
using CapMachine.Model.CANLIN;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapMachine.Model
{
/// <summary>
/// 逻辑转换规则模型
/// </summary>
[Table(Name = "LogicRule")]
public class LogicRule
{
/// <summary>
/// 主键ID
/// </summary>
[Column(IsPrimary = true, IsIdentity = true)]
public long Id { get; set; }
/// <summary>
/// 规则名称
/// </summary>
[Column(Name = "Name", StringLength = 50)]
public string? Name { get; set; }
/// <summary>
/// 规则描述
/// </summary>
[Column(Name = "Description", StringLength = 200)]
public string? Description { get; set; }
/// <summary>
/// 规则表达式
/// </summary>
[Column(Name = "Expression", StringLength = 500)]
public string? Expression { get; set; }
/// <summary>
/// 适用的参数类型(如:转速、功率等)
/// </summary>
[Column(Name = "ParameterType", StringLength = 50)]
public string? ParameterType { get; set; }
[Column(ServerTime = DateTimeKind.Local, CanUpdate = false)]
public DateTime CreateTime { get; set; }
/// <summary>
/// ///////////////////////////////////////////导航属性///////////////////////////////////////////////////////
/// </summary>
public List<CanLinRWConfig>? CanLinRWConfigs { get; set; }
}
}