Fix: RosConnectionSymbols where not copied between subcomponents

parent 2486c77a
......@@ -72,6 +72,7 @@ public class ClusterFromTagsHelper {
i[0]++;
}
res.add(createECISFromCluster(componentInstanceSymbol, c, clusterPrefix + i[0]));
i[0]++;
}
});
return res;
......
......@@ -22,14 +22,15 @@ public class RosHelper {
.forEach(connectorSymbol -> {
if (Objects.equals(connectorSymbol.getSourcePort().getComponentInstance(), componentInstanceSymbol)) {
//In port of supercomp
inferRosConnectionIfPossible(connectorSymbol.getSourcePort(), connectorSymbol.getTargetPort());
inferRosConnectionIfPossible(connectorSymbol);
generateRosConnectionIfPossible(connectorSymbol);
} else if (Objects.equals(connectorSymbol.getTargetPort().getComponentInstance(), componentInstanceSymbol)) {
//out port of supercomp
inferRosConnectionIfPossible(connectorSymbol.getTargetPort(), connectorSymbol.getSourcePort());
inferRosConnectionIfPossible(connectorSymbol);
generateRosConnectionIfPossible(connectorSymbol);
} else {
//In between subcomps
inferRosConnectionIfPossible(connectorSymbol);
generateRosConnectionIfPossible(connectorSymbol);
}
......@@ -37,6 +38,7 @@ public class RosHelper {
}
//Cannot be moved to GeneratorRosCpp: target port name needed for topic name
private static void generateRosConnectionIfPossible(EMAConnectorInstanceSymbol connectorSymbol) {
MiddlewareSymbol sourceTag = connectorSymbol.getSourcePort().getMiddlewareSymbol().orElse(null);
MiddlewareSymbol targetTag = connectorSymbol.getTargetPort().getMiddlewareSymbol().orElse(null);
......@@ -72,6 +74,11 @@ public class RosHelper {
}
}
private static void inferRosConnectionIfPossible(EMAConnectorInstanceSymbol connectorSymbol) {
inferRosConnectionIfPossible(connectorSymbol.getSourcePort(), connectorSymbol.getTargetPort());
inferRosConnectionIfPossible(connectorSymbol.getTargetPort(), connectorSymbol.getSourcePort());
}
private static void inferRosConnectionIfPossible(EMAPortInstanceSymbol sourcePort, EMAPortInstanceSymbol targetPort) {
MiddlewareSymbol sourceTag = sourcePort.getMiddlewareSymbol().orElse(null);
MiddlewareSymbol targetTag = targetPort.getMiddlewareSymbol().orElse(null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment