using Newtonsoft.Json;
using Prism.Events;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Txgy.EWS.Client.Entity;
using Txgy.EWS.Client.Models;

namespace Txgy.EWS.Client.Common.MessageEvents
{
    public class UpdateLastAlarmEvent : PubSubEvent<GridItemEventResult>
    {
    }
    public class AlarmEventPayload
    {
        public string EventTime { get; set; }

        public int LocSta { get; set; }

        public double ML { get; set; }

        public int MLSta { get; set; }

        public string OriginTime { get; set; }
      
        public int EventID { get; set; }

        public double RMS { get; set; }

        public int WorkAreaID { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
        public double Z { get; set; }
        public double Energy { get; set; }
        /// <summary>
        /// 震源性质:1：张性；2：剪切；3：走滑
        /// </summary>
        public int SourceChara { get; set; }
        /// <summary>
        /// 震源机制方向
        /// </summary>
        public double Direction { get; set; }
        /// <summary>
        /// 应力降
        /// </summary>
        public double StressDrop { get; set; }
        /// <summary>
        /// 主频
        /// </summary>
        public int DominantFreq { get; set; }
        /// <summary>
        /// 矩震级
        /// </summary>
        public double MW { get; set; }
        public AlarmEventPayload(RemoteRealtimeResultEntity re)
        {
            this.EventID = re.RTEventID;
            this.LocSta = re.LocSta;
            this.ML = re.ML;
            this.MLSta = re.MLSta;
            this.OriginTime = re.OriginTime;
            this.EventTime = re.EventTime;
            this.RMS = re.RMS;
            this.X= re.Y;
            this.Y = re.X;
            this.Z = re.Z;
            this.Energy = re.Energy;
            this.WorkAreaID = re.WorkAreaID;
            this.DominantFreq= re.DominantFreq;
        }
    }    
}
