private void advancedButton_Click(object sender, EventArgs e) { var options = new BiofeedbackSettingsForm(); options.Settings = Settings; if (options.ShowDialog() == DialogResult.OK) { Settings = options.Settings; } }
public void Start(IChannel channel, IHeartRateMonitor hrm, BiofeedbackSettings settings, Action <Biofeedback.Sample[]> finished) { if (channel is null) { throw new ArgumentException(nameof(channel)); } if (hrm is null) { throw new ArgumentException(nameof(hrm)); } finishedAction = finished; bf = new Biofeedback(); if (channel is null) { throw new ArgumentException("Couldn't open a channel"); } source = new HrmSource(hrm); bf.Enqueue(settings.MinFrequency, settings.MaxFrequency, settings.StepSize); int frequencySteps = bf.TotalSteps; heatmapControl.NumberOfPoints = frequencySteps; heatmapControl.MinX = settings.MinFrequency; heatmapControl.MaxX = settings.MaxFrequency; statusLabel.Text = "Running"; pauseButton.Text = "Pause"; biofeedback = new Biofeedback(); biofeedback.Enqueue(settings.MinFrequency, settings.MaxFrequency, settings.StepSize); runner = new BackgroundRunner(); biofeedback.Source = source; biofeedback.OnProgress += new Biofeedback.Progress((f, r, s, t) => BeginInvoke(new Biofeedback.Progress(OnProgress), f, r, s, t)); biofeedback.OnFinished += new Biofeedback.Finished(r => BeginInvoke(new Biofeedback.Finished(OnFinished), new object[] { r })); runner.Progress += new ProgressChanged((s, t, w, a, e) => BeginInvoke(new ProgressChanged(OnGeneratorProgress), s, t, w, a, e)); var options = new RunningOptions(); runner.Start(biofeedback, channel, options); }
public BiofeedbackOptionsPage() { InitializeComponent(); Settings = new BiofeedbackSettings(); }