using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XiaoZhiSharp.Models
{
    public class MsgPushModel
    {
        /// <summary>
        /// 会话ID
        /// </summary>
        [JsonProperty("session_id", NullValueHandling = NullValueHandling.Include)]
        public string SessionId { get; set; }

        /// <summary>
        /// 消息类型
        /// </summary>
        [JsonProperty("type", NullValueHandling = NullValueHandling.Include)]
        public string Type { get; set; } = "msgpush";

        [JsonProperty("OS", NullValueHandling = NullValueHandling.Include)]
        public OSModel OS { get; set; }

        [JsonProperty("GPS", NullValueHandling = NullValueHandling.Include)]
        public GPSModel GPS { get; set; }
    }

    /// <summary>
    /// 操作系统资源使用情况
    /// </summary>
    public class OSModel
    {
        /// <summary>
        /// CPU使用率
        /// </summary>
        [JsonProperty("CPU", NullValueHandling = NullValueHandling.Include)]
        public ulong CPU { get; set; }

        /// <summary>
        /// GPU使用率
        /// </summary>
        [JsonProperty("GPU", NullValueHandling = NullValueHandling.Include)]
        public double GPU { get; set; }

        /// <summary>
        /// 内存使用率
        /// </summary>
        [JsonProperty("Memory", NullValueHandling = NullValueHandling.Include)]
        public double Memory { get; set; }

        /// <summary>
        /// 存储使用率
        /// </summary>
        [JsonProperty("Disk", NullValueHandling = NullValueHandling.Include)]
        public double Disk { get; set; }
    }

    /// <summary>
    /// GPS定位信息
    /// </summary>
    public class GPSModel
    {
        /// <summary>
        /// 时间戳--年
        /// </summary>
        [JsonProperty("year", NullValueHandling = NullValueHandling.Include)]
        public int Year { get; set; }

        /// <summary>
        /// 时间戳--月
        /// </summary>
        [JsonProperty("mon", NullValueHandling = NullValueHandling.Include)]
        public int Month { get; set; }

        /// <summary>
        /// 时间戳--日
        /// </summary>
        [JsonProperty("day", NullValueHandling = NullValueHandling.Include)]
        public int Day { get; set; }

        /// <summary>
        /// 时间戳--时
        /// </summary>
        [JsonProperty("hour", NullValueHandling = NullValueHandling.Include)]
        public int Hour { get; set; }

        /// <summary>
        /// 时间戳--分
        /// </summary>
        [JsonProperty("min", NullValueHandling = NullValueHandling.Include)]
        public int Minute { get; set; }

        /// <summary>
        /// 时间戳--秒
        /// </summary>
        [JsonProperty("sec", NullValueHandling = NullValueHandling.Include)]
        public int Second { get; set; }

        /// <summary>
        /// 经度
        /// </summary>
        [JsonProperty("Longitude", NullValueHandling = NullValueHandling.Include)]
        public double Longitude { get; set; }

        /// <summary>
        /// 纬度
        /// </summary>
        [JsonProperty("Latitude", NullValueHandling = NullValueHandling.Include)]
        public double Latitude { get; set; }

        /// <summary>
        /// 海拔高度（米）
        /// </summary>
        [JsonProperty("Altitude", NullValueHandling = NullValueHandling.Include)]
        public double Altitude { get; set; }

        /// <summary>
        /// 速度（km/h）
        /// </summary>
        [JsonProperty("Speed", NullValueHandling = NullValueHandling.Include)]
        public double Speed { get; set; }

        /// <summary>
        /// 航向
        /// </summary>
        [JsonProperty("Heading", NullValueHandling = NullValueHandling.Include)]
        public double Heading { get; set; }

        /// <summary>
        /// 航道
        /// </summary>
        [JsonIgnore()]
        public double Course { get; set; }

        /// <summary>
        /// 偏航角
        /// </summary>
        [JsonIgnore()]
        public double CrabAngle { get; set; }

        /// <summary>
        /// 可见GPS卫星
        /// </summary>
        [JsonProperty("GPSSatellitesInView", NullValueHandling = NullValueHandling.Include)]
        public int GPSSatellitesInView { get; set; }

        /// <summary>
        /// 正在使用的GPS卫星
        /// </summary>
        [JsonProperty("GPSSatellitesUsed", NullValueHandling = NullValueHandling.Include)]
        public int GPSSatellitesUsed { get; set; }

        /// <summary>
        /// 可见北斗卫星
        /// </summary>
        [JsonProperty("BDSatellitesInView", NullValueHandling = NullValueHandling.Include)]
        public int BDSatellitesInView { get; set; }

        /// <summary>
        /// 正在使用的北斗卫星
        /// </summary>
        [JsonProperty("BDSatellitesUsed", NullValueHandling = NullValueHandling.Include)]
        public int BDSatellitesUsed { get; set; }

        /// <summary>
        /// (Position Dilution Of Precision)三维精度因子
        /// </summary>
        [JsonProperty("PDOP", NullValueHandling = NullValueHandling.Include)]
        public double PDOP { get; set; }

        /// <summary>
        /// (Horizontal Dilution Of Precision)水平精度因子
        /// </summary>
        [JsonProperty("HDOP", NullValueHandling = NullValueHandling.Include)]
        public double HDOP { get; set; }

        /// <summary>
        /// (Vertical Dilution Of Precision)垂直几何精度因子
        /// </summary>
        [JsonProperty("VDOP", NullValueHandling = NullValueHandling.Include)]
        public double VDOP { get; set; }

        /// <summary>
        /// (Time Dilution Of Precision)时间精度因子
        /// </summary>
        [JsonIgnore()]
        public double TDOP { get; set; }
    }
}
