优化了tcp实时更新对UI线程的压力和对用弹窗的重复弹窗的影响。
更换了路径规划的的经纬度的字段名和取操作的名字更换。
This commit is contained in:
@@ -14,8 +14,8 @@ class RemoteControlState extends Equatable {
|
||||
final bool isEmergency;
|
||||
final bool isLocked;
|
||||
final int ping;
|
||||
final int battery;//电池量
|
||||
final int voltage;//电压
|
||||
final int battery; //电池量
|
||||
final int voltage; //电压
|
||||
final String permissionPlatform;
|
||||
final String currentPlatform;
|
||||
final bool showPermissionRequestDialog;
|
||||
@@ -28,8 +28,11 @@ class RemoteControlState extends Equatable {
|
||||
final bool obstacleRecognitionFlag; // 障碍物识别标志位(这是UI显示的)
|
||||
|
||||
final String obstacleFlag; //障碍物标志位
|
||||
final DeviceEntity? targetDevice; // 🔥 待控制的设备
|
||||
final RunningStatusModel runningStatusModel;
|
||||
final DeviceEntity? targetDevice;
|
||||
|
||||
// 🔥 状态更新类型标记 - 用于区分是设备状态更新还是弹窗状态更新
|
||||
final String? updateType;
|
||||
|
||||
const RemoteControlState({
|
||||
this.status = RemoteControlStatus.initial,
|
||||
@@ -53,6 +56,7 @@ class RemoteControlState extends Equatable {
|
||||
this.topRightIsExpanded = false,
|
||||
this.obstacleRecognitionFlag = true,
|
||||
this.targetDevice,
|
||||
this.updateType,
|
||||
});
|
||||
|
||||
// 便利 UI 更新部分属性
|
||||
@@ -78,7 +82,7 @@ class RemoteControlState extends Equatable {
|
||||
bool? topRightIsExpanded,
|
||||
bool? obstacleRecognitionFlag,
|
||||
DeviceEntity? targetDevice,
|
||||
|
||||
String? updateType,
|
||||
}) {
|
||||
return RemoteControlState(
|
||||
status: status ?? this.status,
|
||||
@@ -101,9 +105,10 @@ class RemoteControlState extends Equatable {
|
||||
runningStatusModel: runningStatusModel ?? this.runningStatusModel,
|
||||
obstacleFlag: obstacleFlag ?? this.obstacleFlag,
|
||||
topRightIsExpanded: topRightIsExpanded ?? this.topRightIsExpanded,
|
||||
obstacleRecognitionFlag: obstacleRecognitionFlag ?? this.obstacleRecognitionFlag,
|
||||
obstacleRecognitionFlag:
|
||||
obstacleRecognitionFlag ?? this.obstacleRecognitionFlag,
|
||||
targetDevice: targetDevice ?? this.targetDevice,
|
||||
|
||||
updateType: updateType, // 不使用 ??,因为我们想要 null 的时候就是 null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -130,8 +135,6 @@ class RemoteControlState extends Equatable {
|
||||
topRightIsExpanded,
|
||||
obstacleRecognitionFlag,
|
||||
targetDevice,
|
||||
updateType,
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user