|
|
@ -1,8 +1,10 @@ |
|
|
package com.yvan.logisticsModel; |
|
|
package com.yvan.logisticsModel; |
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
|
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
|
|
|
|
|
import com.galaxis.rcs.common.enums.LCCDirection; |
|
|
import com.galaxis.rcs.connector.cl2.Cl2Item; |
|
|
import com.galaxis.rcs.connector.cl2.Cl2Item; |
|
|
import com.galaxis.rcs.plan.path.NavigationGraph; |
|
|
import com.galaxis.rcs.plan.path.NavigationGraph; |
|
|
|
|
|
import com.galaxis.rcs.plan.path.PathUtils; |
|
|
import com.galaxis.rcs.plan.path.PtrPathPlanner; |
|
|
import com.galaxis.rcs.plan.path.PtrPathPlanner; |
|
|
import com.galaxis.rcs.ptr.AgvEventManager; |
|
|
import com.galaxis.rcs.ptr.AgvEventManager; |
|
|
import com.galaxis.rcs.ptr.AmrMessageHandler; |
|
|
import com.galaxis.rcs.ptr.AmrMessageHandler; |
|
|
@ -154,6 +156,7 @@ public class LogisticsRuntime { |
|
|
case "way": |
|
|
case "way": |
|
|
case "gstore": |
|
|
case "gstore": |
|
|
case "rack": |
|
|
case "rack": |
|
|
|
|
|
case "charger": |
|
|
item = new StaticItem(this, itemObject); |
|
|
item = new StaticItem(this, itemObject); |
|
|
floor.itemMap.put(item.getId(), (StaticItem) item); |
|
|
floor.itemMap.put(item.getId(), (StaticItem) item); |
|
|
break; |
|
|
break; |
|
|
@ -185,6 +188,7 @@ public class LogisticsRuntime { |
|
|
.fetch(); |
|
|
.fetch(); |
|
|
|
|
|
|
|
|
for (var item : list) { |
|
|
for (var item : list) { |
|
|
|
|
|
// 车的属性
|
|
|
String payload = Conv.asString(item.get("virtual_executor_payload")); |
|
|
String payload = Conv.asString(item.get("virtual_executor_payload")); |
|
|
/** |
|
|
/** |
|
|
* { |
|
|
* { |
|
|
@ -199,13 +203,47 @@ public class LogisticsRuntime { |
|
|
* } |
|
|
* } |
|
|
*/ |
|
|
*/ |
|
|
JsonWrapper jwPayload = new JsonWrapper(payload); |
|
|
JsonWrapper jwPayload = new JsonWrapper(payload); |
|
|
if ("cl2".equals(jwPayload.asStr("t"))) { |
|
|
|
|
|
var eitem = new Cl2Item(this, (Map<String, Object>) jwPayload.getInnerMap()); |
|
|
|
|
|
this.executorItemMap.put(eitem.getId(), eitem); |
|
|
|
|
|
|
|
|
|
|
|
} else if ("clx".equals(jwPayload.asStr("t"))) { |
|
|
switch (jwPayload.asStr("t")) { |
|
|
var eitem = new Cl2Item(this, (Map<String, Object>) jwPayload.getInnerMap()); |
|
|
case "cl2": |
|
|
this.executorItemMap.put(eitem.getId(), eitem); |
|
|
case "clx": |
|
|
|
|
|
// 处理 CL2 或 CLX 类型的执行器
|
|
|
|
|
|
// 车所在的标记位置,及方向 11_4:RIGHT
|
|
|
|
|
|
if (Conv.asString(item.get("virtual_location_at")).contains(":")) { |
|
|
|
|
|
String[] parts = Conv.asString(item.get("virtual_location_at")).split(":"); |
|
|
|
|
|
if (parts.length == 2) { |
|
|
|
|
|
String wayPointId = parts[0]; |
|
|
|
|
|
String direction = parts[1]; |
|
|
|
|
|
var eitem = new Cl2Item(this, (Map<String, Object>) jwPayload.getInnerMap()); |
|
|
|
|
|
|
|
|
|
|
|
// 找到地标位置
|
|
|
|
|
|
StaticItem staticItem = this.getStaticItemById(wayPointId); |
|
|
|
|
|
if (staticItem != null) { |
|
|
|
|
|
eitem.logicX = staticItem.logicX; |
|
|
|
|
|
eitem.logicY = staticItem.logicY; |
|
|
|
|
|
eitem.direction = PathUtils.convertDirectionToPtrDiretion(LCCDirection.fromString(direction)); |
|
|
|
|
|
this.executorItemMap.put(eitem.getId(), eitem); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
log.warn("Static item not found for wayPointId: {}", wayPointId); |
|
|
|
|
|
continue; // 跳过未找到的地标
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
log.warn("Invalid virtual_location_at format: {}, id:{}", item.get("virtual_location_at"), item.get("id")); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
log.warn("Invalid virtual_location_at is null, id:{}", item.get("id")); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
log.warn("Unknown executor type: {}", jwPayload.asStr("t")); |
|
|
|
|
|
continue; // 跳过未知类型
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|