using System.Text.Json.Serialization; using System.Text.RegularExpressions; namespace LTEMvcApp.Models; /// /// LTE日志实体类 - 对应JavaScript中的LTELog对象 /// public class LTELog { #region 基础属性 /// /// 日志唯一标识符 /// public int Id { get; set; } /// /// 时间戳(毫秒) /// public long Timestamp { get; set; } /// /// 协议层(PHY, RRC, NAS, MAC等) /// public string Layer { get; set; } = string.Empty; /// /// 传输方向(UL/DL) /// public int Direction { get; set; } /// /// 消息内容 /// public string Message { get; set; } = string.Empty; /// /// 消息信息类型 /// public int? Info { get; set; } /// /// UE标识符 /// public int? UeId { get; set; } /// /// RNTI(无线网络临时标识符) /// public int? Rnti { get; set; } /// /// 日志数据内容 /// public List Data { get; set; } = new(); /// /// 客户端引用 /// [JsonIgnore] public LTEClient? Client { get; set; } /// /// 是否已解码 /// public bool Decoded { get; set; } /// /// 标记信息 /// public string? Marker { get; set; } #endregion #region PHY层相关属性 /// /// 小区标识 /// public int? Cell { get; set; } /// /// 物理信道类型 /// public string? Channel { get; set; } /// /// 帧号 /// public int? Frame { get; set; } /// /// 子帧号 /// public int? Subframe { get; set; } /// /// 时隙号 /// public int? Slot { get; set; } /// /// 符号号 /// public int? Symbol { get; set; } /// /// 天线端口 /// public int? AntennaPort { get; set; } /// /// 资源块起始位置 /// public int? RbStart { get; set; } /// /// 资源块数量 /// public int? RbCount { get; set; } /// /// 调制编码方案 /// public int? Mcs { get; set; } /// /// 传输块大小 /// public int? Tbs { get; set; } /// /// HARQ进程ID /// public int? HarqId { get; set; } /// /// HARQ新数据指示 /// public bool? HarqNdi { get; set; } /// /// HARQ重传次数 /// public int? HarqRedundancyVersion { get; set; } #endregion #region 数据相关属性 /// /// IP长度 /// public int? IpLen { get; set; } /// /// SDU长度 /// public int? SduLen { get; set; } /// /// 链路ID /// public LinkIds? LinkIds { get; set; } /// /// 信号记录 /// public Dictionary? SignalRecord { get; set; } #endregion #region 扩展方法 /// /// 获取数据字符串 /// /// 数据字符串 public string GetDataString() { return string.Join("\n", Data); } /// /// 获取数据数组 /// /// 数据数组 public List GetData() { return Data; } #endregion } /// /// 链路ID /// public class LinkIds { public int? Core { get; set; } public int? Ran { get; set; } }