You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace IoTSharp.Gateways.Data
{
public class Client
{
[Key]
public Guid Id { get; set; }
/// <summary>
///
/// </summary>
/// <example>
/// DTU: dtu://dev.ttyS0:115200
/// DTU: dtu://COM1:115200
/// TCP: tcp://www.host.com:602
// DTU over TCP: d2t://www.host.com:602
/// </example>
[Required]
[DisplayName("从机地址")]
[Description("Linux下串口格式 dtu://dev.ttyS0:115200 Windows下串口格式 dtu://COM1:115200 TCP格式 d2t://www.host.com:602")]
public Uri Address { get; set; }
/// <summary>
/// 连接超时和读取写入超时 按秒
/// </summary>
[DisplayName("连接和读写超时")]
public int TimeOut { get; set; }
[Required]
[DisplayName("设备名称")]
public string DeviceName { get; set; }
/// <summary>
/// 如果为空, 则直接使用 DeviceName ,
/// 否则, 使用 PointMapping 里面的 映射ID作为设备名称。 {Name}-{ID} , 前提是PointMappings中要有 如果没有, 则为空。
/// </summary>
[DisplayName("设备名称格式")]
public string? DeviceNameFormat { get; set; }
/// <summary>
/// 时间间隔 秒为单位。
/// </summary>
[DisplayName("采集间隔")]
public float TimeInterval { get; set; }
}
}