播放器修改,功能完善

This commit is contained in:
CC
2026-01-29 19:16:41 +08:00
parent 949743972c
commit e16625c288
16 changed files with 717 additions and 424 deletions

View File

@@ -19,7 +19,7 @@ class RemoteControlState extends Equatable {
// --- 安全与锁定 ---
final bool isEmergency; // 紧急停止状态
final bool isLocked; // 控制锁定状态
final String obstacleFlag; // 障碍物标志位文字 (对应 Entity 里的 0/1)
final String obstacleFlag; // 障碍物标志位文字(这是机器传过来的) (对应 Entity 里的 0/1)
// --- 网络与连接 ---
final int ping; // 延迟/心跳
@@ -28,6 +28,12 @@ class RemoteControlState extends Equatable {
// --- UI 视图配置 ---
final bool showLeftPip; // 左侧画中画显示
final bool showRightPip; // 右侧画中画显示
final bool topRightIsExpanded; // 顶部右侧按钮展开状态
final bool obstacleRecognitionFlag; // 障碍物识别标志位(这是UI显示的)
final String mainStreamUrl;
final String aiStreamUrl;
final bool isVideoEnabled;
const RemoteControlState({
this.status = RemoteControlStatus.initial,
@@ -44,10 +50,15 @@ class RemoteControlState extends Equatable {
this.errorMessage,
this.showLeftPip = true,
this.showRightPip = true,
this.topRightIsExpanded = false,
this.obstacleRecognitionFlag = false,
this.mainStreamUrl = '',
this.aiStreamUrl = '',
this.isVideoEnabled = true
});
// 辅助属性:判断当前是否具备物理驾驶条件
bool get canDrive => hasPermission && !isEmergency && !isLocked;
bool get canDrive => hasPermission && !isLocked;
RemoteControlState copyWith({
RemoteControlStatus? status,
@@ -64,6 +75,11 @@ class RemoteControlState extends Equatable {
String? errorMessage,
bool? showLeftPip,
bool? showRightPip,
bool? topRightIsExpanded,
bool? obstacleRecognitionFlag,
bool? isVideoEnabled,
String? mainStreamUrl,
String? aiStreamUrl
}) {
return RemoteControlState(
status: status ?? this.status,
@@ -80,6 +96,11 @@ class RemoteControlState extends Equatable {
errorMessage: errorMessage ?? this.errorMessage,
showLeftPip: showLeftPip ?? this.showLeftPip,
showRightPip: showRightPip ?? this.showRightPip,
topRightIsExpanded: topRightIsExpanded ?? this.topRightIsExpanded,
obstacleRecognitionFlag: obstacleRecognitionFlag ?? this.obstacleRecognitionFlag,
isVideoEnabled: isVideoEnabled ?? this.isVideoEnabled,
mainStreamUrl: mainStreamUrl ?? this.mainStreamUrl,
aiStreamUrl: aiStreamUrl ?? this.aiStreamUrl
);
}
@@ -99,5 +120,10 @@ class RemoteControlState extends Equatable {
errorMessage,
showLeftPip,
showRightPip,
topRightIsExpanded,
obstacleRecognitionFlag,
isVideoEnabled,
mainStreamUrl,
aiStreamUrl
];
}