完成路及规划的作业的开始工作成功.
完成路径规划的暂停功能的对接 完成路径规划的继续功能的对接 完成路径规划的停止功能的对接
This commit is contained in:
@@ -1421,11 +1421,12 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
// 步骤2:将 List 转换为 Queue(队列)
|
||||
final Queue<work_area_model.DeviceAddPathPointModel> pathQueue = Queue.from(startWorkList);
|
||||
|
||||
// 步骤3:调用 Cubit 方法(类型匹配)
|
||||
debugPrint('🚀 开始作业:${_selectedPlot?.plotName ?? "未命名"},路径点数量:${pathQueue.length}');
|
||||
debugPrint('第一个点 WGS84: ${pathQueue.first.latitude}, ${pathQueue.first.longitude}');
|
||||
|
||||
// 步骤 3:调用 Cubit 方法(类型匹配)
|
||||
await context.read<DevicesCubit>().startRoutePlanning(pathQueue);
|
||||
|
||||
debugPrint('开始作业:${_selectedPlot!.plotName},路径数据:$gcjPathPoints');
|
||||
|
||||
context.read<DevicesCubit>().updateAppState(AppState.routePlanning);
|
||||
// 可选:显示作业提示
|
||||
ToastUtils.showSuccess(context, '作业已开始');
|
||||
//ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('作业已开始'), backgroundColor: Colors.green));
|
||||
@@ -1436,8 +1437,8 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
setState(() {
|
||||
_workStatus = WorkStatus.paused;
|
||||
});
|
||||
context.read<DevicesCubit>().updateAppState(AppState.none);
|
||||
await context.read<DevicesCubit>().pauseRoutePlanning();
|
||||
|
||||
debugPrint('暂停作业:${_selectedPlot!.plotName}');
|
||||
}
|
||||
|
||||
@@ -1445,9 +1446,11 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
setState(() {
|
||||
_workStatus = WorkStatus.idle;
|
||||
});
|
||||
context.read<DevicesCubit>().updateAppState(AppState.none);
|
||||
await context.read<DevicesCubit>().stopRoutePlanning();
|
||||
//修改App的状态
|
||||
debugPrint('停止作业:${_selectedPlot!.plotName}');
|
||||
ToastUtils.showError(context, '作业已停止');
|
||||
///ToastUtils.showError(context, '作业已停止');
|
||||
}
|
||||
|
||||
/// 继续作业
|
||||
@@ -1455,7 +1458,9 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
setState(() {
|
||||
_workStatus = WorkStatus.working;
|
||||
});
|
||||
context.read<DevicesCubit>().updateAppState(AppState.routePlanning);
|
||||
await context.read<DevicesCubit>().resumeRoutePlanning();
|
||||
|
||||
}
|
||||
|
||||
void _showDeleteConfirmDialog(PlotData plot, Function(PlotData) onDelete) {
|
||||
|
||||
Reference in New Issue
Block a user