Removed issue with plasma buffer resizing with the waterfall.

monitor
Elliott Liggett 2022-08-18 10:54:54 -07:00
rodzic 7093ac104a
commit c59050e632
2 zmienionych plików z 25 dodań i 12 usunięć

Wyświetl plik

@ -1079,7 +1079,7 @@ void wfmain::setUIToPrefs()
ui->wfLengthSlider->setValue(prefs.wflength);
prepareWf(prefs.wflength);
preparePlasma();
ui->topLevelSlider->setValue(prefs.plotCeiling);
ui->botLevelSlider->setValue(prefs.plotFloor);
@ -2079,17 +2079,6 @@ void wfmain::prepareWf(unsigned int wfLength)
QByteArray empty((int)spectWidth, '\x01');
spectrumPeaks = QByteArray( (int)spectWidth, '\x01' );
if(spectrumPlasmaSize == 0)
spectrumPlasmaSize = 128;
//spectrumPlasma.resize(spectrumPlasmaSize);
for(unsigned int p=0; p < spectrumPlasmaSize; p++)
{
spectrumPlasma.append(empty);
}
//wfimage.resize(wfLengthMax);
if((unsigned int)wfimage.size() < wfLengthMax)
{
unsigned int i=0;
@ -3646,6 +3635,28 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
}
}
void wfmain::preparePlasma()
{
if(plasmaPrepared)
return;
QByteArray empty((int)spectWidth, '\x01');
if(spectrumPlasmaSize == 0)
spectrumPlasmaSize = 128;
plasmaMutex.lock();
spectrumPlasma.clear();
for(unsigned int p=0; p < spectrumPlasmaSize; p++)
{
spectrumPlasma.append(empty);
}
spectrumPlasma.squeeze();
plasmaMutex.unlock();
plasmaPrepared = true;
}
void wfmain::computePlasma()
{
plasmaMutex.lock();

Wyświetl plik

@ -573,6 +573,8 @@ private:
void setPlotTheme(QCustomPlot *plot, bool isDark);
void prepareWf();
void prepareWf(unsigned int wfLength);
void preparePlasma();
bool plasmaPrepared = false;
void computePlasma();
void showHideSpectrum(bool show);
void getInitialRigState();