mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 06:04:39 -04:00
Add split-view controls; tweak spectrum scale control
This commit is contained in:
@@ -150,11 +150,11 @@ void InteractiveCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
}
|
||||
|
||||
void InteractiveCanvas::setStatusText(std::string statusText) {
|
||||
((wxFrame*) parent)->GetStatusBar()->SetStatusText(statusText);
|
||||
wxGetApp().getAppFrame()->GetStatusBar()->SetStatusText(statusText);
|
||||
}
|
||||
|
||||
void InteractiveCanvas::setStatusText(std::string statusText, int value) {
|
||||
((wxFrame*) parent)->GetStatusBar()->SetStatusText(
|
||||
wxGetApp().getAppFrame()->GetStatusBar()->SetStatusText(
|
||||
wxString::Format(statusText.c_str(), wxNumberFormatter::ToString((long) value, wxNumberFormatter::Style_WithThousandsSep)));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ SpectrumCanvas::SpectrumCanvas(wxWindow *parent, int *attribList) :
|
||||
SetCursor(wxCURSOR_SIZEWE);
|
||||
scaleFactor = 1.0;
|
||||
resetScaleFactor = false;
|
||||
scaleFactorEnabled = false;
|
||||
bwChange = 0.0;
|
||||
}
|
||||
|
||||
@@ -165,6 +166,11 @@ void SpectrumCanvas::disableView() {
|
||||
InteractiveCanvas::disableView();
|
||||
}
|
||||
|
||||
void SpectrumCanvas::setScaleFactorEnabled(bool en) {
|
||||
scaleFactorEnabled = en;
|
||||
}
|
||||
|
||||
|
||||
void SpectrumCanvas::updateScaleFactor(float factor) {
|
||||
SpectrumVisualProcessor *sp = wxGetApp().getSpectrumProcessor();
|
||||
FFTVisualDataThread *wdt = wxGetApp().getAppFrame()->getWaterfallDataThread();
|
||||
@@ -184,7 +190,7 @@ void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
moveCenterFrequency(freqChange);
|
||||
}
|
||||
}
|
||||
else if (mouseTracker.mouseRightDown()) {
|
||||
else if (scaleFactorEnabled && mouseTracker.mouseRightDown()) {
|
||||
|
||||
float yDelta = mouseTracker.getDeltaMouseY();
|
||||
|
||||
@@ -199,7 +205,11 @@ void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
resetScaleFactor = false;
|
||||
updateScaleFactor(scaleFactor);
|
||||
} else {
|
||||
setStatusText("Drag horitontal to adjust center frequency. Right-drag to adjust vertical scale, click to reset. 'B' to toggle decibels display.");
|
||||
if (scaleFactorEnabled) {
|
||||
setStatusText("Drag horitontal to adjust center frequency. Right-drag to adjust vertical scale, click to reset. 'B' to toggle decibels display.");
|
||||
} else {
|
||||
setStatusText("Displaying spectrum of active demodulator.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ public:
|
||||
void setView(long long center_freq_in, int bandwidth_in);
|
||||
void disableView();
|
||||
|
||||
void setScaleFactorEnabled(bool en);
|
||||
|
||||
SpectrumVisualDataQueue *getVisualDataQueue();
|
||||
|
||||
private:
|
||||
@@ -48,7 +50,7 @@ private:
|
||||
SpectrumPanel spectrumPanel;
|
||||
float scaleFactor;
|
||||
int bwChange;
|
||||
bool resetScaleFactor;
|
||||
bool resetScaleFactor, scaleFactorEnabled;
|
||||
|
||||
SpectrumVisualDataQueue visualDataQueue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user