automapper框架优化

This commit is contained in:
hsc
2026-06-10 15:04:11 +08:00
parent 5452857299
commit 2e07c0c446
43 changed files with 612 additions and 293 deletions

View File

@@ -0,0 +1,24 @@
namespace Model.Models
{
/// <summary>
/// CAN 报文展示纯数据类(对应 UIShare.UIViewModel.CanMessageShowModel
/// </summary>
public class CanMessageShow
{
public byte { get; set; }
public int ID { get; set; }
public ulong { get; set; }
public byte { get; set; }
public bool FD { get; set; }
public bool IsTx { get; set; }
public byte[] Bytes { get; set; } = new byte[64];
public string? { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
namespace Model.Models
{
/// <summary>
/// 设备信息纯数据类(对应 UIShare.UIViewModel.DeviceInfoModel
/// </summary>
public class DeviceInfo
{
public string? DeviceName { get; set; }
public string? DeviceType { get; set; }
public string? Remark { get; set; }
public bool IsEnabled { get; set; }
public bool IsConnected { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace Model.Models
{
/// <summary>
/// 指令节点纯数据类(对应 UIShare.UIViewModel.InstructionNode
/// </summary>
public class InstructionNode
{
public string? Name { get; set; }
public IList<InstructionNode> Children { get; set; } = new List<InstructionNode>();
public object? Tag { get; set; }
}
}

16
Model/Models/Method.cs Normal file
View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace Model.Models
{
/// <summary>
/// 方法纯数据类(对应 UIShare.UIViewModel.MethodModel
/// </summary>
public class Method
{
public string? Name { get; set; }
public string? FullName { get; set; }
public IList<Parameter> Parameters { get; set; } = new List<Parameter>();
}
}

45
Model/Models/Parameter.cs Normal file
View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
namespace Model.Models
{
/// <summary>
/// 参数纯数据类(对应 UIShare.UIViewModel.ParameterModel
/// </summary>
public class Parameter
{
public Guid ID { get; set; } = Guid.NewGuid();
public bool IsVisible { get; set; } = true;
public string? Name { get; set; }
/// <summary>
/// 类型全名(对应 ParameterModel.Type 的 FullName
/// </summary>
public string? TypeName { get; set; }
/// <summary>
/// 参数类别Input / Output / Temp
/// </summary>
public string? Category { get; set; }
public bool IsGlobal { get; set; }
public object? Value { get; set; }
public object? LowerLimit { get; set; }
public object? UpperLimit { get; set; }
public bool Result { get; set; } = true;
public bool IsUseVar { get; set; }
public bool IsSave { get; set; }
public string? VariableName { get; set; }
public Guid? VariableID { get; set; }
}
}

19
Model/Models/Program.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace Model.Models
{
/// <summary>
/// 程序纯数据类(对应 UIShare.UIViewModel.ProgramModel
/// </summary>
public class Program
{
public Guid ID { get; set; } = Guid.NewGuid();
public IList<Step> StepCollection { get; set; } = new List<Step>();
public IList<Step> ErrorStepCollection { get; set; } = new List<Step>();
public IList<Parameter> Parameters { get; set; } = new List<Parameter>();
}
}

45
Model/Models/Step.cs Normal file
View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
namespace Model.Models
{
/// <summary>
/// 步骤纯数据类(对应 UIShare.UIViewModel.StepModel
/// </summary>
public class Step
{
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 Method? Method { get; set; }
public Program? SubProgram { get; set; }
public int? LoopCount { get; set; }
public int? CurrentLoopCount { get; set; }
public Guid? LoopStartStepId { get; set; }
public int Result { get; set; } = -1;
public int? RunTime { get; set; }
public string? OKExpression { get; set; }
public string GotoSettingString { get; set; } = "";
public Guid? OKGotoStepID { get; set; }
public Guid? NGGotoStepID { get; set; }
public string? Description { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
namespace Model.Models
{
/// <summary>
/// 子程序项纯数据类(对应 UIShare.UIViewModel.SubProgramItem
/// </summary>
public class SubProgramItem
{
public string Name { get; set; } = "";
public string FilePath { get; set; } = "";
}
}