配置参数下载和解析的开发-未完成

This commit is contained in:
2025-02-24 11:21:23 +08:00
parent c22a8cc98f
commit d2ef6f9961
25 changed files with 2273 additions and 189 deletions

View File

@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapMachine.Wpf.Models.ProModelPars
{
/// <summary>
/// 程序运行时间
/// </summary>
public class ProRunTime
{
public EventHandler<string> RunTimeCallSglEvent;
/// <summary>
/// 是否启用
/// </summary>
public bool RunEnable { get; set; } = false;
/// <summary>
/// RunTimeCallSglEvent 是否注册关联方法
/// </summary>
public bool EventRegister { get; set; } = false;
/// <summary>
/// 当前仪表名称
/// </summary>
public string MeterName { get; set; }
/// <summary>
/// 当前程序段名称
/// </summary>
public string ProName { get; set; }
/// <summary>
/// 当前仪表程序步骤
/// </summary>
public int MeterStep { get; set; }
/// <summary>
/// 当前步骤开始运行时间
/// </summary>
public DateTime StartDateTime { get; set; }
/// <summary>
/// 当前步骤结束运行时间
/// </summary>
public DateTime EndDateTime { get; set; }
private DateTime currentDateTime;
/// <summary>
/// 当前时间
/// </summary>
public DateTime CurrentDateTime
{
get
{
return currentDateTime;
}
set
{
//value.ToString("yyyy-MM-dd HH:mm:ss") == EndDateTime.ToString("yyyy-MM-dd HH:mm:ss")
if (RunEnable == true && value >= EndDateTime)
{
currentDateTime = value;
RunEnable = false;
//时间到了触发下载新的步骤
//RunTimeCallSglEvent(ProName, MeterName, MeterStep);
//RunTimeCallSglEvent.BeginInvoke(ProName, MeterName, MeterStep, null, null);
//RunEnable = false;
}
else
{
currentDateTime = value;
RunTime = (int)(currentDateTime - StartDateTime).TotalSeconds;
}
}
}
/// <summary>
/// 当前步骤已经运行时长-秒
/// </summary>
public int RunTime { get; set; }
}
}