Make decibels display toggleable

This commit is contained in:
Charles J. Cliffe 2015-08-17 23:31:22 -04:00
parent 62858abbf5
commit 3c822e1bd8
3 changed files with 11 additions and 2 deletions

View File

@ -126,7 +126,6 @@ void SpectrumCanvas::moveCenterFrequency(long long freqChange) {
freq -= freqChange;
}
wxGetApp().setFrequency(freq);
setStatusText("Set center frequency: %s", freq);
}
}
@ -134,6 +133,10 @@ void SpectrumCanvas::setShowDb(bool showDb) {
spectrumPanel.setShowDb(showDb);
}
bool SpectrumCanvas::getShowDb() {
return spectrumPanel.getShowDb();
}
void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
InteractiveCanvas::OnMouseMoved(event);
@ -144,7 +147,7 @@ void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
moveCenterFrequency(freqChange);
}
} else {
setStatusText("Click and drag to adjust center frequency.");
setStatusText("Click and drag to adjust center frequency. 'B' to toggle decibels display.");
}
}

View File

@ -20,6 +20,7 @@ public:
void moveCenterFrequency(long long freqChange);
void setShowDb(bool showDb);
bool getShowDb();
SpectrumVisualDataQueue *getVisualDataQueue();

View File

@ -338,6 +338,11 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
activeDemod->setStereo(true);
}
break;
case 'B':
if (spectrumCanvas) {
spectrumCanvas->setShowDb(!spectrumCanvas->getShowDb());
}
break;
case WXK_SPACE:
wxGetApp().showFrequencyInput();
break;