From 0d972c388b6e0f25e0725531000fbf72eb032f53 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 28 Nov 2014 14:01:15 +0000 Subject: [PATCH] JAL-1583 new validInput flag set according to validity of all MSA jobs prepared for submission --- src/jalview/ws/jws2/MsaWSThread.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index 635f92b..c4f3d2d 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -485,7 +485,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI SequenceI[][] conmsa = _msa.getVisibleContigs('-'); if (conmsa != null) { - int njobs = conmsa.length; + int nvalid = 0, njobs = conmsa.length; jobs = new MsaWSJob[njobs]; for (int j = 0; j < njobs; j++) { @@ -497,6 +497,10 @@ class MsaWSThread extends AWS2Thread implements WSClientI { jobs[j] = new MsaWSJob(0, conmsa[j]); } + if (((MsaWSJob) jobs[j]).hasValidInput()) + { + nvalid++; + } ((MsaWSJob) jobs[j]).preset = preset; ((MsaWSJob) jobs[j]).arguments = paramset; ((MsaWSJob) jobs[j]).alignmentProgram = wsname; @@ -507,9 +511,20 @@ class MsaWSThread extends AWS2Thread implements WSClientI } wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader); } + validInput = nvalid > 0; } } + boolean validInput = false; + + /** + * + * @return true if the thread will perform a calculation + */ + public boolean hasValidInput() + { + return validInput; + } public boolean isCancellable() { return true; -- 1.7.10.2