Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No eeg event codes #162

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

No eeg event codes #162

wants to merge 8 commits into from

Conversation

moblim
Copy link
Collaborator

@moblim moblim commented Sep 2, 2022

No description provided.

moblim and others added 8 commits July 14, 2022 11:35
Turns out the triggers are tied specifically to public>electron.js. the code chunk called //TRIGGER PORT HELPERS
are where electron looks for EEG ports to enable triggers. It creates a pop-up if EEG is not connected. Commenting out
this code will remove this pop-up and stop triggers from happening:

 // TRIGGER PORT HELPERS
// let triggerPort;
// let portAvailable;
// let SKIP_SENDING_DEV = false;

// const setUpPort = async () => {
//   p = await getPort(activeComName);
//   if (p) {
//     triggerPort = p;
//     portAvailable = true;

//     triggerPort.on("error", (err) => {
//       log.error(err);
//       let buttons = ["OK", "Continue Anyway"];
//       // if (process.env.ELECTRON_START_URL) {
//       //   buttons.push("Continue Anyway")
//       // }
//       dialog
//         .showMessageBox(mainWindow, {
//           type: "error",
//           message: "Error communicating with event marker.",
//           title: "Task Error",
//           buttons: buttons,
//           defaultId: 0,
//         })
//         .then((opt) => {
//           if (opt.response == 0) {
//             app.exit();
//           } else {
//             SKIP_SENDING_DEV = true;
//             portAvailable = false;
//             triggerPort = false;
//           }
//         });
//     });
//   } else {
//     triggerPort = false;
//     portAvailable = false;
//   }
// };

In the interest of reducing any major changes to the code, I am leaving both files named trigger.js in the code.
They are useless now but I would rather keep them for reversibility.

DELETING ALL MENTION OF EEG WITHIN INSTRUCTIONS

Commented out RecordNow qihn src/timelines/main.js to circumvent any EEG prompts

This should encompass all of the EEG related changes.

SESSION NUMBER INCLUSION

Added text in src/language/en_us.json between "set" and ""get_prolific": "sessionNum": "Please enter the <i>Session #</i>. <br><span class='text-smoll'>(The file will automatically be named <i>Subject ID</i>_<i>Session</i>_Effort.)</span>",

Added chunk of code after line 59 in src/trials/userId.js

Added code in src/lib/utils.js

	added a const within const getUserId

	const sessionNum = JSON.parse(data.responses)["Q1"];
  jsPsych.data.addProperties({ sessionNum: sessionNum, timestamp: Date.now() });
  console.log("session", sessionNum);

Added code in public/electron.js

	Added let sessionNum = ""
	Added sessionNum = args.sessionNum;
	changed line 205 to: fileName = `${patientID}_${sessionNum}_${Effort}.json`; from    fileName = `${patientID}_${Effort}.json`;
	changed line 303 to const copyPath = path.join(desktop, dataDir, `${patientID}_${sessionNum}_${Effort}`); from   const copyPath = path.join(desktop, dataDir, `${patientID}_${Effort}`);

There should now be a prompt on the participant ID screen that asks for the
…e or two. Denying anything else.

Added checkSess to the timeline
removed baseStimulus from userID, reformatted userID prompts to show closely stacked instead of on seperate pages.
Commented out lines 14-20  and 272-274. These lines pertained to triggers and event codes. Given lines 102-186 were commented out, the pop-up for eeg connection would not appear, and the aforementioned code would fail, causing the package version of the task to be suspended as a background process in windows. Commentig out these lines solved the issue and the app will run as expected.
Commenting out lines 47 and 48 as they are no longer relevant for RT collection, streamlining the task slightly.
@RobertGemmaJr RobertGemmaJr removed their request for review June 23, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants