void _experiment_Baseline(object sender, EventArgs e) { BaselineEventArgs baseLine = (BaselineEventArgs)e; string filename1 = "..\\" + _currentUser + Path.GetFileName(baseLine.BaselineFile) + "_Baseline_Shimmer1.csv"; string filename2 = "..\\" + _currentUser + Path.GetFileName(baseLine.BaselineFile) + "_Baseline_Shimmer2.csv"; try { _writeToFileShimmer1 = new Logging(filename1, _delimeter); _writeToFileShimmer2 = new Logging(filename2, _delimeter); } catch (Exception ex) { MessageBox.Show(ex.Message, Control.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning); throw; } ////ECG-HR Conversion if (_enableECGtoHRConversion) { ECGtoHR = new ECGToHR(ShimmerDevice1.GetSamplingRate(), TrainingPeriodECG, NumberOfHeartBeatsToAverageECG); } ExGLeadOffCounter = 0; ExGLeadOffCounterSize = (int)ShimmerDevice1.GetSamplingRate(); ShimmerIdSetup.Clear(); ShimmerDevice1.StartStreaming(); ShimmerDevice2.StartStreaming(); _writeBaseLineData = true; }
void _experiment_NewTrack(object sender, EventArgs e) { AudioFileEventArgs audioTrack = (AudioFileEventArgs)e; try { // create new AVI file and open it //string writerfile = "..\\" + _currentUser + ".avi" //_writer.FrameRate = 17; _writer.Open("..\\" + _currentUser + Path.GetFileName(audioTrack.AudioFile) + ".avi", _videoSource.VideoResolution.FrameSize.Width, _videoSource.VideoResolution.FrameSize.Height); } catch (Exception exp) { MessageBox.Show(exp.Message, Control.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning); throw; } string filename1 = "..\\" + _currentUser + Path.GetFileName(audioTrack.AudioFile) + "_Shimmer1.csv"; string filename2 = "..\\" + _currentUser + Path.GetFileName(audioTrack.AudioFile) + "_Shimmer2.csv"; try { _writeToFileShimmer1 = new Logging(filename1, _delimeter); _writeToFileShimmer2 = new Logging(filename2, _delimeter); } catch (Exception ex) { MessageBox.Show(ex.Message, Control.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning); throw; } ////ECG-HR Conversion if (_enableECGtoHRConversion) { ECGtoHR = new ECGToHR(ShimmerDevice1.GetSamplingRate(), TrainingPeriodECG, NumberOfHeartBeatsToAverageECG); } ExGLeadOffCounter = 0; ExGLeadOffCounterSize = (int)ShimmerDevice1.GetSamplingRate(); ShimmerIdSetup.Clear(); ShimmerDevice1.StartStreaming(); ShimmerDevice2.StartStreaming(); _writeData = true; }
private void buttonStreamShimmer2_Click(object sender, EventArgs e) { buttonStreamShimmer2.Enabled = false; buttonStopShimmer2.Enabled = true; _firstTimeShimmer2 = true; //SetupFilters(); ////ECG-HR Conversion if (_enableECGtoHRConversion) { ECGtoHR = new ECGToHR(ShimmerDevice2.GetSamplingRate(), TrainingPeriodECG, NumberOfHeartBeatsToAverageECG); } ExGLeadOffCounter = 0; ExGLeadOffCounterSize = (int)ShimmerDevice2.GetSamplingRate(); ShimmerIdSetup.Clear(); ShimmerDevice2.StartStreaming(); }