using Newtonsoft.Json;
using FreeSql.DataAnnotations;
using System;

namespace Txgy.EWS.Client.Entity
{
    [JsonObject(MemberSerialization.OptIn), Table(Name = "postproeventresult")]
    public class RemotePostproResultEntity
    {
        [JsonProperty, Column(DbType = "varchar(254)")]
        public string EventTime { get; set; }

        [JsonProperty, Column(DbType = "int")]
        public int LocSta { get; set; }

        [JsonProperty]
        public double ML { get; set; }

        [JsonProperty, Column(DbType = "int")]
        public int MLSta { get; set; }

        [JsonProperty, Column(DbType = "varchar(254)")]
        public string OriginTime { get; set; }

        [JsonProperty, Column(DbType = "int")]
        public int PostEventID { get; set; }

        [JsonProperty]
        public double RMS { get; set; }

        [JsonProperty, Column(DbType = "int")]
        public int WorkAreaID { get; set; }

        [JsonProperty]
        public double X { get; set; }

        [JsonProperty]
        public double Y { get; set; }

        [JsonProperty]
        public double Z { get; set; }
        [Column(IsIgnore = true)]
        public double Energy { get; set; }
        public void SetEnergy()
        {
            Energy = Math.Round(63000.0 * Math.Pow(10, 1.47 * ML), 2);
        }
    }
}
