完成点 初始
This commit is contained in:
@@ -2,10 +2,11 @@ import 'package:equatable/equatable.dart';
|
||||
import 'package:maibu_satabot_v2/features/devices/domain/entities/device_entity.dart';
|
||||
|
||||
import '../../data/models/device_add_path_point_model.dart';
|
||||
|
||||
enum DeviceOperationType {
|
||||
none, // 无操作
|
||||
unbind, // 解绑设备
|
||||
updateName, // 修改设备名称
|
||||
none, // 无操作
|
||||
unbind, // 解绑设备
|
||||
updateName, // 修改设备名称
|
||||
}
|
||||
|
||||
enum AppState {
|
||||
@@ -13,8 +14,6 @@ enum AppState {
|
||||
routePlanning, //正在规划路径
|
||||
}
|
||||
|
||||
|
||||
|
||||
class DevicesState extends Equatable {
|
||||
final List<DeviceEntity> devices; // 名下所有设备列表
|
||||
final DeviceEntity? selectedDevice; // 当前主界面选中的/操作的设备
|
||||
@@ -31,9 +30,6 @@ class DevicesState extends Equatable {
|
||||
final double? arriLatitude;
|
||||
final double? arriLongitude;
|
||||
|
||||
|
||||
|
||||
|
||||
const DevicesState({
|
||||
this.devices = const [],
|
||||
this.selectedDevice,
|
||||
@@ -46,7 +42,9 @@ class DevicesState extends Equatable {
|
||||
this.pathData,
|
||||
this.generatedPath,
|
||||
this.appState = AppState.none,
|
||||
this.isFinshWork = false, this.arriLatitude, this.arriLongitude,
|
||||
this.isFinshWork = false,
|
||||
this.arriLatitude,
|
||||
this.arriLongitude,
|
||||
});
|
||||
|
||||
// 使用 copyWith 方便局部更新状态
|
||||
@@ -85,7 +83,10 @@ class DevicesState extends Equatable {
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [devices, selectedDevice, isLoading,
|
||||
List<Object?> get props => [
|
||||
devices,
|
||||
selectedDevice,
|
||||
isLoading,
|
||||
errorMessage,
|
||||
deviceLatitude,
|
||||
deviceLongitude,
|
||||
@@ -96,6 +97,6 @@ class DevicesState extends Equatable {
|
||||
appState,
|
||||
isFinshWork,
|
||||
arriLatitude,
|
||||
arriLongitude
|
||||
arriLongitude,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -555,8 +555,6 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
'outer':
|
||||
// 核心修改:根据机器人模式选择不同的坐标源
|
||||
(_currentRobotMode == RobotMode.robot ? _robotModeWgsPoints : gcjOuterPoints).map((point) {
|
||||
// Robot模式:_robotModeWgsPoints本身就是WGS84坐标,无需转换
|
||||
// Point模式:gcjOuterPoints是GCJ02坐标,需要转换为WGS84
|
||||
final wgs84 = _currentRobotMode == RobotMode.robot
|
||||
? point // Robot模式直接使用原始WGS84坐标
|
||||
: gcj02ToWgs84(point.latitude, point.longitude); // Point模式转换
|
||||
@@ -2025,9 +2023,14 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
final devicesState = context.watch<DevicesCubit>().state;
|
||||
// 2. 读取 isFinishWork 数据(修正拼写,设置默认值)
|
||||
bool isFinishWork = devicesState.isFinshWork ?? false;
|
||||
// 初始化默认值
|
||||
String yaw = '--';
|
||||
String satelliteCnt = '--';
|
||||
double? arriLatitude = devicesState.arriLatitude;
|
||||
double? arriLongitude = devicesState.arriLongitude;
|
||||
LatLng? targetLatLng;
|
||||
if (arriLatitude != null && arriLongitude != null) {
|
||||
targetLatLng = LatLng(arriLatitude, arriLongitude);
|
||||
_traceManager.upsert(targetLatLng, TPAction.ADD);
|
||||
}
|
||||
|
||||
double currentLat = 0.0;
|
||||
double currentLng = 0.0;
|
||||
bool obfFlag = false; //障碍物标志位
|
||||
@@ -2052,8 +2055,8 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
//debugPrint("路径规划四十数据 - 经纬度:");
|
||||
//debugPrint(" RunningStatus纬度:${updatedState.status.latitude}");
|
||||
//debugPrint(" RunningStatus经度:${updatedState.status.longitude}");
|
||||
//debugPrint("${updatedState.status.obstacleFlag},${updatedState.status.qual},${updatedState.status.controlMode}");
|
||||
//debugPrint("${updatedState.status.headingStatus},${updatedState.status.yaw}");
|
||||
// debugPrint("障碍物${updatedState.status.obstacleFlag}");
|
||||
// debugPrint("初始化${updatedState.status.headingStatus}");
|
||||
|
||||
// 提取经纬度并更新本地变量
|
||||
currentLat = updatedState.status.latitude;
|
||||
|
||||
Reference in New Issue
Block a user