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) /
127 static_cast<double>(numFFTDataPoints);
129 // find the peak, sum (for mean), etc
130 _peakAmplitude = -HUGE_VAL;
132 for(uint64_t number = 0; number < numFFTDataPoints; number++){
134 if(_realFFTDataPoints[number] > _peakAmplitude){
135 _peakFrequency = (static_cast<float>(number) * fft_bin_size); // Calculate the frequency relative to the local bw, adjust for _startFrequency later
136 _peakAmplitude = _realFFTDataPoints[number];
137 // _peakBin = number;
140 sumMean += _realFFTDataPoints[number];
143 // calculate the spectral mean
144 // +20 because for the comparison below we only want to throw out bins
145 // that are significantly higher (and would, thus, affect the mean more)
146 const double meanAmplitude = (sumMean / numFFTDataPoints) + 20.0;
148 // now throw out any bins higher than the mean
150 uint64_t newNumDataPoints = numFFTDataPoints;
151 for(uint64_t number = 0; number < numFFTDataPoints; number++){
152 if (_realFFTDataPoints[number] <= meanAmplitude)
153 sumMean += _realFFTDataPoints[number];
158 if (newNumDataPoints == 0) // in the odd case that all
159 _noiseFloorAmplitude = meanAmplitude; // amplitudes are equal!
161 _noiseFloorAmplitude = sumMean / newNumDataPoints;
164 if(lastOfMultipleUpdatesFlag){
165 _frequencyDisplayPlot->PlotNewData(_averagedValues, numFFTDataPoints,
166 _noiseFloorAmplitude, _peakFrequency,
168 _timeDomainDisplayPlot->PlotNewData(realTimeDomainDataPoints,
169 imagTimeDomainDataPoints,
170 numTimeDomainDataPoints);
172 // Don't update the repeated data for the waterfall
174 _waterfallDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints,
175 timePerFFT, dataTimestamp,
176 spectrumUpdateEvent->getDroppedFFTFrames());
177 if( _openGLWaterfall3DFlag == 1 ){
178 _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints,
179 timePerFFT, dataTimestamp,
180 spectrumUpdateEvent->getDroppedFFTFrames());
184 // Tell the system the GUI has been updated
185 if(_systemSpecifiedFlag){
186 _system->SetLastGUIUpdateTime(generatedTimestamp);
187 _system->DecrementPendingGUIUpdateEvents();
191 void SpectrumDisplayForm::resizeEvent( QResizeEvent *e )
193 // Let the actual window resize its width, but not its height
194 QSize newSize(e->size().width(), e->oldSize().height());
195 QResizeEvent et(newSize, e->oldSize());
196 QWidget::resizeEvent(&et);
198 // Tell the Tab Window to Resize
199 SpectrumTypeTab->resize( e->size().width(), SpectrumTypeTab->height());
201 // Tell the TabXFreqDisplay to resize
202 Tab1PlotDisplayFrame->resize(e->size().width()-4,
203 Tab1PlotDisplayFrame->height());
204 Tab2PlotDisplayFrame->resize(e->size().width()-4,
205 Tab2PlotDisplayFrame->height());
206 Waterfall3DPlotDisplayFrame->resize(e->size().width()-4,
207 Waterfall3DPlotDisplayFrame->height());
208 TimeDomainDisplayFrame->resize(e->size().width()-4,
209 TimeDomainDisplayFrame->height());
210 _frequencyDisplayPlot->resize( Tab1PlotDisplayFrame->width()-4,
211 Tab1PlotDisplayFrame->height());
212 _waterfallDisplayPlot->resize( Tab2PlotDisplayFrame->width()-4,
213 Tab2PlotDisplayFrame->height());
214 _waterfall3DDisplayPlot->resize( Waterfall3DPlotDisplayFrame->width()-4,
215 Waterfall3DPlotDisplayFrame->height());
216 _timeDomainDisplayPlot->resize( TimeDomainDisplayFrame->width()-4,
217 TimeDomainDisplayFrame->height());
219 // Move the IntensityWheels and Labels
220 WaterfallMaximumIntensityLabel->move(width() - 5 - WaterfallMaximumIntensityLabel->width(),
221 WaterfallMaximumIntensityLabel->y());
222 WaterfallMinimumIntensityLabel->move(width() - 5 - WaterfallMinimumIntensityLabel->width(),
223 WaterfallMinimumIntensityLabel->y());
224 WaterfallMaximumIntensityWheel->resize(WaterfallMaximumIntensityLabel->x() - 5 -
225 WaterfallMaximumIntensityWheel->x(),
226 WaterfallMaximumIntensityWheel->height());
227 WaterfallMinimumIntensityWheel->resize(WaterfallMinimumIntensityLabel->x() - 5 -
228 WaterfallMinimumIntensityWheel->x(),
229 WaterfallMinimumIntensityWheel->height());
231 Waterfall3DMaximumIntensityLabel->move(width() - 5 -
232 Waterfall3DMaximumIntensityLabel->width(),
233 Waterfall3DMaximumIntensityLabel->y());
234 Waterfall3DMinimumIntensityLabel->move(width() - 5 -
235 Waterfall3DMinimumIntensityLabel->width(),
236 Waterfall3DMinimumIntensityLabel->y());
237 Waterfall3DMaximumIntensityWheel->resize(Waterfall3DMaximumIntensityLabel->x() - 5 -
238 Waterfall3DMaximumIntensityWheel->x(),
239 Waterfall3DMaximumIntensityWheel->height());
240 Waterfall3DMinimumIntensityWheel->resize(Waterfall3DMinimumIntensityLabel->x() - 5 -
241 Waterfall3DMinimumIntensityWheel->x(),
242 Waterfall3DMinimumIntensityWheel->height());
245 // Move the Power Lbl
246 PowerLabel->move(e->size().width()-(415-324) - PowerLabel->width(),
249 // Move the Power Line Edit
250 PowerLineEdit->move(e->size().width()-(415-318) - PowerLineEdit->width(),
254 AvgLabel->move(e->size().width()-(415-406) - AvgLabel->width(),
257 // Move the Avg Line Edit
258 AvgLineEdit->move(e->size().width()-(415-400) - AvgLineEdit->width(),
261 // Move the FFT Size Combobox and label
262 FFTSizeComboBox->move(width() - 5 - FFTSizeComboBox->width(),
263 FFTSizeComboBox->y());
264 FFTSizeLabel->move(width() - 10 - FFTSizeComboBox->width() - FFTSizeLabel->width(),
269 void SpectrumDisplayForm::customEvent( QEvent * e)
271 if(e->type() == QEvent::User+3){
272 if(_systemSpecifiedFlag){
273 WindowComboBox->setCurrentIndex(_system->GetWindowType());
274 FFTSizeComboBox->setCurrentIndex(_system->GetFFTSizeIndex());
275 //FFTSizeComboBox->setCurrentIndex(1);
276 PowerLineEdit_textChanged(PowerLineEdit->text());
279 waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value());
280 waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value());
282 waterfall3DMinimumIntensityChangedCB(Waterfall3DMinimumIntensityWheel->value());
283 waterfall3DMaximumIntensityChangedCB(Waterfall3DMaximumIntensityWheel->value());
285 // If the video card doesn't support OpenGL then don't display the 3D Waterfall
286 if(QGLFormat::hasOpenGL()){
287 // Check for Hardware Acceleration of the OpenGL
288 if(!_waterfall3DDisplayPlot->format().directRendering()){
289 // Only ask this once while the program is running...
290 if(_openGLWaterfall3DFlag == -1){
291 _openGLWaterfall3DFlag = 0;
292 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){
293 _openGLWaterfall3DFlag = 1;
298 _openGLWaterfall3DFlag = 1;
302 if(_openGLWaterfall3DFlag != 1){
303 SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(Waterfall3DPage));
306 // Clear any previous display
311 else if(e->type() == 10005){
312 SpectrumUpdateEvent* spectrumUpdateEvent = (SpectrumUpdateEvent*)e;
313 newFrequencyData(spectrumUpdateEvent);
315 else if(e->type() == 10008){
316 setWindowTitle(((SpectrumWindowCaptionEvent*)e)->getLabel());
318 else if(e->type() == 10009){
320 if(_systemSpecifiedFlag){
321 _system->ResetPendingGUIUpdateEvents();
324 else if(e->type() == 10010){
325 _startFrequency = ((SpectrumFrequencyRangeEvent*)e)->GetStartFrequency();
326 _stopFrequency = ((SpectrumFrequencyRangeEvent*)e)->GetStopFrequency();
327 _centerFrequency = ((SpectrumFrequencyRangeEvent*)e)->GetCenterFrequency();
329 UseRFFrequenciesCB(UseRFFrequenciesCheckBox->isChecked());
333 void SpectrumDisplayForm::AvgLineEdit_textChanged( const QString &valueString )
335 if(!valueString.isEmpty()){
336 int value = valueString.toInt();
339 AvgLineEdit->setText("500");
341 SetAverageCount(value);
346 void SpectrumDisplayForm::MaxHoldCheckBox_toggled( bool newState )
348 MaxHoldResetBtn->setEnabled(newState);
349 _frequencyDisplayPlot->SetMaxFFTVisible(newState);
350 MaxHoldResetBtn_clicked();
354 void SpectrumDisplayForm::MinHoldCheckBox_toggled( bool newState )
356 MinHoldResetBtn->setEnabled(newState);
357 _frequencyDisplayPlot->SetMinFFTVisible(newState);
358 MinHoldResetBtn_clicked();
362 void SpectrumDisplayForm::MinHoldResetBtn_clicked()
364 _frequencyDisplayPlot->ClearMinData();
365 _frequencyDisplayPlot->replot();
369 void SpectrumDisplayForm::MaxHoldResetBtn_clicked()
371 _frequencyDisplayPlot->ClearMaxData();
372 _frequencyDisplayPlot->replot();
376 void SpectrumDisplayForm::PowerLineEdit_textChanged( const QString &valueString )
378 if(_systemSpecifiedFlag){
379 if(!valueString.isEmpty()){
380 double value = valueString.toDouble();
383 PowerLineEdit->setText("1");
385 _system->SetPowerValue(value);
388 if(_system->GetPowerValue() > 1){
389 UseRFFrequenciesCheckBox->setChecked(false);
390 UseRFFrequenciesCheckBox->setEnabled(false);
391 UseRFFrequenciesCB(false);
394 UseRFFrequenciesCheckBox->setEnabled(true);
399 void SpectrumDisplayForm::SetFrequencyRange(const double newStartFrequency, const double newStopFrequency, const double newCenterFrequency){
400 _frequencyDisplayPlot->SetFrequencyRange(newStartFrequency, newStopFrequency, newCenterFrequency, UseRFFrequenciesCheckBox->isChecked());
401 _waterfallDisplayPlot->SetFrequencyRange(newStartFrequency, newStopFrequency, newCenterFrequency, UseRFFrequenciesCheckBox->isChecked());
402 _waterfall3DDisplayPlot->SetFrequencyRange(newStartFrequency, newStopFrequency, newCenterFrequency, UseRFFrequenciesCheckBox->isChecked());
406 int SpectrumDisplayForm::GetAverageCount(){
407 return _historyVector->size();
410 void SpectrumDisplayForm::SetAverageCount(const int newCount){
412 if(newCount != static_cast<int>(_historyVector->size())){
413 std::vector<double*>::iterator pos;
414 while(newCount < static_cast<int>(_historyVector->size())){
415 pos = _historyVector->begin();
417 _historyVector->erase(pos);
420 while(newCount > static_cast<int>(_historyVector->size())){
421 _historyVector->push_back(new double[_numRealDataPoints]);
428 void SpectrumDisplayForm::_AverageHistory(const double* newBuffer){
429 if(_numRealDataPoints > 0){
430 if(_historyVector->size() > 0){
431 memcpy(_historyVector->operator[](_historyEntry), newBuffer, _numRealDataPoints*sizeof(double));
433 // Increment the next location to store data
434 _historyEntryCount++;
435 if(_historyEntryCount > static_cast<int>(_historyVector->size())){
436 _historyEntryCount = _historyVector->size();
438 _historyEntry = (++_historyEntry)%_historyVector->size();
440 // Total up and then average the values
442 for(uint64_t location = 0; location < _numRealDataPoints; location++){
444 for(int number = 0; number < _historyEntryCount; number++){
445 sum += _historyVector->operator[](number)[location];
447 _averagedValues[location] = sum/static_cast<double>(_historyEntryCount);
451 memcpy(_averagedValues, newBuffer, _numRealDataPoints*sizeof(double));
456 void SpectrumDisplayForm::ResizeBuffers( const uint64_t numFFTDataPoints, const uint64_t /*numTimeDomainDataPoints*/ ){
457 // Convert from Complex to Real for certain Displays
458 if(_numRealDataPoints != numFFTDataPoints){
459 _numRealDataPoints = numFFTDataPoints;
460 delete[] _realFFTDataPoints;
461 delete[] _averagedValues;
463 _realFFTDataPoints = new double[_numRealDataPoints];
464 _averagedValues = new double[_numRealDataPoints];
465 memset(_realFFTDataPoints, 0x0, _numRealDataPoints*sizeof(double));
467 const int historySize = _historyVector->size();
468 SetAverageCount(0); // Clear the existing history
469 SetAverageCount(historySize);
475 void SpectrumDisplayForm::Reset(){
478 _waterfallDisplayPlot->Reset();
479 _waterfall3DDisplayPlot->Reset();
483 void SpectrumDisplayForm::AverageDataReset(){
485 _historyEntryCount = 0;
487 memset(_averagedValues, 0x0, _numRealDataPoints*sizeof(double));
489 MaxHoldResetBtn_clicked();
490 MinHoldResetBtn_clicked();
494 void SpectrumDisplayForm::closeEvent( QCloseEvent *e )
496 if(_systemSpecifiedFlag){
497 _system->SetWindowOpenFlag(false);
500 qApp->processEvents();
502 QWidget::closeEvent(e);
506 void SpectrumDisplayForm::WindowTypeChanged( int newItem )
508 if(_systemSpecifiedFlag){
509 _system->SetWindowType(newItem);
514 void SpectrumDisplayForm::UseRFFrequenciesCB( bool useRFFlag )
517 SetFrequencyRange(_startFrequency, _stopFrequency, _centerFrequency);
520 SetFrequencyRange(_startFrequency, _stopFrequency, 0.0 );
525 void SpectrumDisplayForm::waterfallMaximumIntensityChangedCB( double newValue )
527 if(newValue > WaterfallMinimumIntensityWheel->value()){
528 WaterfallMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
531 WaterfallMaximumIntensityWheel->setValue(WaterfallMinimumIntensityWheel->value());
533 _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value());
537 void SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue )
539 if(newValue < WaterfallMaximumIntensityWheel->value()){
540 WaterfallMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
543 WaterfallMinimumIntensityWheel->setValue(WaterfallMaximumIntensityWheel->value());
545 _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value());
548 void SpectrumDisplayForm::waterfall3DMaximumIntensityChangedCB( double newValue )
550 if(newValue > Waterfall3DMinimumIntensityWheel->value()){
551 Waterfall3DMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
554 Waterfall3DMaximumIntensityWheel->setValue(Waterfall3DMinimumIntensityWheel->value());
556 _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(), Waterfall3DMaximumIntensityWheel->value());
560 void SpectrumDisplayForm::waterfall3DMinimumIntensityChangedCB( double newValue )
562 if(newValue < Waterfall3DMaximumIntensityWheel->value()){
563 Waterfall3DMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
566 Waterfall3DMinimumIntensityWheel->setValue(Waterfall3DMaximumIntensityWheel->value());
568 _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(), Waterfall3DMaximumIntensityWheel->value());
572 void SpectrumDisplayForm::FFTComboBoxSelectedCB( const QString &fftSizeString )
574 if(_systemSpecifiedFlag){
575 _system->SetFFTSize(fftSizeString.toLong());
580 void SpectrumDisplayForm::WaterfallAutoScaleBtnCB()
582 double minimumIntensity = _noiseFloorAmplitude - 5;
583 if(minimumIntensity < WaterfallMinimumIntensityWheel->minValue()){
584 minimumIntensity = WaterfallMinimumIntensityWheel->minValue();
586 WaterfallMinimumIntensityWheel->setValue(minimumIntensity);
587 double maximumIntensity = _peakAmplitude + 10;
588 if(maximumIntensity > WaterfallMaximumIntensityWheel->maxValue()){
589 maximumIntensity = WaterfallMaximumIntensityWheel->maxValue();
591 WaterfallMaximumIntensityWheel->setValue(maximumIntensity);
592 waterfallMaximumIntensityChangedCB(maximumIntensity);
595 void SpectrumDisplayForm::Waterfall3DAutoScaleBtnCB()
597 double minimumIntensity = _noiseFloorAmplitude - 5;
598 if(minimumIntensity < Waterfall3DMinimumIntensityWheel->minValue()){
599 minimumIntensity = Waterfall3DMinimumIntensityWheel->minValue();
601 Waterfall3DMinimumIntensityWheel->setValue(minimumIntensity);
602 double maximumIntensity = _peakAmplitude + 10;
603 if(maximumIntensity > Waterfall3DMaximumIntensityWheel->maxValue()){
604 maximumIntensity = Waterfall3DMaximumIntensityWheel->maxValue();
606 Waterfall3DMaximumIntensityWheel->setValue(maximumIntensity);
607 waterfallMaximumIntensityChangedCB(maximumIntensity);
610 void SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType )
612 QColor lowIntensityColor;
613 QColor highIntensityColor;
614 if(newType == WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){
615 // Select the Low Intensity Color
616 lowIntensityColor = _waterfallDisplayPlot->GetUserDefinedLowIntensityColor();
617 if(!lowIntensityColor.isValid()){
618 lowIntensityColor = Qt::black;
620 QMessageBox::information(this, "Low Intensity Color Selection", "In the next window, select the low intensity color for the waterfall display", QMessageBox::Ok);
621 lowIntensityColor = QColorDialog::getColor(lowIntensityColor, this);
623 // Select the High Intensity Color
624 highIntensityColor = _waterfallDisplayPlot->GetUserDefinedHighIntensityColor();
625 if(!highIntensityColor.isValid()){
626 highIntensityColor = Qt::white;
628 QMessageBox::information(this, "High Intensity Color Selection", "In the next window, select the high intensity color for the waterfall display", QMessageBox::Ok);
629 highIntensityColor = QColorDialog::getColor(highIntensityColor, this);
631 _waterfallDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor);
634 void SpectrumDisplayForm::Waterfall3DIntensityColorTypeChanged( int newType )
636 QColor lowIntensityColor;
637 QColor highIntensityColor;
638 if(newType == Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){
639 // Select the Low Intensity Color
640 lowIntensityColor = _waterfallDisplayPlot->GetUserDefinedLowIntensityColor();
641 if(!lowIntensityColor.isValid()){
642 lowIntensityColor = Qt::black;
644 QMessageBox::information(this, "Low Intensity Color Selection", "In the next window, select the low intensity color for the waterfall display", QMessageBox::Ok);
645 lowIntensityColor = QColorDialog::getColor(lowIntensityColor, this);
647 // Select the High Intensity Color
648 highIntensityColor = _waterfallDisplayPlot->GetUserDefinedHighIntensityColor();
649 if(!highIntensityColor.isValid()){
650 highIntensityColor = Qt::white;
652 QMessageBox::information(this, "High Intensity Color Selection", "In the next window, select the high intensity color for the waterfall display", QMessageBox::Ok);
653 highIntensityColor = QColorDialog::getColor(highIntensityColor, this);
655 _waterfall3DDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor);