EquipmentProperty.cs 1.41 KB
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace HHECS.RobotTool.Model
{
    [Comment("设备属性")]
    public class EquipmentProperty
    {
        [Key]
        [Comment("主键")]
        public int Id { get; set; }

        [Comment("设备Id")]
        public int EquipmentId { get; set; }

        public virtual Equipment Equipment { get; set; } = null!;

        [Comment("属性编号")]
        public string Code { get; set; } = null!;

        [Comment("属性名称")]
        public string Name { get; set; } = null!;

        [Comment("节点地址")]
        public string DataAddress { get; set; } = null!;

        [Comment("数据类型")]
        [Column(Order = 5, TypeName = "nvarchar(25)")]
        public DataTypeConst DataType { get; set; }

        [Comment("值")]
        public string? Value { get; set; }

        [Comment("备注")]
        public string? Remark { get; set; }

        [Comment("创建时间")]
        public DateTime? CreateTime { get; set; }

        [Comment("修改时间")]
        public DateTime? UpdateTime { get; set; }
    }

    /// <summary>
    /// 数据类型
    /// </summary>
    public enum DataTypeConst
    {
        Float,
        Bool,
        Byte,
        Int16,
        UInt16,
        Int32,
        UInt32,
        Int64,
        UInt64,
        String,
    }
}