EquipmentStatusRecord.cs 2.55 KB
using TableAttribute = System.ComponentModel.DataAnnotations.Schema.TableAttribute;
using ColumnAttribute = System.ComponentModel.DataAnnotations.Schema.ColumnAttribute;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace HHECS.Model.Entities
{
    /// <summary>
    /// 对于状态记录,理论上我们需要将多种设备统一状态记录,目前只有堆垛机
    /// 设备统一状态:故障、维护、手动、空闲、运行
    /// </summary>
    [Table("equipmentstatusrecord")]
    public class EquipmentStatusRecord : BaseEntityCU<long>
    {
        [Column(Order = 1)]
        public string EquipmentCode { get; set; }

        [Column(Order = 2)]
        public string EquipmentName { get; set; }

        /// <summary>
        /// 设备的状态,简单起见,记录文本,分为Error,Manual,Maintain,Idle,Running
        /// </summary>
        [Column(Order = 3)]
        public string EquipmentStatus { get; set; }

        /// <summary>
        /// 指示是否记录状态结束
        /// 持续时间以update减去create计算,默认还是按5秒没有接收到自动关闭
        /// </summary>
        [Column(Order = 4)]
        public bool IsEnd { get; set; }

        /// <summary>
        /// 仓库
        /// </summary>
        [Column(Order = 5)]
        public string WarehouseCode { get; set; }

        /// <summary>
        /// 持续时间
        /// </summary>
        [NotMapped]
        public TimeSpan? Time => Updated != null && Created != null ? Updated - Created : null;


        /// <summary>
        ///   行走电机温度(℃) lsw
        /// </summary>
        [NotMapped]
        public string WalkTemperature { get; set; }


        /// <summary>
        ///   行走电机振速(mm/s)lsw
        /// </summary>
        [NotMapped]
        public string WalkVibrationVelocity { get; set; }

        /// <summary>
        ///  升降电机温度(℃)lsw
        /// </summary>
        [NotMapped]
        public string LiftTemperature { get; set; }

        /// <summary>
        ///  升降电机振速(mm/s)lsw
        /// </summary>
        [NotMapped]
        public string LiftVibrationVelocity { get; set; }


        /// <summary>
        /// 运行电流
        /// </summary>
        [Column(Order = 5)]
        public string runCurrent { get; set; }


        /// <summary>
        /// 升降电流
        /// </summary>
        [Column(Order = 5)]
        public string liftCurrent { get; set; }

        [NotMapped]
        public string WarehouseCodeExt { get; set; }
    }

}