添加项目文件。
This commit is contained in:
23
Model/Models/AvailableMethodItem.cs
Normal file
23
Model/Models/AvailableMethodItem.cs
Normal 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!;
|
||||
}
|
||||
}
|
||||
24
Model/Models/CanMessageShow.cs
Normal file
24
Model/Models/CanMessageShow.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
Model/Models/DeviceInfo.cs
Normal file
18
Model/Models/DeviceInfo.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
26
Model/Models/HardwareReportArgs.cs
Normal file
26
Model/Models/HardwareReportArgs.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
16
Model/Models/InstructionNode.cs
Normal file
16
Model/Models/InstructionNode.cs
Normal 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
16
Model/Models/Method.cs
Normal 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
43
Model/Models/Parameter.cs
Normal 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
19
Model/Models/Program.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
27
Model/Models/SerialPortConfig.cs
Normal file
27
Model/Models/SerialPortConfig.cs
Normal 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
45
Model/Models/Step.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
12
Model/Models/SubProgramItem.cs
Normal file
12
Model/Models/SubProgramItem.cs
Normal 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
17
Model/Models/TcpConfig.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
17
Model/Models/TestReportModel.cs
Normal file
17
Model/Models/TestReportModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user