Skip to content
Snippets Groups Projects
Commit d76006ef authored by Johannes Mey's avatar Johannes Mey
Browse files

only show the last five selections

parent 31d37116
No related branches found
No related tags found
1 merge request!1festival updatesfestival updatesfestival updatesfestival updatesfestival
......@@ -37,15 +37,31 @@ aspect Tracing {
de.tudresden.inf.st.jastadd.dumpAst.ast.Dumper.read(world)
.setNameMethod(o -> o == null ? "null" : o.getClass().getSimpleName())
.setBackgroundColorMethod(n -> (n == highlightNode ? highlightColor : DEFAULT_COLOR))
.includeTokensWhen((node, tokenName, value) -> !tokenName.matches("Q.") && !tokenName.equals("TimeStamp")) // FIXME remove domain-specific code
.includeTokensWhen((node, tokenName, value) -> !tokenName.matches("Q.") && !tokenName.equals("TimeStamp") && !tokenName.startsWith("_ragconnect_")) // FIXME remove domain-specific code
.includeAttributeWhen((node, attributeName, isNTA, value) -> isNTA)
.<ASTNode>includeChildWhen((parentNode, childNode, contextName) -> !((contextName.equals("Pose") || contextName.equals("Robot")) && childNode.inDemonstrationTable()))
.<ASTNode>includeChildWhen((parentNode, childNode, contextName) -> {
if (contextName.equals("DemonstrationTable")) {
return false;
} else if ("Selection".equals(contextName) && childNode instanceof Selection && parentNode instanceof RobotWorld) {
Selection s = (Selection) childNode;
RobotWorld w = (RobotWorld) parentNode;
int LAST_X_SELECTIONS = 5;
for (int i = w.getNumSelection() - 1; i > 0 && i > w.getNumSelection() - 1 - LAST_X_SELECTIONS; i--) {
if (w.getSelection(i) == childNode) {
return true;
}
}
return false;
} else {
return true;
}
})
.<ASTNode>includeRelationsWhen((sourceNode, targetNode, roleName) -> !roleName.equals("AttachedRobot") && !(sourceNode != null && sourceNode.inDemonstrationTable()) && !(targetNode != null && targetNode.inDemonstrationTable())) // !sourceNode.inDemonstrationTable()
.dumpAsSVG(svgPath);
} catch (java.io.IOException e) {
e.printStackTrace();
}
de.tudresden.inf.st.mg.ImmersiveSortingController.getInstance().publish(now, 0, step, svgPath, "context");
de.tudresden.inf.st.mg.common.Webserver.getInstance().publish(now, 0, step, svgPath, "context");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment