Added clearing to the plasma underlay display.

half-duplex
Elliott Liggett 2022-12-02 12:38:08 -08:00
rodzic 9367d605f4
commit 8cfb3f70e5
1 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -3903,10 +3903,12 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
// TODO: create non-button function to do this
// This will break if the button is ever moved or renamed.
on_clearPeakBtn_clicked();
} else {
plasmaPrepared = false;
preparePlasma();
}
// Inform other threads (cluster) that the frequency range has changed.
emit setFrequencyRange(startFreq, endFreq);
// TODO: Add clear-out for the buffer
}
oldLowerFreq = startFreq;
@ -3949,8 +3951,10 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
}
plasmaMutex.lock();
spectrumPlasma.push_front(spectrum);
spectrumPlasma.pop_back();
//spectrumPlasma.resize(spectrumPlasmaSize);
if(spectrumPlasma.size() > (int)spectrumPlasmaSize)
{
spectrumPlasma.pop_back();
}
plasmaMutex.unlock();
@ -4065,10 +4069,13 @@ void wfmain::preparePlasma()
plasmaMutex.lock();
spectrumPlasma.clear();
for(unsigned int p=0; p < spectrumPlasmaSize; p++)
{
spectrumPlasma.append(empty);
}
// spectrumPlasma.append(empty);
// It may be possible to skip this.
// for(unsigned int p=0; p < spectrumPlasmaSize; p++)
// {
// spectrumPlasma.append(empty);
// }
spectrumPlasma.squeeze();
plasmaMutex.unlock();