Skip to content

Commit 82b2040

Browse files
committed
Code refactoring: SpectrumForImport renamed to SpectrumForComparison
1 parent 3208711 commit 82b2040

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/graph_spectrum.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
2222
analyserZoomY = 1.0 /* 100% */,
2323
dataReload = false,
2424
fftData = null,
25-
addSpectrumToImport = false;
25+
addSpectrumForComparison = false;
2626

2727
try {
2828
let isFullscreen = false;
@@ -48,9 +48,9 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
4848
that.resize();
4949
};
5050

51-
this.prepareSpectrumForImport = function () {
51+
this.prepareSpectrumForComparison = function () {
5252
if (userSettings.spectrumType === SPECTRUM_TYPE.POWER_SPECTRAL_DENSITY) {
53-
addSpectrumToImport = true;
53+
addSpectrumForComparison = true;
5454
}
5555
};
5656

@@ -164,7 +164,7 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
164164
};
165165

166166
this.shouldAddCurrentSpectrumBeforeReload = function () {
167-
return addSpectrumToImport && fftData != null && !this.isMultiSpectrum() && !dataReload;
167+
return addSpectrumForComparison && fftData != null && !this.isMultiSpectrum() && !dataReload;
168168
};
169169

170170
/* This function is called from the canvas drawing routines within grapher.js
@@ -177,9 +177,9 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
177177
fieldIndex != fftData.fieldIndex && !isMaxCountOfImportedPSD || // Lock spectrum data reload while PSD curves import is full
178178
dataReload;
179179

180-
if (addSpectrumToImport && !GraphSpectrumPlot.isNewComparedCurve(fieldName)) {
180+
if (addSpectrumForComparison && !GraphSpectrumPlot.isNewComparedCurve(fieldName)) {
181181
GraphSpectrumPlot.removeComparedCurve(fieldName);
182-
addSpectrumToImport = false;
182+
addSpectrumForComparison = false;
183183
shouldReload = false; // Do not load if spectrum was deleted
184184
}
185185

@@ -191,9 +191,9 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
191191
dataLoad(fieldIndex, curve, fieldName);
192192
GraphSpectrumPlot.setData(fftData, userSettings.spectrumType);
193193
}
194-
if (addSpectrumToImport) {
194+
if (addSpectrumForComparison) {
195195
GraphSpectrumPlot.addCurrentSpectrumIntoImport();
196-
addSpectrumToImport = false;
196+
addSpectrumForComparison = false;
197197
}
198198
that.draw(); // draw the analyser on the canvas....
199199
};

src/grapher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ export function FlightLogGrapher(
12431243
this.setDrawAnalyser = function (state, ctrlKey = false) {
12441244
if (state) {
12451245
if (ctrlKey) {
1246-
analyser.prepareSpectrumForImport();
1246+
analyser.prepareSpectrumForComparison();
12471247
} else if (this.hasMultiSpectrumAnalyser()) {
12481248
analyser.removeImportedSpectrums(); // Remove imported spectrums by simple mouse click at the any curves legend
12491249
}

0 commit comments

Comments
 (0)