Conversation
…eds it, and toggles to plot and save the aux or not
kylemath
commented
Jan 6, 2020
|
|
||
| export function PageSwitcher() { | ||
|
|
||
| // For auxEnable settings |
Owner
Author
There was a problem hiding this comment.
logic to control aux at very high level since it needs to happen before connect and only show toggle in certain modules
kylemath
commented
Jan 6, 2020
| const handleChange = useCallback((newChecked) => setChecked(newChecked), []); | ||
| window.enableAux = checked; | ||
| if (window.enableAux) { | ||
| window.nchans = 5; |
kylemath
commented
Jan 6, 2020
| // For auxEnable settings | ||
| const [checked, setChecked] = useState(false); | ||
| const handleChange = useCallback((newChecked) => setChecked(newChecked), []); | ||
| window.enableAux = checked; |
kylemath
commented
Jan 6, 2020
| } else { | ||
| window.nchans = 4; | ||
| } | ||
| let showAux = true; // if it is even available to press (to prevent in some modules) |
Owner
Author
There was a problem hiding this comment.
bollean for option being there or not
kylemath
commented
Jan 6, 2020
| const [rawData, setRawData] = useState(emptyChannelData); | ||
| const [spectraData, setSpectraData] = useState(emptyChannelData); | ||
| const [bandsData, setBandsData] = useState(emptyChannelData); | ||
| const [rawData, setRawData] = useState(emptyAuxChannelData); |
Owner
Author
There was a problem hiding this comment.
these all use a different prototype with 5 channels, but that still works and they are ok with no aux channel as well
kylemath
commented
Jan 6, 2020
| const [recordTwoPop, setRecordTwoPop] = useState(false); | ||
| const recordTwoPopChange = useCallback(() => setRecordTwoPop(!recordTwoPop), [recordTwoPop]); | ||
|
|
||
| switch (selected) { |
Owner
Author
There was a problem hiding this comment.
to control if the toggle itself is is active at all
kylemath
commented
Jan 6, 2020
| // Connect with the Muse EEG Client | ||
| setStatus(generalTranslations.connecting); | ||
| window.source = new MuseClient(); | ||
| window.source.enableAux = window.enableAux; |
Owner
Author
There was a problem hiding this comment.
to get extra channel from muse-js
kylemath
commented
Jan 6, 2020
| } | ||
|
|
||
| function renderCharts() { | ||
| function renderModules() { |
Owner
Author
There was a problem hiding this comment.
name fix unrelated to this pr
kylemath
commented
Jan 6, 2020
| label="Enable Muse Auxillary Channel" | ||
| checked={checked} | ||
| onChange={handleChange} | ||
| disabled={!showAux || status !== generalTranslations.connect} |
kylemath
commented
Jan 6, 2020
| @@ -1,3 +1,5 @@ | |||
| import { customCount } from './chartUtils' | |||
Owner
Author
There was a problem hiding this comment.
this now exports 4 or 5 channels depending on settings
…o to other module it doesnt crash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)