Skip to content
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

Merged
merged 3 commits into from
Jan 14, 2020

Conversation

kylemath
Copy link
Owner

tested on each module and works great

@kylemath
Copy link
Owner Author

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)
Copy link
Owner Author

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";
Copy link
Owner Author

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) {
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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$)
Copy link
Owner Author

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";

Copy link
Owner Author

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

@kylemath kylemath merged commit 11663c6 into master Jan 14, 2020
@kylemath kylemath deleted the rawTimer branch January 14, 2020 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant