feat: 环线批量操作、任务筛选与模拟下发搬运任务
为 LoopMission 增加一键上线/结束任务(含二次确认),DeliveryViewer 增加起点/终点/车辆/状态筛选并修复 CycleGUI 控件 id 碰撞,TransportMission 增加 Shelf 站点间随机模拟下发能力。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,7 @@ using SimpleCore.PropType;
|
||||
using StandardScene.CarTypes;
|
||||
using StandardScene.Chained.Loop;
|
||||
using StandardScene.Model;
|
||||
using StandardScene.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -2161,5 +2162,51 @@ namespace StandardScene.Chained
|
||||
StopAll();
|
||||
}
|
||||
|
||||
[MethodMember(Name = "一键上线所有AGV", Description = "将所有已初始化的正常 AGV 标记为在线")]
|
||||
public void OnlineAllCars()
|
||||
{
|
||||
CycleUiHelper.ConfirmThen("确认将所有已初始化的正常 AGV 一键上线?", () => Task.Run(OnlineAllCarsCore));
|
||||
}
|
||||
|
||||
private void OnlineAllCarsCore()
|
||||
{
|
||||
int count = 0;
|
||||
foreach (var car in SimpleLib.GetAllCars().OfType<Car>())
|
||||
{
|
||||
if (car.GetLastSite() == -1 && Commons.GetVehicleStatus(car) == VehicleStatus.Normal)
|
||||
{
|
||||
Commons.AddOrUpdateTag(car.tags, "Online", "true");
|
||||
car.Reset();
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
status.status = $"已上线 {count} 台AGV";
|
||||
Diagnosis.Post($"[AbstractLoopMission] 一键上线所有AGV:已上线 {count} 台", "Loop-OnlineAll", true);
|
||||
}
|
||||
|
||||
[MethodMember(Name = "一键结束所有AGV任务", Description = "停止环线调度并清除所有 AGV 的环线任务分配")]
|
||||
public void StopAllCarTasks()
|
||||
{
|
||||
CycleUiHelper.ConfirmThen("确认停止环线调度并结束所有 AGV 的环线任务?", () => Task.Run(StopAllCarTasksCore));
|
||||
}
|
||||
|
||||
private void StopAllCarTasksCore()
|
||||
{
|
||||
|
||||
int count = 0;
|
||||
foreach (var car in SimpleLib.GetAllCars().OfType<Car>())
|
||||
{
|
||||
Commons.DeleteTag(car.tags, "goalSite");
|
||||
Commons.DeleteTag(car.tags, "loopAssigned");
|
||||
Commons.DeleteTag(car.tags, "occupied");
|
||||
car.ForceStop();
|
||||
count++;
|
||||
}
|
||||
|
||||
status.status = $"已结束 {count} 台AGV任务";
|
||||
Diagnosis.Post($"[AbstractLoopMission] 一键结束所有AGV任务:已停止环线并清理 {count} 台 AGV 的任务标签", "Loop-StopAllTasks", true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user