# HG changeset patch # User Marcus Pearce # Date 1277138244 -3600 # Node ID 6108a8aa9d8285bf77e289a2b6095fc613f778ff # Parent 1fe7ac28a3caa9b82c65558e34e9e33f610532b4 Add command line option to turn off clock. Ignore-this: 1b88592bed48f4491e1563cccfbccbeb diff -r 1fe7ac28a3ca -r 6108a8aa9d82 Experiment.java --- a/Experiment.java Mon Jun 14 13:28:18 2010 +0100 +++ b/Experiment.java Mon Jun 21 17:37:24 2010 +0100 @@ -2,7 +2,7 @@ * File: Experiment.java * Author: Marcus Pearce * Created: <2007-02-14 11:28:27 marcusp> - * Time-stamp: <2010-06-08 16:18:32 marcusp> + * Time-stamp: <2010-06-21 16:51:26 marcusp> *============================================================================= */ @@ -38,6 +38,8 @@ /* The GUI */ private ExperimentGui gui; + /* whether to show the clock */ + private boolean showClock; /* the units of the clock as multiples of the tatum */ private int clockUnits; /* number of units that clock runs for before a probe event */ @@ -71,6 +73,7 @@ public SubjectResults getSubjectResults() { return results; } public Block getCurrentBlock() { return blocks[currentBlockID]; } public int getCurrentBlockID() { return currentBlockID + 1; } + public boolean showClock() { return showClock; } public int getClockUnits() { return clockUnits; } public int getNumUnits() { return numUnits; } public String getInstructionsFile() { return INSTRUCTIONS_FILE; } @@ -83,10 +86,14 @@ } /* Constructor */ - public Experiment (int cu, int nu, int sl, int md, String la, String ha) { + public Experiment (int sc, int cu, int nu, int sl, int md, String la, String ha) { // Setup variables results = new SubjectResults(this); + if (sc == 0) + showClock = false; + else + showClock = true; clockUnits = cu; numUnits = nu; scaleLength = sl; @@ -138,13 +145,15 @@ public static void main(String[] args) { if (args.length == 0) { System.out.println("Usage: " + "\t" + "java Experiment " + - " " + - " "); + " " + + " " + + " "); System.exit(1); } // Parse Arguments - int n = 0; + int n = 0; + int sc = Integer.parseInt(args[n++]); int cu = Integer.parseInt(args[n++]); int nu = Integer.parseInt(args[n++]); int md = Integer.parseInt(args[n++]); @@ -153,7 +162,7 @@ String ha = args[n++]; // Create experiment - Experiment exp = new Experiment(cu, nu, sl, md, la, ha); + Experiment exp = new Experiment(sc, cu, nu, sl, md, la, ha); // Show the GUI int width=(int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(); diff -r 1fe7ac28a3ca -r 6108a8aa9d82 ExperimentGui.java --- a/ExperimentGui.java Mon Jun 14 13:28:18 2010 +0100 +++ b/ExperimentGui.java Mon Jun 21 17:37:24 2010 +0100 @@ -2,7 +2,7 @@ * File: ExperimentGui.java * Author: Marcus Pearce * Created: <2007-02-14 16:42:31 marcusp> - * Time-stamp: <2010-05-18 11:12:05 marcusp> + * Time-stamp: <2010-06-21 16:50:53 marcusp> *============================================================================= */ @@ -96,9 +96,11 @@ /* Show the Clock */ public void showClock() { - clock.showClock = true; - clock.showFullClock = false; - clock.repaint(); + if (exp.showClock()) { + clock.showClock = true; + clock.showFullClock = false; + clock.repaint(); + } } /* Show the Fixation Point */ diff -r 1fe7ac28a3ca -r 6108a8aa9d82 README --- a/README Mon Jun 14 13:28:18 2010 +0100 +++ b/README Mon Jun 21 17:37:24 2010 +0100 @@ -5,11 +5,12 @@ USAGE - java Experiment + java Experiment -where and are integers: the clock runs for time +where specifies whether to show the clock (0 = no; 1 = +yes) and and are integers: the clock runs for time units before a probed event where the time unit is a multiple of the -tatum as specified by . +tatum as specified by . is an integer specifying the midi device to use (usually 0). diff -r 1fe7ac28a3ca -r 6108a8aa9d82 StimulusPanel.java --- a/StimulusPanel.java Mon Jun 14 13:28:18 2010 +0100 +++ b/StimulusPanel.java Mon Jun 21 17:37:24 2010 +0100 @@ -2,7 +2,7 @@ * File: StimulusPanel.java * Author: Marcus Pearce * Created: <2007-12-05 11:24:00 marcusp> - * Time-stamp: <2010-05-18 11:12:14 marcusp> + * Time-stamp: <2010-06-21 16:50:59 marcusp> *============================================================================= */ @@ -78,7 +78,7 @@ JPanel questionsPanel = new JPanel(); GridLayout gl = new GridLayout(2,2); gl.setHgap(50); - questionsPanel.setLayout(gl); + questionsPanel.setLayout(gl); String[] q1BoxOptions = { "", "Yes", "No" }; q1Box = new JComboBox(q1BoxOptions); diff -r 1fe7ac28a3ca -r 6108a8aa9d82 runExperiment.bat --- a/runExperiment.bat Mon Jun 14 13:28:18 2010 +0100 +++ b/runExperiment.bat Mon Jun 21 17:37:24 2010 +0100 @@ -1,1 +1,1 @@ -java Experiment 1 4 0 7 "Highly unexpected" "Highly expected" +java Experiment 1 1 4 0 7 "Highly unexpected" "Highly expected"