From 6303d93036a87db1ce79c25143725597d8832f86 Mon Sep 17 00:00:00 2001
From: Sebastian Krings <sebastian@krin.gs>
Date: Wed, 2 Jan 2013 11:26:04 +0100
Subject: [PATCH] =?UTF-8?q?switch=20plugin=20output=20to=20list,=20managed?=
 =?UTF-8?q?=20to=20get=20the=20resulting=20state=20printed=20on=20the=20co?=
 =?UTF-8?q?nsole=E2=80=A6..?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../prob/core/command/GetPluginResultCommand.java   | 13 +++----------
 .../de/prob/ui/eventb/StartUnitAnalysisHandler.java |  5 +++--
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/de.prob.core/src/de/prob/core/command/GetPluginResultCommand.java b/de.prob.core/src/de/prob/core/command/GetPluginResultCommand.java
index ec020db3..eb99459f 100644
--- a/de.prob.core/src/de/prob/core/command/GetPluginResultCommand.java
+++ b/de.prob.core/src/de/prob/core/command/GetPluginResultCommand.java
@@ -16,34 +16,27 @@ import de.prob.prolog.term.PrologTerm;
 public final class GetPluginResultCommand implements IComposableCommand {
 
 	private final String resultID;
-	private String result;
+	private ListPrologTerm result;
 
 	public GetPluginResultCommand(final String resultID) {
 		this.resultID = resultID;
 	}
 
-	public String getResult() {
+	public ListPrologTerm getResult() {
 		return result;
 	}
 
 	public void processResult(
 			final ISimplifiedROMap<String, PrologTerm> bindings)
 			throws CommandException {
-		ListPrologTerm list;
 		try {
-			list = BindingGenerator.getList(bindings, "Bindings");
+			result = BindingGenerator.getList(bindings, "Bindings");
 		} catch (ResultParserException e) {
 			CommandException commandException = new CommandException(
 					e.getLocalizedMessage(), e);
 			commandException.notifyUserOnce();
 			throw commandException;
 		}
-
-		for (PrologTerm term : list) {
-			int nextCharCode = BindingGenerator.getInteger(term).getValue()
-					.intValue();
-			result += (char) nextCharCode;
-		}
 	}
 
 	public void writeCommand(final IPrologTermOutput pto) {
diff --git a/de.prob.ui/src/de/prob/ui/eventb/StartUnitAnalysisHandler.java b/de.prob.ui/src/de/prob/ui/eventb/StartUnitAnalysisHandler.java
index 11b73083..554c05b9 100644
--- a/de.prob.ui/src/de/prob/ui/eventb/StartUnitAnalysisHandler.java
+++ b/de.prob.ui/src/de/prob/ui/eventb/StartUnitAnalysisHandler.java
@@ -44,6 +44,7 @@ import de.prob.core.command.StartAnimationCommand;
 import de.prob.core.command.internal.InternalLoadCommand;
 import de.prob.exceptions.ProBException;
 import de.prob.logging.Logger;
+import de.prob.prolog.term.ListPrologTerm;
 
 public class StartUnitAnalysisHandler extends AbstractHandler implements
 		IHandler {
@@ -130,11 +131,11 @@ public class StartUnitAnalysisHandler extends AbstractHandler implements
 
 				// TODO: get resulting state and fill attributes
 				GetPluginResultCommand stateValuesCommand = new GetPluginResultCommand(
-						"Static Analysis Result");
+						"Grounded Result State");
 
 				animator.execute(stateValuesCommand);
 
-				String output = stateValuesCommand.getResult();
+				ListPrologTerm output = stateValuesCommand.getResult();
 
 				System.out.println(output);
 
-- 
GitLab