You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.7 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using Newtonsoft.Json;
using FreeSql.DataAnnotations;
using System;
namespace Txgy.EWS.Client.Entity
{
[JsonObject(MemberSerialization.OptIn),Table(Name = "realtimeeventresult")]
public class RemoteRealtimeResultEntity
{
[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 RTEventID { 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; }
/// <summary>
/// 震源性质:1张性2剪切3走滑
/// </summary>
[Column(IsIgnore = true)]
public int SourceChara { get; set; }
/// <summary>
/// 震源机制方向
/// </summary>
[Column(IsIgnore = true)]
public double Direction { get; set; }
/// <summary>
/// 应力降
/// </summary>
[Column(IsIgnore = true)]
public double StressDrop { get; set; }
/// <summary>
/// 主频
/// </summary>
[Column(IsIgnore = true)]
public int DominantFreq { get; set; }
/// <summary>
/// 矩震级
/// </summary>
[Column(IsIgnore = true)]
public double MW { get; set; }
public RemoteRealtimeResultEntity()
{
SetEnergy();
}
public void SetEnergy()
{
Energy = Math.Round(63000.0 * Math.Pow(10, 1.47 * ML), 2);
}
public RemoteRealtimeResultEntity(LocalRealtimeResultEntity le)
{
this.RTEventID = le.RTEventID;
this.WorkAreaID = le.WorkAreaID;
this.EventTime = le.EventTime;
this.OriginTime = le.OriginTime;
this.X = le.X;
this.Y = le.Y;
this.Z = le.Z;
this.ML = Math.Round(le.ML, 2);
this.RMS = Math.Round(le.RMS, 3);
this.LocSta = le.LocSta;
this.MLSta = le.MLSta;
this.Energy = le.Energy;
}
}
}