USB 摄像头+远程遥控+中英的适配+topic的集成和状态的使用到相应页面
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:maibu_satabot_v2/features/devices/domain/entities/device_entity.
|
||||
import 'package:maibu_satabot_v2/features/remote_control/data/models/running_status_model.dart';
|
||||
|
||||
import '../../domain/entities/machine_control_status_entity.dart';
|
||||
import '../../domain/entities/reverse_camera_data.dart';
|
||||
|
||||
enum RemoteControlStatus { initial, controlling, error }
|
||||
|
||||
@@ -32,6 +33,9 @@ class RemoteControlState extends Equatable {
|
||||
final DeviceEntity? targetDevice;
|
||||
final bool hasReceivedStatusPush; // 是否收到过设备状态推送
|
||||
|
||||
// 🔥 倒车影像数据(来自 ReverseCameraSource:现为 Mock,嵌入式就绪后接真实回传)
|
||||
final ReverseCameraData reverseCamera;
|
||||
|
||||
// 🔥 状态更新类型标记 - 用于区分是设备状态更新还是弹窗状态更新
|
||||
final String? updateType;
|
||||
|
||||
@@ -59,6 +63,7 @@ class RemoteControlState extends Equatable {
|
||||
this.obstacleRecognitionFlag = true,
|
||||
this.targetDevice,
|
||||
this.updateType,
|
||||
this.reverseCamera = const ReverseCameraData.idle(),
|
||||
});
|
||||
|
||||
// 便利 UI 更新部分属性
|
||||
@@ -86,6 +91,7 @@ class RemoteControlState extends Equatable {
|
||||
bool? obstacleRecognitionFlag,
|
||||
DeviceEntity? targetDevice,
|
||||
String? updateType,
|
||||
ReverseCameraData? reverseCamera,
|
||||
}) {
|
||||
return RemoteControlState(
|
||||
status: status ?? this.status,
|
||||
@@ -113,6 +119,7 @@ class RemoteControlState extends Equatable {
|
||||
obstacleRecognitionFlag ?? this.obstacleRecognitionFlag,
|
||||
targetDevice: targetDevice ?? this.targetDevice,
|
||||
updateType: updateType, // 不使用 ??,因为我们想要 null 的时候就是 null
|
||||
reverseCamera: reverseCamera ?? this.reverseCamera,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,5 +148,6 @@ class RemoteControlState extends Equatable {
|
||||
obstacleRecognitionFlag,
|
||||
targetDevice,
|
||||
updateType,
|
||||
reverseCamera,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user