补全其他参数的下载参数
运行 停止 暂停的防呆操作
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using CapMachine.Wpf.ChannelModel;
|
||||
using AngleSharp.Dom.Events;
|
||||
using CapMachine.Wpf.ChannelModel;
|
||||
using CapMachine.Wpf.Services;
|
||||
using ImTools;
|
||||
using Masuit.Tools;
|
||||
@@ -34,8 +35,13 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
||||
CycleTimer.AutoReset = true;
|
||||
CycleTimer.Enabled = true;
|
||||
CycleTimer.Start();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否是速度仪表参数
|
||||
/// </summary>
|
||||
public bool IsSpeed { get; set; }=false;
|
||||
|
||||
/// <summary>
|
||||
/// 程序执行管道
|
||||
@@ -96,7 +102,11 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
||||
|
||||
#region 仪表步骤执行时间信息
|
||||
|
||||
public EventHandler<string> RunTimeCallSglEvent;
|
||||
/// <summary>
|
||||
/// 速度运行结束事件
|
||||
/// </summary>
|
||||
public event EventHandler<string> SpeedRunEndEvent;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
@@ -145,12 +155,17 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
||||
//RunEnable = false;
|
||||
//时间到了触发下载下一步步骤
|
||||
|
||||
|
||||
|
||||
//不为空的数据
|
||||
if (NextProStepExe == null)
|
||||
{
|
||||
Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} 【参数名称】:{MeterName} " +
|
||||
$"【Msg】:当前仪表参数全部执行完毕 ");
|
||||
|
||||
//速度执行结束发布事件
|
||||
if (IsSpeed) SpeedRunEndEvent.Invoke(this, "OK");
|
||||
|
||||
//为空时不执行后续的数据
|
||||
RunEnable = false;
|
||||
return;
|
||||
@@ -185,6 +200,18 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
||||
////////发送步骤信息///////////
|
||||
if (NextProStepExe.ExistSlop)
|
||||
{
|
||||
//存在斜坡数据,SV是通过集合陆续打点写入,但是PID和Limit需要判断是否要写入,只要写一次即可
|
||||
ProRunChannel.Writer.WriteAsync(new ProRunChannelData()
|
||||
{
|
||||
MeterName = MeterName,
|
||||
SV = NextProStepExe.EndSV,
|
||||
ProSegName = NextProStepExe.ProSegName,
|
||||
MeterStep = NextProStepExe.MeterStep,
|
||||
CurLoadLimit = LimitResult == true ? new Limit() { Up = (short)NextProStepExe.CurConfigLimitDto.Up, Down = (short)NextProStepExe.CurConfigLimitDto.Down } : new Limit(),
|
||||
CurLoadPID = PidResult == true ? new PID() { P = (short)NextProStepExe.CurConfigPIDDto.P, I = (short)NextProStepExe.CurConfigPIDDto.I, D = (short)NextProStepExe.CurConfigPIDDto.D } : new PID(),
|
||||
RunStepType = GetRunStepType(PidResult, LimitResult, false),
|
||||
});
|
||||
|
||||
//存在坡度数据
|
||||
var SecStepDur = NextProStepExe.EndSV - NextProStepExe.StartSV;
|
||||
var SecStepValue = SecStepDur * 1.0 / NextProStepExe.KeepTime;
|
||||
@@ -256,7 +283,7 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
||||
if (ListProStepExe.Where(x => x.MeterStep == CurProStepExe.MeterStep + 1).Any())
|
||||
{
|
||||
//存在下一步数据
|
||||
NextProStepExe = ListProStepExe.FirstOrDefault(x => x.MeterStep == CurProStepExe.MeterStep + 1);
|
||||
NextProStepExe = ListProStepExe.FirstOrDefault(x => x.MeterStep == CurProStepExe.MeterStep + 1)!;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -312,6 +339,18 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
||||
{
|
||||
return RunStepType.StepSV;
|
||||
}
|
||||
else if (pid && limit)
|
||||
{
|
||||
return RunStepType.LimitPid;
|
||||
}
|
||||
else if (limit)
|
||||
{
|
||||
return RunStepType.Limit;
|
||||
}
|
||||
else if (pid)
|
||||
{
|
||||
return RunStepType.Pid;
|
||||
}
|
||||
else
|
||||
{
|
||||
return RunStepType.Step;
|
||||
|
||||
Reference in New Issue
Block a user