namespace SHH.CameraDashboard; public class CameraInfo { // --- 原始 JSON 属性 --- public int Id { get; set; } public string Name { get; set; } public string IpAddress { get; set; } public DeviceBrand Brand { get; set; } public string Status { get; set; } // "Playing", "Disconnected" 等 public bool IsPhysicalOnline { get; set; } // 物理在线 (网络) public bool IsOnline { get; set; } // 业务在线 (登录) public bool IsRunning { get; set; } // 正在运行 (拉流) public int RealFps { get; set; } public int Width { get; set; } public int Height { get; set; } // --- UI 分离状态逻辑 --- // 状态 1: 登录状态 (在线/离线) public string OnlineStatusText => (IsPhysicalOnline && IsOnline) ? "在线" : "离线"; // 状态 2: 运行状态 (运行/停止) public string RunningStatusText => IsRunning ? "运行中" : "已停止"; // 品牌信息 public string BrandName => Brand.ToString(); public string DisplayName => string.IsNullOrEmpty(Name) ? IpAddress : Name; public string MediaDetail => IsRunning && Width > 0 ? $"{Width}x{Height} | {RealFps}fps" : "无信号"; }