Skip to content

Commit 3639e69

Browse files
authored
Added missing slices of data samples arrays in spectrum calc (#819)
1 parent 58ccb0b commit 3639e69

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/graph_spectrum_calc.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ GraphSpectrumCalc._dataLoadFrequencyVsX = function(vsFieldNames, minValue = Infi
178178
// blur algorithm to the heat map image
179179

180180
const fftData = {
181-
fieldIndex : this._dataBuffer.fieldIndex,
182-
fieldName : this._dataBuffer.fieldName,
183-
fftLength : fftChunkLength,
184-
fftOutput : matrixFftOutput,
185-
maxNoise : maxNoise,
186-
blackBoxRate : this._blackBoxRate,
187-
vsRange : { min: flightSamples.minValue, max: flightSamples.maxValue},
181+
fieldIndex : this._dataBuffer.fieldIndex,
182+
fieldName : this._dataBuffer.fieldName,
183+
fftLength : fftChunkLength,
184+
fftOutput : matrixFftOutput,
185+
maxNoise : maxNoise,
186+
blackBoxRate : this._blackBoxRate,
187+
vsRange : { min: flightSamples.minValue, max: flightSamples.maxValue},
188188
};
189189

190190
return fftData;
@@ -299,7 +299,7 @@ GraphSpectrumCalc._getFlightSamplesFreq = function() {
299299
}
300300

301301
return {
302-
samples : samples,
302+
samples : samples.slice(0, samplesCount),
303303
count : samplesCount,
304304
};
305305
};
@@ -379,13 +379,14 @@ GraphSpectrumCalc._getFlightSamplesFreqVsX = function(vsFieldNames, minValue = I
379379
for (const vsValueArray of vsValues) {
380380
slicedVsValues.push(vsValueArray.slice(0, samplesCount));
381381
}
382+
382383
return {
383-
samples : samples.slice(0, samplesCount),
384-
vsValues : slicedVsValues,
385-
count : samplesCount,
386-
minValue : minValue,
387-
maxValue : maxValue,
388-
};
384+
samples : samples.slice(0, samplesCount),
385+
vsValues : slicedVsValues,
386+
count : samplesCount,
387+
minValue : minValue,
388+
maxValue : maxValue,
389+
};
389390
};
390391

391392
GraphSpectrumCalc._getFlightSamplesPidErrorVsSetpoint = function(axisIndex) {
@@ -414,8 +415,8 @@ GraphSpectrumCalc._getFlightSamplesPidErrorVsSetpoint = function(axisIndex) {
414415
}
415416

416417
return {
417-
piderror,
418-
setpoint,
418+
piderror: piderror.slice(0, samplesCount),
419+
setpoint: setpoint.slice(0, samplesCount),
419420
maxSetpoint,
420421
count: samplesCount,
421422
};

0 commit comments

Comments
 (0)