perf: 增加icd文件兼容性处理

dev
huangfeng 8 months ago
parent 2c616d34fc
commit 366b249a15

@ -30,11 +30,18 @@ public class IecClient implements ClientEventListener {
int[] title = new int[]{1, 3, 9999, 33};
if (StringUtils.isNotBlank(apTitle)) {
String[] strs = apTitle.replaceAll(" ", ",").split(",");
if (strs.length > 3) {
if (strs.length == 4) {
title[0] = Integer.parseInt(strs[0]);
title[1] = Integer.parseInt(strs[1]);
title[2] = Integer.parseInt(strs[2]);
title[3] = Integer.parseInt(strs[3]);
} else if (strs.length == 5) {
title = new int[]{1, 3, 9999, 33, 1};
title[0] = Integer.parseInt(strs[0]);
title[1] = Integer.parseInt(strs[1]);
title[2] = Integer.parseInt(strs[2]);
title[3] = Integer.parseInt(strs[3]);
title[4] = Integer.parseInt(strs[4]);
}
}
clientSap.setTSelRemote(new byte[]{0, 1});

@ -46,10 +46,14 @@ public class IcdXmlUtil {
icdFile.setConfigList(new ArrayList<>(configMap.values()));
List<IcdIed> iedList = new ArrayList<>();
HashMap<String, String> iedMap = new HashMap<>();
List<JsonNode> apList = findNodes(root, "ConnectedAP");
for (JsonNode apNode : apList) {
IcdIed ied = processAPNode(apNode);
iedList.add(ied);
if (!iedMap.containsKey(ied.getName())) {
iedMap.put(ied.getName(), "1");
iedList.add(ied);
}
}
icdFile.setIedList(iedList);
}
@ -65,7 +69,8 @@ public class IcdXmlUtil {
if ("IP".equalsIgnoreCase(type)) {
ied.setIp(pNode.get("").asText());
} else if ("OSI-AP-Title".equalsIgnoreCase(type)) {
ied.setApTitle(pNode.get("").asText());
String apTitle = pNode.get("").asText();
ied.setApTitle(apTitle.replaceAll("\"", ""));
}
}
return ied;

Loading…
Cancel
Save