完成添加机器完成的经纬度点的记录的更新
完成机器达到点的添加存取方法
This commit is contained in:
@@ -65,7 +65,7 @@ class NetMessageDispatcher {
|
||||
/// 验证头部:data[0]=0xAB, data[1]=0xAA, data[2]=0x01
|
||||
/// 检查状态位:data[5] == 0x01 表示回复成功
|
||||
Stream<RawPacket> onPathPlanningResponse() {
|
||||
|
||||
final devicesCubit = sl<DevicesCubit>();
|
||||
|
||||
debugPrint('[Dispatcher] 开始监听路径规划指令应答 (CMD: 0x01)');
|
||||
|
||||
@@ -98,15 +98,23 @@ class NetMessageDispatcher {
|
||||
///取全局的路径规划发送实体 queue
|
||||
/// 发送下一个指令 移除上一条数据
|
||||
var queue = _pathPlanningService.getQueue();
|
||||
///更新完成jwd
|
||||
var deviceAddPathPointModel = queue.first;
|
||||
devicesCubit.setArrivedLocation(
|
||||
deviceAddPathPointModel.latitude,
|
||||
deviceAddPathPointModel.longitude
|
||||
);
|
||||
//去除上一条数据
|
||||
queue.removeFirst();
|
||||
|
||||
|
||||
/// _pathPlanningService.updateQueue(queue as List<DeviceAddPathPointModel>);
|
||||
_pathPlanningService.updateQueue(queue.toList());
|
||||
debugPrint('📡 [Dispatcher] 准备触发下一个路径点发送,队列剩余:${queue.length}');
|
||||
///如果还剩0个数据 就停止发送
|
||||
if (queue.length==0) {
|
||||
debugPrint('⚠️ [Dispatcher] 队列已空,停止发送');
|
||||
final devicesCubit = sl<DevicesCubit>();
|
||||
// final devicesCubit = sl<DevicesCubit>();
|
||||
devicesCubit.finishWork();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user