更改主UI界面

This commit is contained in:
2025-04-27 17:50:57 +08:00
parent cf3d09cb3e
commit 96597c95f2
11 changed files with 545 additions and 284 deletions

View File

@@ -1,5 +1,6 @@
using AngleSharp.Dom.Events;
using CapMachine.Wpf.ChannelModel;
using CapMachine.Wpf.Models.Tag;
using CapMachine.Wpf.Services;
using ImTools;
using Masuit.Tools;
@@ -66,11 +67,6 @@ namespace CapMachine.Wpf.Models.ProModelPars
/// </summary>
public List<ProStepExe> ListProStepExe { get; set; }
/// <summary>
/// 仪表步骤执行时间信息
/// </summary>
public ProRunTime ProRunTimeModel { get; set; }
/// <summary>
/// 下一步步骤数据执行
/// </summary>
@@ -84,14 +80,27 @@ namespace CapMachine.Wpf.Models.ProModelPars
public ProStepExe CurProStepExe
{
get { return _CurProStepExe; }
set { _CurProStepExe = value;RaisePropertyChanged(); }
set { _CurProStepExe = value; RaisePropertyChanged(); }
}
///// <summary>
///// 当前步骤数据执行
///// 给看步骤是否变化使用
///// </summary>
//public ProStepExe CurProStepExe { get; set; }
private string _RunSegName;
/// <summary>
/// 运行的程序段名称
/// </summary>
public string RunSegName
{
get { return _RunSegName; }
set
{
if (value != _RunSegName)
{
RaisePropertyChanged();
}
_RunSegName = value;
}
}
/// <summary>
/// 上一步步骤数据执行
@@ -99,16 +108,29 @@ namespace CapMachine.Wpf.Models.ProModelPars
/// </summary>
public ProStepExe LastProStepExe { get; set; }
/// <summary>
/// 当前的变量标签
/// TagManger里面的标签信息
/// </summary>
public ShortControlTag CurShortControlTag { get; set; }
///// <summary>
///// 当前程序段步骤步骤时间长
///// 程序步骤里面一个整步
///// Sec
///// </summary>
//public int CurProStepRunTime { get; set; }
///// <summary>
///// 当前程序段步骤开始时间
///// 程序步骤里面一个整步
///// </summary>
//public DateTime CurProStepStartTime { set; get; }
/// <summary>
/// 当前程序段时间长
/// 仪表步骤执行时间信息
/// </summary>
public int CurProTimeSum { get; set; }
/// <summary>
/// 当前程序段开始时间
/// </summary>
public DateTime CurProStartTime { set; get; }
public ProStepRunTime ProStepRunTimeModel { get; set; }
#region
@@ -131,11 +153,13 @@ namespace CapMachine.Wpf.Models.ProModelPars
/// <summary>
/// 当前步骤开始运行时间
/// 这个是具体的小步骤(那个带斜坡循环的)的开始时间
/// </summary>
public DateTime StepStartDt { get; set; }
/// <summary>
/// 当前步骤结束运行时间
/// 这个是具体的小步骤(那个带斜坡循环的)的结束时间
/// </summary>
public DateTime StepEndDt { get; set; }
@@ -175,8 +199,12 @@ namespace CapMachine.Wpf.Models.ProModelPars
//速度执行结束发布事件
if (IsSpeed) SpeedRunEndEvent.Invoke(this, "OK");
//UI的标识清空
CurShortControlTag.StepExeInfo = "--";
//为空时不执行后续的数据
RunEnable = false;
return;
}
@@ -219,7 +247,7 @@ namespace CapMachine.Wpf.Models.ProModelPars
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),
IsSpeed=IsSpeed,
IsSpeed = IsSpeed,
ListStepExd = GetStepExds(NextProStepExe),//拓展参数
@@ -288,6 +316,10 @@ namespace CapMachine.Wpf.Models.ProModelPars
);
}
//当前的步骤信息的展示到UI上给TagManager的标签中心中
CurShortControlTag.StepExeInfo = NextProStepExe.StepExeInfo!;
//当前的SegName名称展示要展示到UI上以速度为主
RunSegName = NextProStepExe.ProSegName!;
////////准备新的数据///////////

View File

@@ -1,88 +0,0 @@
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; }
}
}

View File

@@ -73,10 +73,25 @@ namespace CapMachine.Wpf.Models.ProModelPars
set { _ProStepInfo = value;RaisePropertyChanged(); }
}
/////// <summary>
/////// 这个步骤是打开具体设置步骤界面的那个层面的信息例如2-3,代表是程序2里面的仪表步骤3方便调试和给液击使用
/////// </summary>
////public string? ProStepInfo { get; set; }
private string? _ProStep;
/// <summary>
/// 程序步骤的步骤信息
/// 比如例如2-3里面的2步骤信息就是大步骤的信息
/// </summary>
public string? ProStep
{
get { return _ProStep; }
set { _ProStep = value; RaisePropertyChanged(); }
}
/// <summary>
///步骤执行的信息
/// 0->8000
/// [00:00:12]
/// </summary>
public string? StepExeInfo { get; set; }
///// <summary>
///// 启用状态-没有启用就是什么数据都没有

View File

@@ -0,0 +1,55 @@
using Prism.Mvvm;
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 ProStepRunTime : BindableBase
{
public EventHandler<string> RunTimeCallSglEvent;
/// <summary>
/// 是否启用
/// </summary>
public bool RunEnable { get; set; } = false;
/// <summary>
/// 当前仪表程序步骤
/// </summary>
public int ProStep { get; set; }
/// <summary>
/// 当前步骤开始运行时间
/// </summary>
public DateTime StartDt { get; set; }
private DateTime currentDateTime;
/// <summary>
/// 当前时间
/// </summary>
public DateTime CurrentDateTime
{
get
{
return currentDateTime;
}
set
{
currentDateTime = value;
}
}
/// <summary>
/// 当前步骤已经运行时长-秒
/// </summary>
public int RunTime { get; set; }
}
}