12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XdCxRhDW.Dto;
- using XdCxRhDW.Entity;
- namespace XdCxRhDW.App.Model
- {
- public class ModelPosRes : PosRes
- {
- public static ModelPosRes GetVm(PosRes res)
- {
- var item = new ModelPosRes()
- {
- ID = res.ID,
- CgResID = res.CgResID,
- UserName = res.CheckRes?.UserName,
- CheckResID = res.CheckResID,
- Confidence = res.Confidence,
- CreateTime = res.CreateTime,
- CxResID = res.CxResID,
- Deleted = res.Deleted,
- FreqUpHz = res.FreqUpHz,
- PosLat = res.PosLat,
- MirrLon = res.MirrLon,
- MirrLat = res.MirrLat,
- PosResType = res.PosResType,
- SigTime = res.SigTime,
- Snr1 = res.CgRes?.Snr1,
- PosLon = res.PosLon,
- StationResID = res.StationResID,
- TaskInfoID = res.TaskInfoID,
- UpdateTime = res.UpdateTime,
- TargetState = res.TargetState,
- TargetInfoID = res.TargetInfoID,
- ColorKey = res.ColorKey,
- //CheckType = res.CheckRes?.PosCheckType.GetEnumDisplayName(),
- TargetName = res.TargetInfo?.TargetName,
- };
- //if (res.CgRes != null)
- //{
- // if (res.CgRes.SnrCdb != null || res.CgRes.Snr2 != null)
- // {
- // if (res.CgRes.Snr2 != null)
- // item.Snr2 = res.CgRes.Snr2;
- // else
- // item.Snr2 = res.CgRes.SnrCdb;
- // }
- //}
- return item;
- }
- [Display(Name = "目标名称")]
- [ToolTip]
- public string TargetName { get; set; }// => TargetInfo?.TargetName;
- [Display(Name = "检测方式")]
- [ToolTip]
- public EnumPosCheckType? PosCheckType { get; set; }// => CheckRes?.PosCheckType?.GetEnumDisplayName();
- /// <summary>
- /// 用户名称(只有DAMA和IBS有)
- /// </summary>
- [Display(Name = "用户名称")]
- public string UserName { get; set; }// => CheckRes?.UserName;
- /// <summary>
- /// 第一路信噪比
- /// </summary>
- [Display(Name = "第1路信噪比")]
- public double? Snr1 { get; set; }// => CgRes?.Snr1;
- /// <summary>
- /// 第二路信噪比
- /// </summary>
- [Display(Name = "第2路信噪比")]
- public double? Snr2 { get; set; }// => CgRes?.Snr2;
- [Display(AutoGenerateField =false)]
- public double? SnrCdb { get; set; }
- public override int GetHashCode()
- {
- return $"ModelPosRes_{TaskInfoID}_{ID}".GetHashCode();
- }
- }
- }
|