2 #include <QColorDialog>
4 #include <spectrumdisplayform.h>
6 int SpectrumDisplayForm::_openGLWaterfall3DFlag = -1;
8 SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) : QDialog(parent){
11 _systemSpecifiedFlag = false;
12 _intValidator = new QIntValidator(this);
13 _intValidator->setBottom(0);
14 _frequencyDisplayPlot = new FrequencyDisplayPlot(Tab1PlotDisplayFrame);
15 _waterfallDisplayPlot = new WaterfallDisplayPlot(Tab2PlotDisplayFrame);
16 _waterfall3DDisplayPlot = new Waterfall3DDisplayPlot(Waterfall3DPlotDisplayFrame);
17 _timeDomainDisplayPlot = new TimeDomainDisplayPlot(TimeDomainDisplayFrame);
18 _numRealDataPoints = 1024;
19 _realFFTDataPoints = new double[_numRealDataPoints];
20 _averagedValues = new double[_numRealDataPoints];
21 _historyVector = new std::vector<double*>;
23 AvgLineEdit->setValidator(_intValidator);
24 PowerLineEdit->setValidator(_intValidator);
25 MinHoldCheckBox_toggled( false );
26 MaxHoldCheckBox_toggled( false );
28 WaterfallMaximumIntensityWheel->setRange(-200, 0);
29 WaterfallMaximumIntensityWheel->setTickCnt(50);
30 WaterfallMinimumIntensityWheel->setRange(-200, 0);
31 WaterfallMinimumIntensityWheel->setTickCnt(50);
32 WaterfallMinimumIntensityWheel->setValue(-200);
34 Waterfall3DMaximumIntensityWheel->setRange(-200, 0);
35 Waterfall3DMaximumIntensityWheel->setTickCnt(50);
36 Waterfall3DMinimumIntensityWheel->setRange(-200, 0);
37 Waterfall3DMinimumIntensityWheel->setTickCnt(50);
38 Waterfall3DMinimumIntensityWheel->setValue(-200);
41 _peakAmplitude = -HUGE_VAL;
43 _noiseFloorAmplitude = -HUGE_VAL;
45 connect(_waterfallDisplayPlot, SIGNAL(UpdatedLowerIntensityLevel(const double)), _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double)));
46 connect(_waterfallDisplayPlot, SIGNAL(UpdatedUpperIntensityLevel(const double)), _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double)));
48 _frequencyDisplayPlot->SetLowerIntensityLevel(-200);
49 _frequencyDisplayPlot->SetUpperIntensityLevel(-200);
51 // Load up the acceptable FFT sizes...
52 FFTSizeComboBox->clear();
53 for(long fftSize = SpectrumGUIClass::MIN_FFT_SIZE; fftSize <= SpectrumGUIClass::MAX_FFT_SIZE; fftSize *= 2){
54 FFTSizeComboBox->insertItem(FFTSizeComboBox->count(), QString("%1").arg(fftSize));
59 SpectrumDisplayForm::~SpectrumDisplayForm(){
60 // Qt deletes children when parent is deleted
62 // Don't worry about deleting Display Plots - they are deleted when parents are deleted
63 /* delete _intValidator; */
65 delete[] _realFFTDataPoints;
66 delete[] _averagedValues;
68 for(unsigned int count = 0; count < _historyVector->size(); count++){
69 delete[] _historyVector->operator[](count);
72 delete _historyVector;
75 void SpectrumDisplayForm::setSystem( SpectrumGUIClass * newSystem, const uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints )
77 ResizeBuffers(numFFTDataPoints, numTimeDomainDataPoints);
79 if(newSystem != NULL){
81 _systemSpecifiedFlag = true;
84 _systemSpecifiedFlag = false;
88 void SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdateEvent)
90 const std::complex<float>* complexDataPoints = spectrumUpdateEvent->getFFTPoints();
91 const uint64_t numFFTDataPoints = spectrumUpdateEvent->getNumFFTDataPoints();
92 const double* realTimeDomainDataPoints = spectrumUpdateEvent->getRealTimeDomainPoints();
93 const double* imagTimeDomainDataPoints = spectrumUpdateEvent->getImagTimeDomainPoints();
94 const uint64_t numTimeDomainDataPoints = spectrumUpdateEvent->getNumTimeDomainDataPoints();
95 const double timePerFFT = spectrumUpdateEvent->getTimePerFFT();
96 const timespec dataTimestamp = spectrumUpdateEvent->getDataTimestamp();;
97 const bool repeatDataFlag = spectrumUpdateEvent->getRepeatDataFlag();
98 const bool lastOfMultipleUpdatesFlag = spectrumUpdateEvent->getLastOfMultipleUpdateFlag();
99 const timespec generatedTimestamp = spectrumUpdateEvent->getEventGeneratedTimestamp();
101 // REMEMBER: The dataTimestamp is NOT valid when the repeat data flag is true...
102 ResizeBuffers(numFFTDataPoints, numTimeDomainDataPoints);
104 // Calculate the Magnitude of the complex point
105 const std::complex<float>* complexDataPointsPtr = complexDataPoints;
106 double* realFFTDataPointsPtr = _realFFTDataPoints;
107 for(uint64_t point = 0; point < numFFTDataPoints; point++){
109 // 50 ohm load assumption
110 // 10 * log10 (v^2 / (2 * 50.0 * .001)) = 10 * log10( v^2 * 10)
111 // 75 ohm load assumption
112 // 10 * log10 (v^2 / (2 * 75.0 * .001)) = 10 * log10( v^2 * 15)
114 *realFFTDataPointsPtr = 10.0*log10((((*complexDataPointsPtr).real() * (*complexDataPointsPtr).real()) + ((*complexDataPointsPtr).imag()*(*complexDataPointsPtr).imag())) + 1e-20);
116 complexDataPointsPtr++;
117 realFFTDataPointsPtr++;
121 // Don't update the averaging history if this is repeated data
123 _AverageHistory(_realFFTDataPoints);
126 const double fft_bin_size = (_stopFrequency-_startFrequency) / static_cast<double>(numFFTDataPoints);
128 // find the peak, sum (for mean), etc
129 _peakAmplitude = -HUGE_VAL;
131 for(uint64_t number = 0; number < numFFTDataPoints; number++){
133 if(_realFFTDataPoints[number] > _peakAmplitude){
134 _peakFrequency = (static_cast<float>(number) * fft_bin_size); // Calculate the frequency relative to the local bw, adjust for _startFrequency later
135 _peakAmplitude = _realFFTDataPoints[number];
136 // _peakBin = number;
139 sumMean += _realFFTDataPoints[number];
142 // calculate the spectral mean
143 // +20 because for the comparison below we only want to throw out bins
144 // that are significantly higher (and would, thus, affect the mean more)
145 const double meanAmplitude = (sumMean / numFFTDataPoints) + 20.0;
147 // now throw out any bins higher than the mean
149 uint64_t newNumDataPoints = numFFTDataPoints;
150 for(uint64_t number = 0; number < numFFTDataPoints; number++){
151 if (_realFFTDataPoints[number] <= meanAmplitude)
152 sumMean += _realFFTDataPoints[number];
157 if (newNumDataPoints == 0) // in the odd case that all
158 _noiseFloorAmplitude = meanAmplitude; // amplitudes are equal!
160 _noiseFloorAmplitude = sumMean / newNumDataPoints;
163 if(lastOfMultipleUpdatesFlag){
164 _frequencyDisplayPlot->PlotNewData(_averagedValues, numFFTDataPoints, _noiseFloorAmplitude, _peakFrequency, _peakAmplitude);
165 _timeDomainDisplayPlot->PlotNewData(realTimeDomainDataPoints, imagTimeDomainDataPoints, numTimeDomainDataPoints);
167 // Don't update the repeated data for the waterfall
169 _waterfallDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints, timePerFFT, dataTimestamp, spectrumUpdateEvent->getDroppedFFTFrames());
170 if( _openGLWaterfall3DFlag == 1 ){
171 _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints, timePerFFT, dataTimestamp, spectrumUpdateEvent->getDroppedFFTFrames());
175 // Tell the system the GUI has been updated
176 if(_systemSpecifiedFlag){
177 _system->SetLastGUIUpdateTime(generatedTimestamp);
178 _system->DecrementPendingGUIUpdateEvents();
182 void SpectrumDisplayForm::resizeEvent( QResizeEvent *e )
184 // Let the actual window resize its width, but not its height
185 QSize newSize(e->size().width(), e->oldSize().height());
186 QResizeEvent et(newSize, e->oldSize());
187 QWidget::resizeEvent(&et);
189 // Tell the Tab Window to Resize
190 SpectrumTypeTab->resize( e->size().width(), SpectrumTypeTab->height());
192 // Tell the TabXFreqDisplay to resize
193 Tab1PlotDisplayFrame->resize(e->size().width()-4, Tab1PlotDisplayFrame->height());
194 Tab2PlotDisplayFrame->resize(e->size().width()-4, Tab2PlotDisplayFrame->height());
195 Waterfall3DPlotDisplayFrame->resize(e->size().width()-4, Waterfall3DPlotDisplayFrame->height());
196 TimeDomainDisplayFrame->resize(e->size().width()-4, TimeDomainDisplayFrame->height());
197 _frequencyDisplayPlot->resize( Tab1PlotDisplayFrame->width()-4, Tab1PlotDisplayFrame->height());
198 _waterfallDisplayPlot->resize( Tab2PlotDisplayFrame->width()-4, Tab2PlotDisplayFrame->height());
199 _waterfall3DDisplayPlot->resize( Waterfall3DPlotDisplayFrame->width()-4, Waterfall3DPlotDisplayFrame->height());
200 _timeDomainDisplayPlot->resize( TimeDomainDisplayFrame->width()-4, TimeDomainDisplayFrame->height());
202 // Move the IntensityWheels and Labels
203 WaterfallMaximumIntensityLabel->move(width() - 5 - WaterfallMaximumIntensityLabel->width(), WaterfallMaximumIntensityLabel->y());
204 WaterfallMinimumIntensityLabel->move(width() - 5 - WaterfallMinimumIntensityLabel->width(), WaterfallMinimumIntensityLabel->y());
205 WaterfallMaximumIntensityWheel->resize(WaterfallMaximumIntensityLabel->x() - 5 - WaterfallMaximumIntensityWheel->x(), WaterfallMaximumIntensityWheel->height());
206 WaterfallMinimumIntensityWheel->resize(WaterfallMinimumIntensityLabel->x() - 5 - WaterfallMinimumIntensityWheel->x(), WaterfallMinimumIntensityWheel->height());
208 Waterfall3DMaximumIntensityLabel->move(width() - 5 - Waterfall3DMaximumIntensityLabel->width(), Waterfall3DMaximumIntensityLabel->y());
209 Waterfall3DMinimumIntensityLabel->move(width() - 5 - Waterfall3DMinimumIntensityLabel->width(), Waterfall3DMinimumIntensityLabel->y());
210 Waterfall3DMaximumIntensityWheel->resize(Waterfall3DMaximumIntensityLabel->x() - 5 - Waterfall3DMaximumIntensityWheel->x(), Waterfall3DMaximumIntensityWheel->height());
211 Waterfall3DMinimumIntensityWheel->resize(Waterfall3DMinimumIntensityLabel->x() - 5 - Waterfall3DMinimumIntensityWheel->x(), Waterfall3DMinimumIntensityWheel->height());
214 // Move the Power Lbl
215 PowerLabel->move(e->size().width()-(415-324) - PowerLabel->width(), PowerLabel->y());
217 // Move the Power Line Edit
218 PowerLineEdit->move(e->size().width()-(415-318) - PowerLineEdit->width(), PowerLineEdit->y());
221 AvgLabel->move(e->size().width()-(415-406) - AvgLabel->width(), AvgLabel->y());
223 // Move the Avg Line Edit
224 AvgLineEdit->move(e->size().width()-(415-400) - AvgLineEdit->width(), AvgLineEdit->y());
226 // Move the FFT Size Combobox and label
227 FFTSizeComboBox->move(width() - 5 - FFTSizeComboBox->width(), FFTSizeComboBox->y());
228 FFTSizeLabel->move(width() - 10 - FFTSizeComboBox->width() - FFTSizeLabel->width(), FFTSizeLabel->y());
232 void SpectrumDisplayForm::customEvent( QEvent * e)
234 if(e->type() == QEvent::User+3){
235 if(_systemSpecifiedFlag){
236 WindowComboBox->setCurrentIndex(_system->GetWindowType());
237 FFTSizeComboBox->setCurrentIndex(_system->GetFFTSizeIndex());
238 //FFTSizeComboBox->setCurrentIndex(1);
239 PowerLineEdit_textChanged(PowerLineEdit->text());
242 waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value());
243 waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value());
245 waterfall3DMinimumIntensityChangedCB(Waterfall3DMinimumIntensityWheel->value());
246 waterfall3DMaximumIntensityChangedCB(Waterfall3DMaximumIntensityWheel->value());
248 // If the video card doesn't support OpenGL then don't display the 3D Waterfall
249 if(QGLFormat::hasOpenGL()){
250 // Check for Hardware Acceleration of the OpenGL
251 if(!_waterfall3DDisplayPlot->format().directRendering()){
252 // Only ask this once while the program is running...
253 if(_openGLWaterfall3DFlag == -1){
254 _openGLWaterfall3DFlag = 0;
255 if(QMessageBox::warning(this, "OpenGL Direct Rendering NOT Supported", "<center>The system's video card hardware or current drivers do not support direct hardware rendering of the OpenGL modules.</center><br><center>Software rendering is VERY processor intensive.</center><br><center>Do you want to use software rendering?</center>", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape) == QMessageBox::Yes){
256 _openGLWaterfall3DFlag = 1;
261 _openGLWaterfall3DFlag = 1;
265 if(_openGLWaterfall3DFlag != 1){
266 SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(Waterfall3DPage));
269 // Clear any previous display
274 else if(e->type() == 10005){
275 SpectrumUpdateEvent* spectrumUpdateEvent = (SpectrumUpdateEvent*)e;
276 newFrequencyData(spectrumUpdateEvent);
278 else if(e->type() == 10008){
279 setWindowTitle(((SpectrumWindowCaptionEvent*)e)->getLabel());
281 else if(e->type() == 10009){
283 if(_systemSpecifiedFlag){
284 _system->ResetPendingGUIUpdateEvents();
287 else if(e->type() == 10010){
288 _startFrequency = ((SpectrumFrequencyRangeEvent*)e)->GetStartFrequency();
289 _stopFrequency = ((SpectrumFrequencyRangeEvent*)e)->GetStopFrequency();
290 _centerFrequency = ((SpectrumFrequencyRangeEvent*)e)->GetCenterFrequency();
292 UseRFFrequenciesCB(UseRFFrequenciesCheckBox->isChecked());
296 void SpectrumDisplayForm::AvgLineEdit_textChanged( const QString &valueString )
298 if(!valueString.isEmpty()){
299 int value = valueString.toInt();
302 AvgLineEdit->setText("500");
304 SetAverageCount(value);
309 void SpectrumDisplayForm::MaxHoldCheckBox_toggled( bool newState )
311 MaxHoldResetBtn->setEnabled(newState);
312 _frequencyDisplayPlot->SetMaxFFTVisible(newState);
313 MaxHoldResetBtn_clicked();
317 void SpectrumDisplayForm::MinHoldCheckBox_toggled( bool newState )
319 MinHoldResetBtn->setEnabled(newState);
320 _frequencyDisplayPlot->SetMinFFTVisible(newState);
321 MinHoldResetBtn_clicked();
325 void SpectrumDisplayForm::MinHoldResetBtn_clicked()
327 _frequencyDisplayPlot->ClearMinData();
328 _frequencyDisplayPlot->replot();
332 void SpectrumDisplayForm::MaxHoldResetBtn_clicked()
334 _frequencyDisplayPlot->ClearMaxData();
335 _frequencyDisplayPlot->replot();
339 void SpectrumDisplayForm::PowerLineEdit_textChanged( const QString &valueString )
341 if(_systemSpecifiedFlag){
342 if(!valueString.isEmpty()){
343 double value = valueString.toDouble();
346 PowerLineEdit->setText("1");
348 _system->SetPowerValue(value);
351 if(_system->GetPowerValue() > 1){
352 UseRFFrequenciesCheckBox->setChecked(false);
353 UseRFFrequenciesCheckBox->setEnabled(false);
354 UseRFFrequenciesCB(false);
357 UseRFFrequenciesCheckBox->setEnabled(true);
362 void SpectrumDisplayForm::SetFrequencyRange(const double newStartFrequency, const double newStopFrequency, const double newCenterFrequency){
363 _frequencyDisplayPlot->SetFrequencyRange(newStartFrequency, newStopFrequency, newCenterFrequency, UseRFFrequenciesCheckBox->isChecked());
364 _waterfallDisplayPlot->SetFrequencyRange(newStartFrequency, newStopFrequency, newCenterFrequency, UseRFFrequenciesCheckBox->isChecked());
365 _waterfall3DDisplayPlot->SetFrequencyRange(newStartFrequency, newStopFrequency, newCenterFrequency, UseRFFrequenciesCheckBox->isChecked());
369 int SpectrumDisplayForm::GetAverageCount(){
370 return _historyVector->size();
373 void SpectrumDisplayForm::SetAverageCount(const int newCount){
375 if(newCount != static_cast<int>(_historyVector->size())){
376 std::vector<double*>::iterator pos;
377 while(newCount < static_cast<int>(_historyVector->size())){
378 pos = _historyVector->begin();
380 _historyVector->erase(pos);
383 while(newCount > static_cast<int>(_historyVector->size())){
384 _historyVector->push_back(new double[_numRealDataPoints]);
391 void SpectrumDisplayForm::_AverageHistory(const double* newBuffer){
392 if(_numRealDataPoints > 0){
393 if(_historyVector->size() > 0){
394 memcpy(_historyVector->operator[](_historyEntry), newBuffer, _numRealDataPoints*sizeof(double));
396 // Increment the next location to store data
397 _historyEntryCount++;
398 if(_historyEntryCount > static_cast<int>(_historyVector->size())){
399 _historyEntryCount = _historyVector->size();
401 _historyEntry = (++_historyEntry)%_historyVector->size();
403 // Total up and then average the values
405 for(uint64_t location = 0; location < _numRealDataPoints; location++){
407 for(int number = 0; number < _historyEntryCount; number++){
408 sum += _historyVector->operator[](number)[location];
410 _averagedValues[location] = sum/static_cast<double>(_historyEntryCount);
414 memcpy(_averagedValues, newBuffer, _numRealDataPoints*sizeof(double));
419 void SpectrumDisplayForm::ResizeBuffers( const uint64_t numFFTDataPoints, const uint64_t /*numTimeDomainDataPoints*/ ){
420 // Convert from Complex to Real for certain Displays
421 if(_numRealDataPoints != numFFTDataPoints){
422 _numRealDataPoints = numFFTDataPoints;
423 delete[] _realFFTDataPoints;
424 delete[] _averagedValues;
426 _realFFTDataPoints = new double[_numRealDataPoints];
427 _averagedValues = new double[_numRealDataPoints];
428 memset(_realFFTDataPoints, 0x0, _numRealDataPoints*sizeof(double));
430 const int historySize = _historyVector->size();
431 SetAverageCount(0); // Clear the existing history
432 SetAverageCount(historySize);
438 void SpectrumDisplayForm::Reset(){
441 _waterfallDisplayPlot->Reset();
442 _waterfall3DDisplayPlot->Reset();
446 void SpectrumDisplayForm::AverageDataReset(){
448 _historyEntryCount = 0;
450 memset(_averagedValues, 0x0, _numRealDataPoints*sizeof(double));
452 MaxHoldResetBtn_clicked();
453 MinHoldResetBtn_clicked();
457 void SpectrumDisplayForm::closeEvent( QCloseEvent *e )
459 if(_systemSpecifiedFlag){
460 _system->SetWindowOpenFlag(false);
463 qApp->processEvents();
465 QWidget::closeEvent(e);
469 void SpectrumDisplayForm::WindowTypeChanged( int newItem )
471 if(_systemSpecifiedFlag){
472 _system->SetWindowType(newItem);
477 void SpectrumDisplayForm::UseRFFrequenciesCB( bool useRFFlag )
480 SetFrequencyRange(_startFrequency, _stopFrequency, _centerFrequency);
483 SetFrequencyRange(_startFrequency, _stopFrequency, 0.0 );
488 void SpectrumDisplayForm::waterfallMaximumIntensityChangedCB( double newValue )
490 if(newValue > WaterfallMinimumIntensityWheel->value()){
491 WaterfallMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
494 WaterfallMaximumIntensityWheel->setValue(WaterfallMinimumIntensityWheel->value());
496 _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value());
500 void SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue )
502 if(newValue < WaterfallMaximumIntensityWheel->value()){
503 WaterfallMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
506 WaterfallMinimumIntensityWheel->setValue(WaterfallMaximumIntensityWheel->value());
508 _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value());
511 void SpectrumDisplayForm::waterfall3DMaximumIntensityChangedCB( double newValue )
513 if(newValue > Waterfall3DMinimumIntensityWheel->value()){
514 Waterfall3DMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
517 Waterfall3DMaximumIntensityWheel->setValue(Waterfall3DMinimumIntensityWheel->value());
519 _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(), Waterfall3DMaximumIntensityWheel->value());
523 void SpectrumDisplayForm::waterfall3DMinimumIntensityChangedCB( double newValue )
525 if(newValue < Waterfall3DMaximumIntensityWheel->value()){
526 Waterfall3DMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
529 Waterfall3DMinimumIntensityWheel->setValue(Waterfall3DMaximumIntensityWheel->value());
531 _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(), Waterfall3DMaximumIntensityWheel->value());
535 void SpectrumDisplayForm::FFTComboBoxSelectedCB( const QString &fftSizeString )
537 if(_systemSpecifiedFlag){
538 _system->SetFFTSize(fftSizeString.toLong());
543 void SpectrumDisplayForm::WaterfallAutoScaleBtnCB()
545 double minimumIntensity = _noiseFloorAmplitude - 5;
546 if(minimumIntensity < WaterfallMinimumIntensityWheel->minValue()){
547 minimumIntensity = WaterfallMinimumIntensityWheel->minValue();
549 WaterfallMinimumIntensityWheel->setValue(minimumIntensity);
550 double maximumIntensity = _peakAmplitude + 10;
551 if(maximumIntensity > WaterfallMaximumIntensityWheel->maxValue()){
552 maximumIntensity = WaterfallMaximumIntensityWheel->maxValue();
554 WaterfallMaximumIntensityWheel->setValue(maximumIntensity);
555 waterfallMaximumIntensityChangedCB(maximumIntensity);
558 void SpectrumDisplayForm::Waterfall3DAutoScaleBtnCB()
560 double minimumIntensity = _noiseFloorAmplitude - 5;
561 if(minimumIntensity < Waterfall3DMinimumIntensityWheel->minValue()){
562 minimumIntensity = Waterfall3DMinimumIntensityWheel->minValue();
564 Waterfall3DMinimumIntensityWheel->setValue(minimumIntensity);
565 double maximumIntensity = _peakAmplitude + 10;
566 if(maximumIntensity > Waterfall3DMaximumIntensityWheel->maxValue()){
567 maximumIntensity = Waterfall3DMaximumIntensityWheel->maxValue();
569 Waterfall3DMaximumIntensityWheel->setValue(maximumIntensity);
570 waterfallMaximumIntensityChangedCB(maximumIntensity);
573 void SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType )
575 QColor lowIntensityColor;
576 QColor highIntensityColor;
577 if(newType == WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){
578 // Select the Low Intensity Color
579 lowIntensityColor = _waterfallDisplayPlot->GetUserDefinedLowIntensityColor();
580 if(!lowIntensityColor.isValid()){
581 lowIntensityColor = Qt::black;
583 QMessageBox::information(this, "Low Intensity Color Selection", "In the next window, select the low intensity color for the waterfall display", QMessageBox::Ok);
584 lowIntensityColor = QColorDialog::getColor(lowIntensityColor, this);
586 // Select the High Intensity Color
587 highIntensityColor = _waterfallDisplayPlot->GetUserDefinedHighIntensityColor();
588 if(!highIntensityColor.isValid()){
589 highIntensityColor = Qt::white;
591 QMessageBox::information(this, "High Intensity Color Selection", "In the next window, select the high intensity color for the waterfall display", QMessageBox::Ok);
592 highIntensityColor = QColorDialog::getColor(highIntensityColor, this);
594 _waterfallDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor);
597 void SpectrumDisplayForm::Waterfall3DIntensityColorTypeChanged( int newType )
599 QColor lowIntensityColor;
600 QColor highIntensityColor;
601 if(newType == Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){
602 // Select the Low Intensity Color
603 lowIntensityColor = _waterfallDisplayPlot->GetUserDefinedLowIntensityColor();
604 if(!lowIntensityColor.isValid()){
605 lowIntensityColor = Qt::black;
607 QMessageBox::information(this, "Low Intensity Color Selection", "In the next window, select the low intensity color for the waterfall display", QMessageBox::Ok);
608 lowIntensityColor = QColorDialog::getColor(lowIntensityColor, this);
610 // Select the High Intensity Color
611 highIntensityColor = _waterfallDisplayPlot->GetUserDefinedHighIntensityColor();
612 if(!highIntensityColor.isValid()){
613 highIntensityColor = Qt::white;
615 QMessageBox::information(this, "High Intensity Color Selection", "In the next window, select the high intensity color for the waterfall display", QMessageBox::Ok);
616 highIntensityColor = QColorDialog::getColor(highIntensityColor, this);
618 _waterfall3DDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor);