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
Branches
No related tags found
1 merge request!1festival updatesfestival updatesfestival updatesfestival updatesfestival
...@@ -37,15 +37,31 @@ aspect Tracing { ...@@ -37,15 +37,31 @@ aspect Tracing {
de.tudresden.inf.st.jastadd.dumpAst.ast.Dumper.read(world) de.tudresden.inf.st.jastadd.dumpAst.ast.Dumper.read(world)
.setNameMethod(o -> o == null ? "null" : o.getClass().getSimpleName()) .setNameMethod(o -> o == null ? "null" : o.getClass().getSimpleName())
.setBackgroundColorMethod(n -> (n == highlightNode ? highlightColor : DEFAULT_COLOR)) .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) .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() .<ASTNode>includeRelationsWhen((sourceNode, targetNode, roleName) -> !roleName.equals("AttachedRobot") && !(sourceNode != null && sourceNode.inDemonstrationTable()) && !(targetNode != null && targetNode.inDemonstrationTable())) // !sourceNode.inDemonstrationTable()
.dumpAsSVG(svgPath); .dumpAsSVG(svgPath);
} catch (java.io.IOException e) { } catch (java.io.IOException e) {
e.printStackTrace(); 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