增加LIN的规则功能
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
using CapMachine.Model.CANLIN;
|
||||
using CapMachine.Wpf.CanDrive;
|
||||
using CapMachine.Wpf.LinDrive;
|
||||
using ImTools;
|
||||
using Prism.Ioc;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Services
|
||||
{
|
||||
@@ -20,15 +14,19 @@ namespace CapMachine.Wpf.Services
|
||||
{
|
||||
public HighSpeedDataService HighSpeedDataService { get; }
|
||||
|
||||
public LogicRuleService LogicRuleService { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 实例化函数
|
||||
/// </summary>
|
||||
public LinDriveService(HighSpeedDataService highSpeedDataService, IContainerProvider containerProvider)
|
||||
public LinDriveService(HighSpeedDataService highSpeedDataService, IContainerProvider containerProvider, LogicRuleService logicRuleService)
|
||||
{
|
||||
ToomossLinDrive = new ToomossLin(containerProvider);
|
||||
//高速数据服务
|
||||
HighSpeedDataService = highSpeedDataService;
|
||||
|
||||
LogicRuleService = logicRuleService;
|
||||
|
||||
//ToomossLinDrive.StartLinDrive();
|
||||
}
|
||||
|
||||
@@ -171,16 +169,32 @@ namespace CapMachine.Wpf.Services
|
||||
/// <param name="canCmdData"></param>
|
||||
public void UpdateSpeedCmdData(double SpeedData)
|
||||
{
|
||||
//if (SpeedLinCmdData != null)
|
||||
//{
|
||||
// SpeedLinCmdData.SignalCmdValue = SpeedData;
|
||||
//}
|
||||
|
||||
if (SpeedLinCmdData != null)
|
||||
{
|
||||
SpeedLinCmdData.SignalCmdValue = SpeedData;
|
||||
}
|
||||
//if (EnableLinCmdData != null)
|
||||
//{
|
||||
// EnableLinCmdData.SignalCmdValue = 1;
|
||||
//}
|
||||
}
|
||||
//首先是否判断是有斜率
|
||||
if (SpeedLinCmdData.LogicRuleDto == null)
|
||||
{
|
||||
//没有启动逻辑规则处理
|
||||
SpeedLinCmdData.SignalCmdValue = SpeedData;
|
||||
}
|
||||
else
|
||||
{
|
||||
//LogicRuleService.ApplyExpressionFast(SpeedData, SpeedCanCmdData.LogicRuleDto);
|
||||
SpeedLinCmdData.SignalCmdValue = LogicRuleService.ApplyExpressionFast(SpeedData, SpeedLinCmdData.LogicRuleDto);
|
||||
//Console.WriteLine($"实时转换后转速值:{SpeedCanCmdData.SignalCmdValue}-SV值:{SpeedData}");
|
||||
}
|
||||
|
||||
//if (EnableLinCmdData != null)
|
||||
//{
|
||||
// EnableLinCmdData.SignalCmdValue = 1;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新压缩机使能数据
|
||||
|
||||
Reference in New Issue
Block a user