Changeset 1303 for trunk/autoquest-plugin-guitar/src
- Timestamp:
- 09/02/13 18:10:07 (11 years ago)
- Location:
- trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin
- Files:
-
- 3 added
- 4 deleted
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/commands/CMDbinaryAligment.java
r1218 r1303 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.plugin. guitar.commands;15 package de.ugoe.cs.autoquest.plugin.alignment.commands; 16 16 17 17 import java.io.File; … … 24 24 import de.ugoe.cs.autoquest.CommandHelpers; 25 25 import de.ugoe.cs.autoquest.eventcore.Event; 26 import de.ugoe.cs.autoquest.plugin.guitar.GUITARTestCaseParser;27 26 import de.ugoe.cs.util.console.Command; 28 27 import de.ugoe.cs.util.console.Console; … … 31 30 /** 32 31 * <p> 33 * Command to load a set of sequences from a set of GUITAR test cases.32 * Command to generate a binary alignment of two sequences 34 33 * </p> 35 34 * … … 37 36 * @version 1.0 38 37 */ 39 public class CMD efgTestCasesToSequencesimplements Command {38 public class CMDbinaryAligment implements Command { 40 39 41 40 /* … … 46 45 @Override 47 46 public void run(List<Object> parameters) { 48 String foldername;49 47 String sequencesName; 50 String efgFileName = null;48 String algorithm; 51 49 try { 52 foldername = (String) parameters.get(0); 53 sequencesName = (String) parameters.get(1); 54 if (parameters.size() >= 3) { 55 efgFileName = (String) parameters.get(2); 50 sequencesName = (String) parameters.get(0); 51 if (parameters.size() > 1) { 52 algorithm = (String) parameters.get(1); 56 53 } 57 54 } catch (Exception e) { … … 59 56 } 60 57 61 File folder = new File(foldername);62 58 63 File[] testcaseFiles = folder.listFiles( new FilenameFilter() {64 @Override65 public boolean accept(File dir, String name) {66 return name.endsWith(".tst");67 }68 });69 59 Collection<List<Event>> sequences = new LinkedList<List<Event>>(); 70 GUITARTestCaseParser parser; 71 if (efgFileName == null) { 72 parser = new GUITARTestCaseParser(); 73 } else { 74 parser = new GUITARTestCaseParser(efgFileName); 75 } 76 for (File testcaseFile : testcaseFiles) { 77 Console.traceln(Level.INFO, "Loading from file " 78 + testcaseFile.getAbsolutePath()); 79 sequences.add(parser.parseTestCaseFile(testcaseFile)); 80 } 81 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { 82 CommandHelpers.dataOverwritten(sequencesName); 83 } 60 84 61 85 62 } … … 92 69 @Override 93 70 public String help() { 94 return " efgTestCasesToSequences <directory> <sequencesName> {<guiFileName>}";71 return "binaryAlignment <sequencesName> {<algorithm>}"; 95 72 } 96 73
Note: See TracChangeset
for help on using the changeset viewer.