An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cleaning things up; Removing jspsych references; unmounted epics

+25 -31
OVERVIEW.md

This is a binary file and will not be displayed.

+2 -9
app/components/CollectComponent/RunComponent.tsx
··· 9 9 import { EXPERIMENTS, DEVICES } from '../../constants/constants'; 10 10 import { ExperimentWindow } from '../../utils/labjs'; 11 11 import { checkFileExists, getImages } from '../../utils/filesystem/storage'; 12 - import { 13 - MainTimeline, 14 - Trial, 15 - ExperimentParameters, 16 - } from '../../constants/interfaces'; 12 + import { Trial, ExperimentParameters } from '../../constants/interfaces'; 17 13 import { ExperimentActions } from '../../actions'; 18 14 19 15 const { dialog } = remote; ··· 23 19 title: string; 24 20 isRunning: boolean; 25 21 params: ExperimentParameters; 26 - mainTimeline: MainTimeline; 27 22 trials: { 28 23 [key: string]: Trial; 29 24 }; ··· 56 51 } 57 52 58 53 componentDidMount() { 59 - if (this.props.mainTimeline.length <= 0) { 60 - this.props.ExperimentActions.LoadDefaultTimeline(); 61 - } 54 + this.props.ExperimentActions.LoadDefaultTimeline(); 62 55 } 63 56 64 57 async handleStartExperiment() {
-3
app/components/CollectComponent/index.tsx
··· 8 8 DEVICE_AVAILABILITY, 9 9 } from '../../constants/constants'; 10 10 import { 11 - MainTimeline, 12 11 Trial, 13 12 ExperimentParameters, 14 13 SignalQualityData, ··· 32 31 isRunning: boolean; 33 32 params: ExperimentParameters; 34 33 paradigm: EXPERIMENTS; 35 - mainTimeline: MainTimeline; 36 34 trials: { 37 35 [key: string]: Trial; 38 36 }; ··· 136 134 paradigm={this.props.paradigm} 137 135 isRunning={this.props.isRunning} 138 136 params={this.props.params} 139 - mainTimeline={this.props.mainTimeline} 140 137 trials={this.props.trials} 141 138 timelines={this.props.timelines} 142 139 subject={this.props.subject}
-2
app/components/DesignComponent/CustomDesignComponent.tsx
··· 15 15 import styles from '../styles/common.css'; 16 16 import { EXPERIMENTS, SCREENS } from '../../constants/constants'; 17 17 import { 18 - MainTimeline, 19 18 Trial, 20 19 ExperimentParameters, 21 20 ExperimentDescription, ··· 56 55 type: EXPERIMENTS | null | undefined; 57 56 title: string; 58 57 params: ExperimentParameters; 59 - mainTimeline: MainTimeline; 60 58 trials: { 61 59 [key: string]: Trial; 62 60 };
+1 -6
app/components/PreviewExperimentComponent.tsx
··· 4 4 import styles from './styles/collect.css'; 5 5 6 6 import { getImages } from '../utils/filesystem/storage'; 7 - import { 8 - MainTimeline, 9 - Trial, 10 - ExperimentParameters, 11 - } from '../constants/interfaces'; 7 + import { Trial, ExperimentParameters } from '../constants/interfaces'; 12 8 13 9 interface Props { 14 10 title: string; ··· 16 12 params: ExperimentParameters; 17 13 previewParams?: ExperimentParameters; 18 14 isPreviewing: boolean; 19 - mainTimeline: MainTimeline; 20 15 trials: { 21 16 [key: string]: Trial; 22 17 };
+11 -1
app/components/TopNavComponent/index.tsx
··· 12 12 import BrainwavesIcon from '../../assets/common/Brainwaves_Icon_big.png'; 13 13 import { ExperimentActions } from '../../actions'; 14 14 15 - interface Props { 15 + export interface Props { 16 16 title: string | null | undefined; 17 17 location: { pathname: string; search: string; hash: string }; 18 18 isRunning: boolean; ··· 26 26 } 27 27 28 28 export default class TopNavComponent extends Component<Props, State> { 29 + constructor(props: Props) { 30 + super(props); 31 + this.state = { 32 + recentWorkspaces: [], 33 + }; 34 + this.getStyleForScreen = this.getStyleForScreen.bind(this); 35 + this.updateWorkspaces = this.updateWorkspaces.bind(this); 36 + this.handleLoadRecentWorkspace = this.handleLoadRecentWorkspace.bind(this); 37 + } 38 + 29 39 getStyleForScreen(navSegmentScreen: typeof SCREENS[keyof typeof SCREENS]) { 30 40 if (navSegmentScreen.route === this.props.location.pathname) { 31 41 return styles.activeNavColumn;
+2 -4
app/constants/interfaces.ts
··· 1 1 /* 2 - * This file contains all the custom types that we use for Flow type checking 2 + * This file contains many of the TypeScript interfaces that are used across the project 3 3 */ 4 4 5 5 import { ChildProcess } from 'child_process'; ··· 7 7 8 8 // TODO: Write interfaces for device objects (Observables, Classes, etc) 9 9 10 - // ------------------------------------------------------------------ 11 - // lab.js Experiment 12 - 10 + // All mutable aspects of an experiment that can be updated by the DesignComponent 13 11 export type ExperimentParameters = { 14 12 dateModified?: number; 15 13 trialDuration: number;
+1 -1
app/epics/index.ts
··· 4 4 import experiment from './experimentEpics'; 5 5 6 6 // TODO: Fix issue: https://github.com/piotrwitek/typesafe-actions/issues/174 7 - export default combineEpics(jupyter, device, experiment); 7 + export default combineEpics();
+2 -2
app/epics/jupyterEpics.ts
··· 113 113 > = (action$, state$) => 114 114 action$.pipe( 115 115 filter(isActionOf(JupyterActions.SetMainChannel)), 116 - mergeMap<{}, ObservableInput<JupyterActionType>>(() => 116 + mergeMap<Record<string, unknown>, ObservableInput<JupyterActionType>>(() => 117 117 state$.value.jupyter.mainChannel.pipe( 118 - map<object, JupyterActionType>((msg) => { 118 + map<{ header: { msg_type: string } }, JupyterActionType>((msg) => { 119 119 console.log(debugParseMessage(msg)); 120 120 switch (msg.header.msg_type) { 121 121 case 'kernel_info_reply':
+1 -1
app/utils/filesystem/storage.ts
··· 170 170 }; 171 171 172 172 // Reads an experiment state tree from disk and parses it from JSON 173 - export const readAndParseState = (dir: string) => { 173 + export const readAndParseState = (dir: string): ExperimentStateType | null => { 174 174 try { 175 175 return JSON.parse( 176 176 fs.readFileSync(path.join(workspaces, dir, 'appState.json'), {
+5 -1
app/utils/labjs/index.tsx
··· 3 3 import clonedeep from 'lodash.clonedeep'; 4 4 import * as lab from 'lab.js/dist/lab.dev'; 5 5 import { ExperimentSettings } from '../../constants/interfaces'; 6 + 7 + // TODO: Switch to using .json files to load lab.js studies 6 8 import visualsearch from './scripts/visualsearch'; 7 9 import stroop from './scripts/stroop'; 8 10 import multitasking from './scripts/multitasking'; ··· 64 66 this.study = lab.util.fromObject(clonedeep(custom), lab); 65 67 break; 66 68 } 67 - this.study.run(); 69 + 68 70 this.study.on('end', () => { 69 71 const csv = this.study.options.datastore.exportCsv(); 70 72 this.study = undefined; ··· 81 83 } 82 84 } 83 85 }; 86 + 87 + this.study.run(); 84 88 } 85 89 86 90 componentWillUnmount() {
-1
app/utils/labjs/protocols/stroop.ts
··· 63 63 response: '9', 64 64 }, 65 65 }, 66 - mainTimeline: ['intro', 'stroopTimeline', 'end'], // array of trial and timeline ids 67 66 trials: { 68 67 intro: { 69 68 type: 'callback-html-display',