refactor(edge): 优化边缘相机和触控操作服务
- 将边缘相机服务从 getRGBDImages 方法切换为 getRGBImage 方法 - 简化 TiTouchOperateService 中的路径搜索逻辑 - 移除硬编码的当前位置值,改为从输入参数获取 - 集成 exTiVehicleFunctionService 服务进行功能查找 - 简化路径匹配和下一步计算逻辑 - 统一输出结构,直接使用服务返回的 JSON 对象数据
This commit is contained in:
parent
195937bdf2
commit
89b7ce697d
@ -88,7 +88,7 @@ public class EdgeCameraOperateService implements EdgeOperateService {
|
||||
// imageUrl = "http://192.168.1.100:9000/cmvr-iot/FILE/20250822/1755849654731.jpg";
|
||||
// }
|
||||
// String imageUrl = "http://192.168.1.100:9000/cmvr-iot/IMAGE/20250901/1756718594725.jpg";
|
||||
String imageUrl = edgeCameraService.getRGBDImages(edgeCommonVO);
|
||||
String imageUrl = edgeCameraService.getRGBImage(edgeCommonVO);
|
||||
|
||||
JSONArray imageUrls = new JSONArray();
|
||||
if (ObjUtil.isNotEmpty(upstreamOutput)) {
|
||||
|
||||
@ -67,48 +67,15 @@ public class TiTouchOperateService implements EdgeOperateService {
|
||||
switch (action) {
|
||||
case TI_PATH_SEARCH: {
|
||||
// 当前界面
|
||||
// String currentLocation = inputParams.getString("currentLocation");
|
||||
String currentLocation = "主页";
|
||||
String currentLocation = inputParams.getString("currentLocation");
|
||||
Long vehicleConfigId = inputParams.getLong("vehicleConfigId");
|
||||
String clickFunction = inputParams.getString("funcId");
|
||||
// 查询功能
|
||||
JSONObject funcObj = getFuncObj(message.getIterations(),inputParams);
|
||||
|
||||
String funcKey = funcObj.getString("funcKey");
|
||||
String iconUrl = funcObj.getString("iconUrl");
|
||||
|
||||
|
||||
// ========== 根据当前界面匹配路径 ==========
|
||||
List<String> matchedPath = null;
|
||||
|
||||
for (List<String> path : ALL_PATHS) {
|
||||
if (path.contains(funcKey)) {
|
||||
matchedPath = path;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchedPath == null) {
|
||||
throw new GlobalException("未匹配到可用路径");
|
||||
}
|
||||
|
||||
// ========== 计算下一步 ==========
|
||||
int index = matchedPath.indexOf(currentLocation);
|
||||
|
||||
String nextLocation;
|
||||
boolean isEnd;
|
||||
|
||||
if (index == -1 || index == matchedPath.size() - 1) {
|
||||
nextLocation = currentLocation;
|
||||
isEnd = true;
|
||||
} else {
|
||||
nextLocation = matchedPath.get(index + 1);
|
||||
isEnd = (index + 1 == matchedPath.size() - 1);
|
||||
}
|
||||
|
||||
JSONObject funcObj = exTiVehicleFunctionService.findNextClickToFunction(vehicleConfigId, currentLocation, clickFunction);
|
||||
// 输出
|
||||
output.put("nextLocation", nextLocation);
|
||||
output.put("isEnd", isEnd);
|
||||
output.put("iconUrl", iconUrl);
|
||||
|
||||
output.put("nextLocation", funcObj.get("nextLocation"));
|
||||
output.put("isEnd", funcObj.get("isEnd"));
|
||||
output.put("iconUrl", funcObj.get("iconUrl"));
|
||||
break;
|
||||
}
|
||||
case TI_TOUCH_COORDINATES: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user