59 lines
2.5 KiB
C#
59 lines
2.5 KiB
C#
namespace SHH.CameraSdk;
|
||
|
||
/// <summary>
|
||
/// 相机实时遥测数据快照
|
||
/// 功能:封装单台相机的实时运行状态、性能指标与健康度信息,用于监控面板展示、运维告警与数据分析
|
||
/// 特性:数据为瞬时快照,通常定期(如1秒/次)更新,反映相机当前运行状况
|
||
/// </summary>
|
||
public class CameraTelemetryInfo
|
||
{
|
||
#region --- 设备核心标识 (Device Core Identification) ---
|
||
|
||
/// <summary> 设备唯一业务标识(对应数据库ID或配置中的设备ID) </summary>
|
||
public long DeviceId { get; set; }
|
||
|
||
/// <summary> 设备显示名称(如“北大门-枪机01”,用于UI展示) </summary>
|
||
public string Name { get; set; } = string.Empty;
|
||
|
||
/// <summary> 设备IP地址(用于网络连通性校验与远程访问) </summary>
|
||
public string IpAddress { get; set; } = string.Empty;
|
||
|
||
#endregion
|
||
|
||
#region --- 设备运行状态 (Device Operation Status) ---
|
||
|
||
/// <summary> 相机当前运行状态(字符串形式,对应 VideoSourceStatus 枚举值,如 "Playing"/"Faulted"/"Connecting") </summary>
|
||
public string Status { get; set; } = string.Empty;
|
||
|
||
/// <summary> 设备物理连接状态(通过 Ping/TCP 探测判定,true=在线,false=离线) </summary>
|
||
public bool IsOnline { get; set; }
|
||
|
||
/// <summary> 最后一次报错信息(无错误时为 null,用于快速定位故障原因) </summary>
|
||
public string? LastErrorMessage { get; set; }
|
||
|
||
#endregion
|
||
|
||
#region --- 性能指标 (Performance Metrics) ---
|
||
|
||
/// <summary> 实时帧率(单位:fps,反映相机取流与处理的实时速度) </summary>
|
||
public double Fps { get; set; }
|
||
|
||
/// <summary> 累计接收帧数(相机启动后接收的总帧数,用于统计数据完整性) </summary>
|
||
public long TotalFrames { get; set; }
|
||
|
||
/// <summary> 实时码率 (Mbps) </summary>
|
||
public double Bitrate { get; set; }
|
||
|
||
#endregion
|
||
|
||
#region --- 健康度与统计 (Health & Statistics) ---
|
||
|
||
/// <summary> 设备健康度评分(0-100分,分数越高健康状态越好) </summary>
|
||
/// <remarks> 计算逻辑:结合是否断线、实时FPS是否在正常范围、是否有报错等因素综合判定 </remarks>
|
||
public int HealthScore { get; set; }
|
||
|
||
/// <summary> 遥测数据统计时间戳(记录当前快照的生成时间,默认当前时间) </summary>
|
||
public DateTime Timestamp { get; set; } = DateTime.Now;
|
||
|
||
#endregion
|
||
} |