1- import React , { useState , useCallback } from "react" ;
1+ import React , { useState , useCallback } from "react" ;
22import { MuseClient } from "muse-js" ;
33import { Select , Card , Stack , Button , ButtonGroup } from "@shopify/polaris" ;
44
@@ -15,9 +15,10 @@ import * as funSpectra from "./components/EEGEduSpectra/EEGEduSpectra";
1515import * as funBands from "./components/EEGEduBands/EEGEduBands" ;
1616import * as funAnimate from "./components/EEGEduAnimate/EEGEduAnimate" ;
1717import * as funSpectro from "./components/EEGEduSpectro/EEGEduSpectro" ;
18- import * as funAlpha from "./components/EEGEduAlpha/EEGEduAlpha"
19- import * as funSsvep from "./components/EEGEduSsvep/EEGEduSsvep"
20- import * as funPredict from "./components/EEGEduPredict/EEGEduPredict"
18+ import * as funAlpha from "./components/EEGEduAlpha/EEGEduAlpha" ;
19+ import * as funSsvep from "./components/EEGEduSsvep/EEGEduSsvep" ;
20+ import * as funEvoked from "./components/EEGEduEvoked/EEGEduEvoked" ;
21+ import * as funPredict from "./components/EEGEduPredict/EEGEduPredict" ;
2122
2223const intro = translations . types . intro ;
2324const heartRaw = translations . types . heartRaw ;
@@ -29,6 +30,7 @@ const animate = translations.types.animate;
2930const spectro = translations . types . spectro ;
3031const alpha = translations . types . alpha ;
3132const ssvep = translations . types . ssvep ;
33+ const evoked = translations . types . evoked ;
3234const predict = translations . types . predict ;
3335
3436export function PageSwitcher ( ) {
@@ -44,6 +46,7 @@ export function PageSwitcher() {
4446 const [ spectroData , setSpectroData ] = useState ( emptyChannelData ) ;
4547 const [ alphaData , setAlphaData ] = useState ( emptyChannelData ) ;
4648 const [ ssvepData , setSsvepData ] = useState ( emptyChannelData ) ;
49+ const [ evokedData , setEvokedData ] = useState ( emptyChannelData ) ;
4750 const [ predictData , setPredictData ] = useState ( emptyChannelData ) ;
4851
4952 // pipe settings
@@ -57,6 +60,7 @@ export function PageSwitcher() {
5760 const [ spectroSettings , setSpectroSettings ] = useState ( funSpectro . getSettings ) ;
5861 const [ alphaSettings , setAlphaSettings ] = useState ( funAlpha . getSettings ) ;
5962 const [ ssvepSettings , setSsvepSettings ] = useState ( funSsvep . getSettings ) ;
63+ const [ evokedSettings , setEvokedSettings ] = useState ( funEvoked . getSettings ) ;
6064 const [ predictSettings , setPredictSettings ] = useState ( funPredict . getSettings ) ;
6165
6266 // connection status
@@ -79,6 +83,7 @@ export function PageSwitcher() {
7983 if ( window . subscriptionSpectro ) window . subscriptionSpectro . unsubscribe ( ) ;
8084 if ( window . subscriptionAlpha ) window . subscriptionAlpha . unsubscribe ( ) ;
8185 if ( window . subscriptionSsvep ) window . subscriptionSsvep . unsubscribe ( ) ;
86+ if ( window . subscriptionEvoked ) window . subscriptionEvoked . unsubscribe ( ) ;
8287 if ( window . subscriptionPredict ) window . subscriptionPredict . unsubscribe ( ) ;
8388
8489 subscriptionSetup ( value ) ;
@@ -104,6 +109,7 @@ export function PageSwitcher() {
104109 { label : spectro , value : spectro } ,
105110 { label : alpha , value : alpha } ,
106111 { label : ssvep , value : ssvep } ,
112+ { label : evoked , value : evoked } ,
107113 { label : predict , value : predict }
108114
109115 ] ;
@@ -119,6 +125,7 @@ export function PageSwitcher() {
119125 funSpectro . buildPipe ( spectroSettings ) ;
120126 funAlpha . buildPipe ( alphaSettings ) ;
121127 funSsvep . buildPipe ( ssvepSettings ) ;
128+ funEvoked . buildPipe ( evokedSettings ) ;
122129 funPredict . buildPipe ( predictSettings ) ;
123130 }
124131
@@ -154,6 +161,9 @@ export function PageSwitcher() {
154161 case ssvep :
155162 funSsvep . setup ( setSsvepData , ssvepSettings ) ;
156163 break ;
164+ case evoked :
165+ funEvoked . setup ( setEvokedData , evokedSettings ) ;
166+ break ;
157167 case predict :
158168 funPredict . setup ( setPredictData , predictSettings ) ;
159169 break ;
@@ -236,6 +246,10 @@ export function PageSwitcher() {
236246 return (
237247 funSsvep . renderSliders ( setSsvepData , setSsvepSettings , status , ssvepSettings )
238248 ) ;
249+ case evoked :
250+ return (
251+ funEvoked . renderSliders ( setEvokedData , setEvokedSettings , status , evokedSettings )
252+ ) ;
239253 case predict :
240254 return (
241255 funPredict . renderSliders ( setPredictData , setPredictSettings , status , predictSettings )
@@ -266,6 +280,8 @@ export function PageSwitcher() {
266280 return < funAlpha . renderModule data = { alphaData } /> ;
267281 case ssvep :
268282 return < funSsvep . renderModule data = { ssvepData } /> ;
283+ case evoked :
284+ return < funEvoked . renderModule data = { evokedData } /> ;
269285 case predict :
270286 return < funPredict . renderModule data = { predictData } /> ;
271287 default :
@@ -307,6 +323,10 @@ export function PageSwitcher() {
307323 return (
308324 funSsvep . renderRecord ( recordPopChange , recordPop , status , ssvepSettings , recordTwoPopChange , recordTwoPop )
309325 )
326+ case evoked :
327+ return (
328+ funEvoked . renderRecord ( recordPopChange , recordPop , status , evokedSettings )
329+ )
310330 case predict :
311331 return (
312332 funPredict . renderRecord ( status )
0 commit comments