Commit 704840d3 authored by Sarah Grebing's avatar Sarah Grebing

minor bugfix for wrapper

parent 9dca4cfc
Pipeline #14975 failed with stage
in 2 minutes and 4 seconds
......@@ -79,7 +79,7 @@ public class ControlFlowVisitor extends DefaultASTVisitor<Void> {
if (assocNode != null) {
graph.edges().forEach(edge -> {
if (edge.target().equals(assocNode)) {
allPreds.add(new Pair(edge.source(), edge));
allPreds.add(new Pair(edge.source(), graph.edgeValue(edge.source(), edge.target())));
}
......@@ -111,7 +111,7 @@ public class ControlFlowVisitor extends DefaultASTVisitor<Void> {
graph.edges().forEach(edge -> {
if (edge.source().equals(assocNode)) {
allPreds.add(new Pair(edge.target(), edge));
allPreds.add(new Pair(edge.target(), graph.edgeValue(edge.source(), edge.target())));
}
......
......@@ -345,14 +345,14 @@ public class StateGraphWrapper<T> {
private void fireNodeAdded(NodeAddedEvent nodeAddedEvent) {
changeListeners.forEach(list -> Platform.runLater(() -> {
list.graphChanged(nodeAddedEvent);
LOGGER.info("New StateGraphChange \n" + this.asdot() + "\n");
// LOGGER.info("New StateGraphChange \n" + this.asdot() + "\n");
}));
}
private void fireStateAdded(StateAddedEvent stateAddedEvent) {
changeListeners.forEach(list -> Platform.runLater(() -> {
list.graphChanged(stateAddedEvent);
LOGGER.debug("New StateGraphChange " + this.asdot());
//LOGGER.debug("New StateGraphChange " + this.asdot());
}));
}
......
......@@ -122,24 +122,28 @@ public class ProofTreeController {
private GraphChangedListener graphChangedListener = new GraphChangedListener() {
@Override
public void graphChanged(NodeAddedEvent nodeAddedEvent) {
PTreeNode added = nodeAddedEvent.getAddedNode();
if (added.getExtendedState() != null) {
LOGGER.info("Graph changed with the following PTreeNode: {} and the statepointer points to {}", nodeAddedEvent.getAddedNode(), statePointer);
nextComputedNode.setValue(nodeAddedEvent.getAddedNode());
// Events.fire(new Events.NewNodeExecuted(nodeAddedEvent.getAddedNode().getScriptstmt()));
if (nodeAddedEvent != null) {
PTreeNode added = nodeAddedEvent.getAddedNode();
if (added.getExtendedState() != null) {
LOGGER.info("Graph changed with the following PTreeNode: {} and the statepointer points to {}", nodeAddedEvent.getAddedNode(), statePointer);
nextComputedNode.setValue(nodeAddedEvent.getAddedNode());
// Events.fire(new Events.NewNodeExecuted(nodeAddedEvent.getAddedNode().getScriptstmt()));
}
}
}
@Override
public void graphChanged(StateAddedEvent stateAddedEvent) {
PTreeNode changedNode = stateAddedEvent.getChangedNode();
LOGGER.info("Graph changed by adding a state to PTreeNode: {} and the statepointer points to {}", stateAddedEvent, statePointer);
nextComputedNode.set(changedNode);
//Events.fire(new Events.NewNodeExecuted(changedNode.getScriptstmt()));
if (stateAddedEvent != null) {
PTreeNode changedNode = stateAddedEvent.getChangedNode();
LOGGER.info("Graph changed by adding a state to PTreeNode: {} and the statepointer points to {}", stateAddedEvent, statePointer);
nextComputedNode.set(changedNode);
//Events.fire(new Events.NewNodeExecuted(changedNode.getScriptstmt()));
}
}
};
public ProofScript getMainScript() {
......@@ -176,7 +180,7 @@ public class ProofTreeController {
this.statePointer = newValue;
//setNewState(blocker.currentStateProperty().get());
setNewState(newValue.getExtendedState().getStateAfterStmt());
setNewState(newValue.getExtendedState().getStateBeforeStmt());
}
});
......@@ -193,9 +197,10 @@ public class ProofTreeController {
*/
private void setNewState(State<KeyData> state) {
LOGGER.info("Setting new State " + state.toString());
//Statepointer null wenn anfangszustand?
if (statePointer != null && state != null) {
LOGGER.info("Setting new State " + state.toString());
//setCurrentHighlightNode(statePointer.getScriptstmt());
//get all goals that are open
Object[] arr = state.getGoals().stream().filter(keyDataGoalNode -> !keyDataGoalNode.isClosed()).toArray();
......
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