添加项目文件。

This commit is contained in:
“hsc”
2026-07-29 13:12:27 +08:00
parent d6da766e2d
commit 8cf45d36b9
297 changed files with 35814 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Model.Models
{
/// <summary>
/// 可用设备方法项(供用户选择添加为监测通道)
/// </summary>
public class AvailableMethodItem
{
public string DeviceName { get; set; } = string.Empty;
/// <summary>硬件指纹(物理设备唯一标识)</summary>
public string Fingerprint { get; set; } = string.Empty;
public string MethodName { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
public MethodInfo MethodInfo { get; set; } = null!;
public object Device { get; set; } = null!;
}
}

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,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Models
{
public class HardwareReportArgs
{
/// <summary>作用域标识(台架名称)</summary>
public string Scope { get; set; } = string.Empty;
/// <summary>硬件指纹(物理设备唯一标识,如 "Tcp:192.168.1.1:5000"</summary>
public string HardwareFingerprint { get; set; } = string.Empty;
/// <summary>方法名</summary>
public string MethodName { get; set; } = string.Empty;
/// <summary>采样值</summary>
public double Value { get; set; }
/// <summary>采样时间</summary>
public DateTime Time { get; set; } = DateTime.Now;
}
}

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>();
}
}

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

@@ -0,0 +1,43 @@
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 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 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>();
}
}

View File

@@ -0,0 +1,27 @@
using System.IO.Ports;
namespace Model.Models
{
/// <summary>
/// 串口通信参数DeviceCommand 内部纯数据类,供设备类构造函数使用)。
/// 与 UIShare.UIViewModel.SerialPortConfigVM 字段一一对应,
/// StopBits / Parity 在此处使用 System.IO.Ports 强类型枚举,
/// 由 DeviceManager 从字符串解析后填入。
/// </summary>
public class SerialPortConfig
{
public string PortName { get; set; } = "COM1";
public int BaudRate { get; set; } = 9600;
public int DataBits { get; set; } = 8;
public StopBits StopBits { get; set; } = StopBits.One;
public Parity Parity { get; set; } = Parity.None;
public int ReadTimeout { get; set; } = 3000;
public int WriteTimeout { get; set; } = 3000;
}
}

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; } = "";
}
}

17
Model/Models/TcpConfig.cs Normal file
View File

@@ -0,0 +1,17 @@
namespace Model.Models
{
/// <summary>
/// TCP 通信参数DeviceCommand 内部纯数据类,供设备类构造函数使用)。
/// 与 UIShare.UIViewModel.TcpConfigVM 字段一一对应,由 DeviceManager 在实例化时填充。
/// </summary>
public class TcpConfig
{
public string IPAddress { get; set; } = "127.0.0.1";
public int Port { get; set; } = 502;
public int SendTimeout { get; set; } = 3000;
public int ReceiveTimeout { get; set; } = 3000;
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Models
{
public class TestReportModel
{
public Guid TestRoundId { get; set; }
public string Scope { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string FileName { get; set; }
}
}