private void SetSecondlstdata() { int nWaveOffset; int nFftPtNum = 1024; int nWindowType; float fCalOffset; int nExpPara; int nClearDc = 1; int nSpectrumType; int nAverageType; int nCascadePercent; List <float> SpecData = null; iscalculating = false; nWaveOffset = Convert.ToInt32(WaveOffset.Text); switch (this.FftPtNum.SelectedIndex) { case 0: nFftPtNum = 256; break; case 1: nFftPtNum = 512; break; case 2: nFftPtNum = 1024; break; } nWindowType = this.WindowType.SelectedIndex; fCalOffset = Convert.ToInt32(CalOffset.Value); nExpPara = Convert.ToInt32(this.ExpPara.Value); if (!this.ClearDc.Checked) { nClearDc = 0; } nSpectrumType = this.SpectrumType.SelectedIndex; nAverageType = this.AverageType.SelectedIndex;; nCascadePercent = Convert.ToInt32(this.CascadePercent.Value);; if (DaspSDK.DaspAutoSpectrum(indata, nWaveOffset, nWavePtNum, nFftPtNum, nWindowType, Convert.ToSingle(CalCv.Text), Convert.ToSingle(WaveSf.Text), fCalOffset, nExpPara, nClearDc, nSpectrumType, nAverageType, nCascadePercent, out SpecData)) { iscalculating = true; cmplst[1] = SpecData; } }
private List <float> GetSprectData(List <float> indata) { List <float> SpecData = null; bool rc = false; rc = DaspSDK.DaspAutoSpectrum(indata, spepara.nWaveOffset, spepara.nWavePtNum, spepara.nFftPtNum, spepara.nWindowType, spepara.fCalCv, spepara.fWaveSf, spepara.fCalOffset, spepara.nExpPara, spepara.nClearDc, spepara.nSpectrumType, spepara.nAverageType, spepara.nCascadePercent, out SpecData); if (rc) { } else { SpecData = null; } return(SpecData); }
private void btnCal_Click(object sender, EventArgs e) { List <float> SpecData = null; iscalculating = false; spe.fCalCv = Convert.ToSingle(CalCv.Text); spe.fWaveSf = Convert.ToSingle(WaveSf.Text);; spe.nWavePtNum = Convert.ToInt32(WavePtNum.Text); spe.nWaveOffset = Convert.ToInt32(WaveOffset.Text); switch (this.FftPtNum.SelectedIndex) { case 0: spe.nFftPtNum = 256; break; case 1: spe.nFftPtNum = 512; break; case 2: spe.nFftPtNum = 1024; break; } spe.nWindowType = this.WindowType.SelectedIndex; spe.fCalOffset = Convert.ToInt32(CalOffset.Value); spe.nExpPara = Convert.ToInt32(this.ExpPara.Value); if (!this.ClearDc.Checked) { spe.nClearDc = 0; } spe.nSpectrumType = this.SpectrumType.SelectedIndex; spe.nAverageType = this.AverageType.SelectedIndex;; spe.nCascadePercent = Convert.ToInt32(this.CascadePercent.Value);; if (DaspSDK.DaspAutoSpectrum(indata, spe.nWaveOffset, spe.nWavePtNum, spe.nFftPtNum, spe.nWindowType, spe.fCalCv, spe.fWaveSf, spe.fCalOffset, spe.nExpPara, spe.nClearDc, spe.nSpectrumType, spe.nAverageType, spe.nCascadePercent, out SpecData)) { iscalculating = true; cmplst[0] = SpecData; } }