-
Notifications
You must be signed in to change notification settings - Fork 39
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
[ready to deploy] Auxillary channel toggle #116
Conversation
…eds it, and toggles to plot and save the aux or not
@@ -35,18 +35,29 @@ const predict = translations.types.predict; | |||
|
|||
export function PageSwitcher() { | |||
|
|||
// For auxEnable settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic to control aux at very high level since it needs to happen before connect and only show toggle in certain modules
const handleChange = useCallback((newChecked) => setChecked(newChecked), []); | ||
window.enableAux = checked; | ||
if (window.enableAux) { | ||
window.nchans = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for loops and settings
// For auxEnable settings | ||
const [checked, setChecked] = useState(false); | ||
const handleChange = useCallback((newChecked) => setChecked(newChecked), []); | ||
window.enableAux = checked; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean
} else { | ||
window.nchans = 4; | ||
} | ||
let showAux = true; // if it is even available to press (to prevent in some modules) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bollean for option being there or not
const [rawData, setRawData] = useState(emptyChannelData); | ||
const [spectraData, setSpectraData] = useState(emptyChannelData); | ||
const [bandsData, setBandsData] = useState(emptyChannelData); | ||
const [rawData, setRawData] = useState(emptyAuxChannelData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these all use a different prototype with 5 channels, but that still works and they are ok with no aux channel as well
@@ -98,6 +109,48 @@ export function PageSwitcher() { | |||
const [recordTwoPop, setRecordTwoPop] = useState(false); | |||
const recordTwoPopChange = useCallback(() => setRecordTwoPop(!recordTwoPop), [recordTwoPop]); | |||
|
|||
switch (selected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to control if the toggle itself is is active at all
@@ -188,6 +241,7 @@ export function PageSwitcher() { | |||
// Connect with the Muse EEG Client | |||
setStatus(generalTranslations.connecting); | |||
window.source = new MuseClient(); | |||
window.source.enableAux = window.enableAux; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to get extra channel from muse-js
@@ -256,7 +310,7 @@ export function PageSwitcher() { | |||
} | |||
} | |||
|
|||
function renderCharts() { | |||
function renderModules() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name fix unrelated to this pr
label="Enable Muse Auxillary Channel" | ||
checked={checked} | ||
onChange={handleChange} | ||
disabled={!showAux || status !== generalTranslations.connect} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toggle beside buttons
@@ -1,3 +1,5 @@ | |||
import { customCount } from './chartUtils' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this now exports 4 or 5 channels depending on settings
…o to other module it doesnt crash
Adding a checkbox toggle beside the connect buttons for some of the modules. This will turn on or off the subscription in muse-js to the aux, it alters the number of fake channels sent by mockMuseEEG, it alters the processing through neurosity pipes to send an extra channel through, and it plots the aux channel or not.
if toggle is enabled, it saves aux data into csv, if not, then it keeps current functionality of NaNs
added to bands, spectra, heart rate modules, ssvep, evoked, and open/closed,
any that don't use just a single preselected channel (like animation, bci, intro)