Files
DMS/DMS.Core/Models/Device.cs

68 lines
1.6 KiB
C#
Raw Normal View History

using DMS.Core.Enums;
using System.Collections.Generic;
2025-07-19 09:25:01 +08:00
namespace DMS.Core.Models;
2025-06-10 22:13:06 +08:00
2025-07-03 13:17:25 +08:00
/// <summary>
/// 代表一个可管理的物理或逻辑设备。
2025-07-03 13:17:25 +08:00
/// </summary>
public class Device
2025-06-10 22:13:06 +08:00
{
2025-07-03 13:17:25 +08:00
/// <summary>
/// 唯一标识符。
2025-07-03 13:17:25 +08:00
/// </summary>
2025-07-19 09:25:01 +08:00
public int Id { get; set; }
2025-07-03 13:17:25 +08:00
/// <summary>
/// 设备名称用于UI显示和识别。
2025-07-03 13:17:25 +08:00
/// </summary>
public string Name { get; set; }
2025-07-03 13:17:25 +08:00
/// <summary>
/// 设备的描述信息。
2025-07-03 13:17:25 +08:00
/// </summary>
public string Description { get; set; }
2025-07-03 13:17:25 +08:00
/// <summary>
/// 设备使用的通信协议。
2025-07-03 13:17:25 +08:00
/// </summary>
public ProtocolType Protocol { get; set; }
2025-07-03 13:17:25 +08:00
2025-07-04 14:42:28 +08:00
/// <summary>
/// 设备的IP地址。
2025-07-04 14:42:28 +08:00
/// </summary>
public string IpAddress { get; set; }
2025-07-04 14:42:28 +08:00
/// <summary>
/// 设备的通信端口号。
/// </summary>
public int Port { get; set; }
/// <summary>
/// S7 PLC的机架号。
/// </summary>
public int Rack { get; set; }
/// <summary>
/// S7 PLC的槽号。
/// </summary>
public int Slot { get; set; }
2025-07-03 13:17:25 +08:00
/// <summary>
/// OPC UA 服务器地址 (仅当 Protocol 为 OpcUa 时有效)。
2025-07-03 13:17:25 +08:00
/// </summary>
public string OpcUaServerUrl { get; set; }
2025-07-03 13:17:25 +08:00
/// <summary>
/// 指示此设备是否处于激活状态。只有激活的设备才会被轮询。
/// </summary>
public bool IsActive { get; set; }
2025-07-03 13:17:25 +08:00
/// <summary>
/// 此设备包含的变量表集合。
2025-07-03 13:17:25 +08:00
/// </summary>
public List<VariableTable> VariableTables { get; set; } = new();
public string CpuType { get; set; }
public DeviceType DeviceType { get; set; }
2025-06-10 22:13:06 +08:00
}