-
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
Created record timer for each page in seconds, using a slider beside the button to pick time #120
Conversation
completes the issue in #80 |
@@ -349,35 +349,35 @@ export function PageSwitcher() { | |||
return null | |||
case heartSpectra: | |||
return ( | |||
funHeartSpectra.renderRecord(recordPopChange, recordPop, status, heartSpectraSettings) | |||
funHeartSpectra.renderRecord(recordPopChange, recordPop, status, heartSpectraSettings, setHeartSpectraSettings) |
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.
so the record button can modify settings where this is kept
@@ -3,8 +3,8 @@ import { catchError, multicast } from "rxjs/operators"; | |||
|
|||
import { TextContainer, Card, Stack, RangeSlider, Button, ButtonGroup, Modal } from "@shopify/polaris"; | |||
import { saveAs } from 'file-saver'; | |||
import { take } from "rxjs/operators"; | |||
import { Subject } from "rxjs"; | |||
import { take, takeUntil } from "rxjs/operators"; |
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.
takeUntil grabs until a timer is done
export function renderRecord(recordPopChange, recordPop, status, Settings, recordTwoPopChange, recordTwoPop) { | ||
export function renderRecord(recordPopChange, recordPop, status, Settings, recordTwoPopChange, recordTwoPop, setSettings) { | ||
|
||
function handleSecondsToSaveRangeSliderChange(value) { |
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 new slider
return( | ||
<Card title={'Record ' + Settings.name +' Data'} sectioned> | ||
<Stack> | ||
<RangeSlider |
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.
new slider
@@ -346,9 +359,13 @@ function saveToCSV(Settings, condition) { | |||
); | |||
} | |||
}); | |||
|
|||
// setup timer |
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.
create timer
// put selected observable object into local and start taking samples | ||
localObservable$ = window.multicastAlpha$.pipe( | ||
take(numSamplesToSave) | ||
takeUntil(timer$) |
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.
take until timer is over
@@ -3,8 +3,8 @@ import { catchError, multicast } from "rxjs/operators"; | |||
|
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.
and same for the rest of the modules
tested on each module and works great