private void UpdateChanelBChart(PM2WaveForm.PlottableData data) { ChanelBWave.Series["Series1"].Points.Clear(); for (int i = 0; i < data.WaveFormData.amp.Length; i++) { ChanelBWave.Series["Series1"].Points.AddXY(data.WaveFormData.time[i] / 1e6, data.WaveFormData.amp[i]); // time in us } }
private void WaveFormTimer_Tick(object sender, EventArgs e) { totalSW.Restart(); int SampleCount = _sampleCount; Stopwatch sw = new Stopwatch(); // ReInitProcessTimes(); // determine if we shuold get chanel B data sw.Start(); plottableData = pM2WaveForm.GetPlottableData(handle, channelSettings, fftSettings, lastfft, ref processTimes, ref WaveFormTimer, SampleCount, false); sw.Stop(); fftSettings.isFftStyleChange = false; sw.Restart(); UpdateWaveCharts(); sw.Stop(); processTimes.wavePlottingTime = sw.Elapsed; if (IsPm2fdFreqRangeChanged() & !TrimFftCheckBox.Checked) { UpdateTrimTextBox(); } TimeDomainPlottingTimeLabel.Text = "Time Domain Plotting (ms) = " + Convert.ToString(processTimes.wavePlottingTime.Milliseconds); DataSamplingTimeLabel.Text = "Data Sampling (ms) = " + Convert.ToString(processTimes.samplingTime.Milliseconds); FftTimeLabel.Text = "FFT (ms) = " + Convert.ToString(processTimes.fftTime.Milliseconds); totalSW.Stop(); if (isPicoPortOpen) { // send message with the frequecy to the pizzo picoPort.Write($"p{WaveFormTimer.Interval}"); } }
private void ChanelBTimer_Tick(object sender, EventArgs e) { totalSW.Start(); int SampleCount = _sampleCount; Stopwatch sw = new Stopwatch(); var chanelBData = new PM2WaveForm.PlottableData(); sw.Start(); chanelBData = pM2WaveForm.GetPlottableData(handle, channelSettings, fftSettings, lastfft, ref processTimes, ref WaveFormTimer, SampleCount, true); sw.Stop(); sw.Restart(); UpdateChanelBChart(chanelBData); sw.Stop(); processTimes.chanelBPlottingTime = sw.Elapsed; TimeDomainPlottingTimeLabel.Text = "Time Domain Plotting (ms) = " + Convert.ToString(processTimes.wavePlottingTime.Milliseconds); DataSamplingTimeLabel.Text = "Data Sampling (ms) = " + Convert.ToString(processTimes.samplingTime.Milliseconds); FftTimeLabel.Text = "FFT (ms) = " + Convert.ToString(processTimes.fftTime.Milliseconds); totalSW.Stop(); }