public void FftParamsTests() { // expected values for inputs uint numFftBins = 64; uint numValidFftBins = 44; uint numValidFftBinsLastSeg = 18; uint numFfts = 43750; List <double> centerFrequencies = new List <double>(); List <double> frequencies = new List <double>(); SensorDriver sensor = new SensorDriver(config.PreselectorIp, config.SensorHostName); SweepParams measParams; string json = File.ReadAllText(Constants.Spn43CalSweepParamsFile); measParams = new System.Web.Script.Serialization. JavaScriptSerializer().Deserialize <SweepParams>( json); FFTParams fftParams = new FFTParams(sensor.SensorCapabilities, measParams, sensor.PossibleSampleRates, sensor.PossibleSpans); Assert.IsTrue(fftParams.NumFftBins == numFftBins); Assert.IsTrue(fftParams.NumValidFftBins == numValidFftBins); Assert.IsTrue(fftParams.NumBinsLastSegment == numValidFftBinsLastSeg); GetListOfValuesFromCsv(centerFrequencies, Constants.CenterFrequencyValues); GetListOfValuesFromCsv(frequencies, Constants.FrequeencyValues); Assert.IsTrue(centerFrequencies.SequenceEqual( fftParams.CenterFrequencies)); Assert.IsTrue(frequencies.SequenceEqual( fftParams.FrequencyList)); }
protected Sensor(int port) : base(SensorDriver.GetSensorFolder(port)) { value0 = new ClassProperty(Folder, "value0"); SensorDriver.Register(this); }