using JiShe.CollectBus.Analyzers.Shared;
using JiShe.CollectBus.IoTDB.Attribute;
using JiShe.CollectBus.IoTDB.Enums;
using JiShe.CollectBus.IoTDB.Model;

namespace JiShe.CollectBus.Ammeters
{
    [EntityType(EntityTypeEnum.TableModel)]
    [SourceAnalyzers]
    public class ElectricityMeter : IoTEntity
    {
        [ATTRIBUTEColumn]
        public string MeterModel { get; set; }

        /// <summary>
        /// 下发消息内容
        /// </summary>
        [FIELDColumn]
        public string IssuedMessageHexString { get; set; }

        ///// <summary>
        ///// 下发消息Id
        ///// </summary>
        //[FIELDColumn]
        //public string IssuedMessageId { get; set; }

        [FIELDColumn]
        public double Voltage { get; set; }

        [FIELDColumn]
        public double Current { get; set; }

        [FIELDColumn]
        public double Power => Voltage * Current;

        [FIELDColumn]
        public double? Currentd { get; set; }
    }
}
