LIN 调度表 V1

This commit is contained in:
2025-08-14 11:26:01 +08:00
parent d6f6022482
commit 2312e6f611
15 changed files with 911 additions and 10 deletions

View File

@@ -57,7 +57,7 @@ namespace CapMachine.Wpf.LinDrive
HighSpeedDataService = ContainerProvider.Resolve<HighSpeedDataService>();
LoggerService = ContainerProvider.Resolve<ILogService>();
//Stopwatch.Frequency表示高精度计时器每秒的计数次数ticks/秒每毫秒的ticks数 = 每秒的ticks数 ÷ 1000
TicksPerMs = Stopwatch.Frequency / 1000.0;
}
@@ -378,7 +378,7 @@ namespace CapMachine.Wpf.LinDrive
}
IsReviceOk= true;
IsReviceOk = true;
//StringBuilder ValueStr = new StringBuilder(64);
//LDFParser.LDF_ExeFrameToBus(LDFHandle, new StringBuilder("ID_DATA"), 1);
@@ -614,7 +614,7 @@ namespace CapMachine.Wpf.LinDrive
}
}
IsSendOk=true;
IsSendOk = true;
}
}
@@ -666,7 +666,61 @@ namespace CapMachine.Wpf.LinDrive
#endregion
#region
private bool _SchEnable;
/// <summary>
/// 调度表使能
/// </summary>
public bool SchEnable
{
get { return _SchEnable; }
set
{
_SchEnable = value;
RaisePropertyChanged();
}
}
/// <summary>
/// 调度表数量
/// </summary>
public int SchCount { get; set; }
/// <summary>
/// 获取调度表数量
/// </summary>
/// <returns></returns>
public int GetSchCount()
{
SchCount = LDFParser.LDF_GetSchQuantity(LDFHandle);
return SchCount;
}
public void LinTest()
{
GetSchCount();
for (int i = 0; i < SchCount; i++)
{
StringBuilder pSchName = new StringBuilder();
var Ret = LDFParser.LDF_GetSchName(LDFHandle, i, pSchName);
if (Ret <= 0)
{
Console.WriteLine($"{pSchName.ToString()}");
}
else
{
Console.WriteLine("执行失败");
}
}
}
#endregion
/// <summary>
/// 关闭设备