逻辑规则和CAN结合的更改
This commit is contained in:
@@ -20,15 +20,17 @@ namespace CapMachine.Wpf.Services
|
||||
{
|
||||
|
||||
public HighSpeedDataService HighSpeedDataService { get; }
|
||||
public LogicRuleService LogicRuleService { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 实例化函数
|
||||
/// </summary>
|
||||
public CanDriveService(HighSpeedDataService highSpeedDataService, IContainerProvider containerProvider)
|
||||
public CanDriveService(HighSpeedDataService highSpeedDataService, IContainerProvider containerProvider, LogicRuleService logicRuleService)
|
||||
{
|
||||
ToomossCanDrive = new ToomossCan(containerProvider);
|
||||
//高速数据服务
|
||||
HighSpeedDataService = highSpeedDataService;
|
||||
LogicRuleService = logicRuleService;
|
||||
|
||||
//ToomossCanDrive.StartCanDrive();
|
||||
}
|
||||
@@ -131,7 +133,6 @@ namespace CapMachine.Wpf.Services
|
||||
CmdData.Add(SendCanCmdData);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新速度信息
|
||||
/// 默认是启动
|
||||
@@ -141,7 +142,18 @@ namespace CapMachine.Wpf.Services
|
||||
{
|
||||
if (SpeedCanCmdData != null)
|
||||
{
|
||||
SpeedCanCmdData.SignalCmdValue = SpeedData;
|
||||
//首先是否判断是有斜率
|
||||
if (SpeedCanCmdData.LogicRuleDto == null)
|
||||
{
|
||||
//没有启动逻辑规则处理
|
||||
SpeedCanCmdData.SignalCmdValue = SpeedData;
|
||||
}
|
||||
else
|
||||
{
|
||||
//LogicRuleService.ApplyExpressionFast(SpeedData, SpeedCanCmdData.LogicRuleDto);
|
||||
SpeedCanCmdData.SignalCmdValue = LogicRuleService.ApplyExpressionFast(SpeedData, SpeedCanCmdData.LogicRuleDto);
|
||||
}
|
||||
|
||||
}
|
||||
//if (EnableCanCmdData != null)
|
||||
//{
|
||||
|
||||
Reference in New Issue
Block a user