LIN SCH的更改
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using CapMachine.Model.CANLIN;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using CapMachine.Wpf.LinDrive;
|
||||
using ImTools;
|
||||
using Prism.Ioc;
|
||||
@@ -121,6 +122,11 @@ namespace CapMachine.Wpf.Services
|
||||
/// </summary>
|
||||
public List<LinCmdData> CmdData { get; set; } = new List<LinCmdData>();
|
||||
|
||||
/// <summary>
|
||||
/// 调度表LIN配置信息
|
||||
/// </summary>
|
||||
public List<LINScheduleConfigDto> ListLINScheduleConfig { get; set; } = new List<LINScheduleConfigDto>();
|
||||
|
||||
/// <summary>
|
||||
/// 增加发送的指令数据
|
||||
/// </summary>
|
||||
@@ -356,10 +362,42 @@ namespace CapMachine.Wpf.Services
|
||||
{
|
||||
if (CmdData.Count > 0)
|
||||
{
|
||||
ToomossLinDrive.IsCycleSend = true;
|
||||
//ToomossLinDrive.IsCycleSend = true;
|
||||
ToomossLinDrive.CmdData = CmdData;
|
||||
ToomossLinDrive.StartPrecisionCycleSendMsg();
|
||||
//ToomossLinDrive.StartPrecisionCycleSendMsg();
|
||||
//ToomossLinDrive.StartCycleSendMsg();
|
||||
|
||||
if (ToomossLinDrive.SchEnable)
|
||||
{
|
||||
//使用调度表的话,需要在调度表中配置信息后才可以进行操作
|
||||
var GroupMsg = ToomossLinDrive.CmdData.GroupBy(a => a.MsgName).ToList();
|
||||
foreach (var itemMsg in GroupMsg)
|
||||
{
|
||||
if (!ListLINScheduleConfig.ToList().Any(a => a.MsgName == itemMsg.Key))
|
||||
{
|
||||
System.Windows.MessageBox.Show($"你使能了调度表,但是调度表中没有设置【{itemMsg.Key}】信息,请设置后再操作", "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Hand);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ListLINScheduleConfig == null && ListLINScheduleConfig!.Count() == 0)
|
||||
{
|
||||
System.Windows.MessageBox.Show("调度表配置为空数据,请检查!将无法发送数据", "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Hand);
|
||||
return;
|
||||
}
|
||||
|
||||
ToomossLinDrive.ListLINScheduleConfig = ListLINScheduleConfig!;
|
||||
ToomossLinDrive.StartSchedule();
|
||||
ToomossLinDrive.StartCycleUpdateCmd();
|
||||
}
|
||||
else
|
||||
{
|
||||
ToomossLinDrive.StartPrecisionCycleSendMsg();
|
||||
//ToomossCanDrive.StartCycleSendMsg();
|
||||
}
|
||||
|
||||
ToomossLinDrive.IsCycleSend = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user