BDU/ATS/Models/StepModel.cs

107 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Newtonsoft.Json;
using PropertyChanged;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BDU.Models
{
[AddINotifyPropertyChangedInterface]
public class StepModel
{
#region
public StepModel()
{
}
public StepModel(StepModel source)
{
if (source == null) return;
ID = source.ID;
Index = source.Index;
Name = source.Name;
StepType = source.StepType;
LoopCount = source.LoopCount;
LoopStartStepId = source.LoopStartStepId;
OKExpression = source.OKExpression;
OKGotoStepID = source.OKGotoStepID;
NGGotoStepID = source.NGGotoStepID;
Description = source.Description;
IsUsed = source.IsUsed;
if (source.Method != null)
{
Method = new(source.Method);
}
if (source.SubProgram != null)
{
SubProgram = new(source.SubProgram);
}
}
#endregion
public Guid? ID { get; set; } = Guid.NewGuid();
public bool IsUsed { get; set; } = true;
public int Index { get; set; }
public string? Name { get; set; }
public string? StepType { get; set; }
public MethodModel? Method { get; set; }
public ProgramModel? SubProgram { get; set; }
/// <summary>
/// 仅LoopStart使用
/// </summary>
public int? LoopCount { get; set; }
/// <summary>
/// 运行时循环计数
/// </summary>
[JsonIgnore]
public int? CurrentLoopCount { get; set; }
/// <summary>
/// 仅LoopEnd使用关联LoopStart
/// </summary>
public Guid? LoopStartStepId { get; set; }
/// <summary>
/// 初始:-1 运行中0 成功1 异常2
/// </summary>
[JsonIgnore]
public int Result { get; set; } = -1;
[JsonIgnore]
public int? RunTime { get; set; }
public string? OKExpression { get; set; }
/// <summary>
/// 默认为0/0不跳转第一位为OK跳转的步骤序号第二位为NG跳转的步骤序号
/// </summary>
public string GotoSettingString { get; set; } = "";
public Guid? OKGotoStepID { get; set; }
public Guid? NGGotoStepID { get; set; }
public string? Description { get; set; }
[JsonIgnore]
public bool? isBrokenpoint { get; set; }
}
}