From: gmungoc Date: Fri, 11 Nov 2016 08:50:57 +0000 (+0000) Subject: JAL-2295 (optionally) return Chimera command reply X-Git-Tag: Release_2_11_0~62^2~61 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dad42ab3148494804b4c9d95bc416a7beb2a84dc;p=jalview.git JAL-2295 (optionally) return Chimera command reply --- diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index 8601b1b..3d6e239 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -596,31 +596,40 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel } /** - * Send a command to Chimera, and optionally log any responses. + * Send a command to Chimera, and optionally log and return any responses * * @param command - * @param logResponse + * @param getResponse */ - public void sendChimeraCommand(final String command, boolean logResponse) + public List sendChimeraCommand(final String command, + boolean getResponse) { if (viewer == null) { // ? thread running after viewer shut down - return; + return null; } + List reply = null; viewerCommandHistory(false); if (lastCommand == null || !lastCommand.equals(command)) { // trim command or it may never find a match in the replyLog!! List lastReply = viewer.sendChimeraCommand(command.trim(), - logResponse); - if (logResponse && debug) + getResponse); + if (getResponse) { - log("Response from command ('" + command + "') was:\n" + lastReply); + reply = lastReply; + if (debug) + { + log("Response from command ('" + command + "') was:\n" + + lastReply); + } } } viewerCommandHistory(true); lastCommand = command; + + return reply; } /**