This commit is contained in:
xuzhiheng
2025-06-18 10:35:01 +08:00
parent 952d0db0d1
commit 7ac42a2b80
5 changed files with 17 additions and 26 deletions

View File

@@ -439,28 +439,6 @@ public class LoopbackCommunicationAdapter
getProcessModel().setState(Vehicle.State.EXECUTING);
Step step = command.getStep();
Vehicle newVehicle = vehicleService.fetchObject(Vehicle.class, getProcessModel().getName());
List<Set<TCSResourceReference<?>>> allocatedResources = newVehicle.getAllocatedResources();
//使用副本更新车辆模型,防止异常情况
List<Set<TCSResourceReference<?>>> copiedResources = new ArrayList<>(allocatedResources);
copiedResources.clear();
if (step.getSourcePoint() != null) {
//下发起点不为空
Point point = objectService.fetchObject(Point.class, step.getSourcePoint().getName());
Set<TCSResourceReference<?>> resource = new HashSet<>();
resource.add(point.getReference());
copiedResources.add(resource);
}
if (step.getPath() != null) {
Path path = objectService.fetchObject(Path.class, step.getPath().getName());
Set<TCSResourceReference<?>> resource = new HashSet<>();
resource.add(path.getReference());
copiedResources.add(resource);
}
newVehicle.withAllocatedResources(copiedResources);
if (step.getPath() == null) {
actionExec(command);
} else {