From 9ee56f53c831a15a8cbd44695326abcdbdd2def0 Mon Sep 17 00:00:00 2001 From: steelec Date: Sun, 5 Nov 2023 14:37:34 -0500 Subject: [PATCH 1/3] zero'd left/right reference bars at start of block and end of trial --- src/main/java/com/github/neuralabc/spft/task/Block.java | 9 ++++++++- src/main/java/com/github/neuralabc/spft/task/Trial.java | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/neuralabc/spft/task/Block.java b/src/main/java/com/github/neuralabc/spft/task/Block.java index 6fb9766..d497d32 100644 --- a/src/main/java/com/github/neuralabc/spft/task/Block.java +++ b/src/main/java/com/github/neuralabc/spft/task/Block.java @@ -31,12 +31,19 @@ public Block(BlockConfig config, Map sequencesPool, Trig public void run(ExperimentFrame.Binding binding, Path outputFile) throws InterruptedException, IOException { LOG.info("\tStarting block '{}'", config.getName()); + // set the position of the bars back to 0 (which will be equivalent to min height) + // at the start of every block to ensure that the participant does not move + // to the last position of the previous trial (and b/c this is set to 1 on the 1st block) + binding.setLeftReferenceValue(0.0); // testing + binding.setRightReferenceValue(0.0); // testing + binding.showLeftBars(trials.get(0).hasLeftSequence()); binding.showRightBars(trials.get(0).hasRightSequence()); + binding.showText(config.getInstructions()); + Thread.sleep(config.getInstructionsDuration()); binding.showText(""); - for (int currentTrial = 0; currentTrial < config.getTrials().size(); currentTrial++) { Trial nextTrial = trials.get(currentTrial); diff --git a/src/main/java/com/github/neuralabc/spft/task/Trial.java b/src/main/java/com/github/neuralabc/spft/task/Trial.java index 9b8bb12..87b5805 100644 --- a/src/main/java/com/github/neuralabc/spft/task/Trial.java +++ b/src/main/java/com/github/neuralabc/spft/task/Trial.java @@ -66,6 +66,12 @@ public void run(ExperimentFrame.Binding binding, Path outputFile) throws Interru timer.stop(); writeOutput(outputFile); + + // at the end of every trial we also reset the reference values to the min value + // to indicate the trial has ended and ensure that the participant does not move + // to the last position of the previous trial + binding.setLeftReferenceValue(0.0); + binding.setRightReferenceValue(0.0); } private void writeOutput(Path outputFile) throws IOException { From 14385b48da92ae85d520463e35be6ad8f290a6cb Mon Sep 17 00:00:00 2001 From: steelec Date: Sun, 5 Nov 2023 14:46:49 -0500 Subject: [PATCH 2/3] updated readme to include color example from original paper --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bcbfc4..14d93a5 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,13 @@ or after the last one `triggers`: [Optional] A list or single key that needs to be pressed to start the session after the experimenter has manually started it. This is useful when there's an external devices that needs to synchronize execution, such as an MRI scanner. If the parameter is missing, the session will start as soon as the experimenter clicks on start -`colours`: [Optional] A hex colour code (without '#') to use for the `leftReference`, `leftForce`, `rightReference` or `rightForce` bars +`colours`: [Optional] A hex colour code (without '#') to use for the `leftReference`, `leftForce`, `rightReference` or `rightForce` bars +``` + colours: # optional + leftReference: 0000FF #blue + leftForce: FEFE00 #yellow +``` + `blocks`: The list of blocks in the sessions `blocks.name`: A friendly name of a particular block. Seen only by the experimenter `blocks.instructions`: A string giving the instructions to the participant of the block that is about to start From 0d7b64689e885d9d828553972178233cde3d4d03 Mon Sep 17 00:00:00 2001 From: steelec Date: Sun, 5 Nov 2023 15:04:33 -0500 Subject: [PATCH 3/3] version bump --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index adab1e2..1226438 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.neuralabc.spft spft - 1.4-SNAPSHOT + 1.5-SNAPSHOT Sequence Pinch Force Task A Java implementation of a Sequence Pinch Force task, with ability to trigger to external serial device