mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-09-28 16:16:58 -04:00
Merge branch 'vsonnier-editable_demod_label'
This commit is contained in:
commit
c33a359153
@ -271,6 +271,7 @@ SET (cubicsdr_sources
|
|||||||
src/AppFrame.cpp
|
src/AppFrame.cpp
|
||||||
src/AppConfig.cpp
|
src/AppConfig.cpp
|
||||||
src/FrequencyDialog.cpp
|
src/FrequencyDialog.cpp
|
||||||
|
src/DemodLabelDialog.cpp
|
||||||
src/IOThread.cpp
|
src/IOThread.cpp
|
||||||
src/ModemProperties.cpp
|
src/ModemProperties.cpp
|
||||||
src/sdr/SDRDeviceInfo.cpp
|
src/sdr/SDRDeviceInfo.cpp
|
||||||
@ -368,6 +369,7 @@ SET (cubicsdr_headers
|
|||||||
src/AppFrame.h
|
src/AppFrame.h
|
||||||
src/AppConfig.h
|
src/AppConfig.h
|
||||||
src/FrequencyDialog.h
|
src/FrequencyDialog.h
|
||||||
|
src/DemodLabelDialog.h
|
||||||
src/IOThread.h
|
src/IOThread.h
|
||||||
src/ModemProperties.h
|
src/ModemProperties.h
|
||||||
src/sdr/SDRDeviceInfo.h
|
src/sdr/SDRDeviceInfo.h
|
||||||
|
@ -1561,6 +1561,7 @@ void AppFrame::saveSession(std::string fileName) {
|
|||||||
*demod->newChild("bandwidth") = (*instance_i)->getBandwidth();
|
*demod->newChild("bandwidth") = (*instance_i)->getBandwidth();
|
||||||
*demod->newChild("frequency") = (*instance_i)->getFrequency();
|
*demod->newChild("frequency") = (*instance_i)->getFrequency();
|
||||||
*demod->newChild("type") = (*instance_i)->getDemodulatorType();
|
*demod->newChild("type") = (*instance_i)->getDemodulatorType();
|
||||||
|
*demod->newChild("user_label") = (*instance_i)->getDemodulatorUserLabel();
|
||||||
*demod->newChild("squelch_level") = (*instance_i)->getSquelchLevel();
|
*demod->newChild("squelch_level") = (*instance_i)->getSquelchLevel();
|
||||||
*demod->newChild("squelch_enabled") = (*instance_i)->isSquelchEnabled() ? 1 : 0;
|
*demod->newChild("squelch_enabled") = (*instance_i)->isSquelchEnabled() ? 1 : 0;
|
||||||
*demod->newChild("output_device") = outputDevices[(*instance_i)->getOutputDevice()].name;
|
*demod->newChild("output_device") = outputDevices[(*instance_i)->getOutputDevice()].name;
|
||||||
@ -1660,6 +1661,7 @@ bool AppFrame::loadSession(std::string fileName) {
|
|||||||
|
|
||||||
std::string type = "FM";
|
std::string type = "FM";
|
||||||
|
|
||||||
|
|
||||||
DataNode *demodTypeNode = demod->hasAnother("type")?demod->getNext("type"):nullptr;
|
DataNode *demodTypeNode = demod->hasAnother("type")?demod->getNext("type"):nullptr;
|
||||||
|
|
||||||
if (demodTypeNode && demodTypeNode->element()->getDataType() == DATA_INT) {
|
if (demodTypeNode && demodTypeNode->element()->getDataType() == DATA_INT) {
|
||||||
@ -1688,6 +1690,18 @@ bool AppFrame::loadSession(std::string fileName) {
|
|||||||
demodTypeNode->element()->get(type);
|
demodTypeNode->element()->get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//read the user label associated with the demodulator
|
||||||
|
std::string user_label = "";
|
||||||
|
|
||||||
|
DataNode *demodUserLabel = demod->hasAnother("user_label") ? demod->getNext("user_label") : nullptr;
|
||||||
|
|
||||||
|
if (demodUserLabel) {
|
||||||
|
//toString() re-formats strings recognized as numerals, but at least it works for
|
||||||
|
//all kind of data.
|
||||||
|
user_label = demodUserLabel->element()->toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ModemSettings mSettings;
|
ModemSettings mSettings;
|
||||||
|
|
||||||
if (demod->hasAnother("settings")) {
|
if (demod->hasAnother("settings")) {
|
||||||
@ -1703,6 +1717,8 @@ bool AppFrame::loadSession(std::string fileName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
newDemod = wxGetApp().getDemodMgr().newThread();
|
newDemod = wxGetApp().getDemodMgr().newThread();
|
||||||
|
|
||||||
if (demod->hasAnother("active")) {
|
if (demod->hasAnother("active")) {
|
||||||
@ -1711,6 +1727,7 @@ bool AppFrame::loadSession(std::string fileName) {
|
|||||||
|
|
||||||
numDemodulators++;
|
numDemodulators++;
|
||||||
newDemod->setDemodulatorType(type);
|
newDemod->setDemodulatorType(type);
|
||||||
|
newDemod->setDemodulatorUserLabel(user_label);
|
||||||
newDemod->writeModemSettings(mSettings);
|
newDemod->writeModemSettings(mSettings);
|
||||||
newDemod->setBandwidth(bandwidth);
|
newDemod->setBandwidth(bandwidth);
|
||||||
newDemod->setFrequency(freq);
|
newDemod->setFrequency(freq);
|
||||||
|
@ -731,6 +731,19 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
|
|||||||
fdialog.ShowModal();
|
fdialog.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CubicSDR::showLabelInput() {
|
||||||
|
|
||||||
|
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||||
|
|
||||||
|
if (activeDemod != nullptr) {
|
||||||
|
|
||||||
|
const wxString demodTitle("Edit Demodulator label");
|
||||||
|
|
||||||
|
DemodLabelDialog labelDialog(appframe, -1, demodTitle, activeDemod, wxPoint(-100, -100), wxSize(500, 75), wxDEFAULT_DIALOG_STYLE);
|
||||||
|
labelDialog.ShowModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AppFrame *CubicSDR::getAppFrame() {
|
AppFrame *CubicSDR::getAppFrame() {
|
||||||
return appframe;
|
return appframe;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "AppConfig.h"
|
#include "AppConfig.h"
|
||||||
#include "AppFrame.h"
|
#include "AppFrame.h"
|
||||||
#include "FrequencyDialog.h"
|
#include "FrequencyDialog.h"
|
||||||
|
#include "DemodLabelDialog.h"
|
||||||
|
|
||||||
#include "ScopeVisualProcessor.h"
|
#include "ScopeVisualProcessor.h"
|
||||||
#include "SpectrumVisualProcessor.h"
|
#include "SpectrumVisualProcessor.h"
|
||||||
@ -128,6 +129,7 @@ public:
|
|||||||
int getPPM();
|
int getPPM();
|
||||||
|
|
||||||
void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT, wxString initString = "");
|
void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT, wxString initString = "");
|
||||||
|
void showLabelInput();
|
||||||
AppFrame *getAppFrame();
|
AppFrame *getAppFrame();
|
||||||
|
|
||||||
bool areDevicesReady();
|
bool areDevicesReady();
|
||||||
|
94
src/DemodLabelDialog.cpp
Normal file
94
src/DemodLabelDialog.cpp
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
#include "DemodLabelDialog.h"
|
||||||
|
|
||||||
|
#include "wx/clipbrd.h"
|
||||||
|
#include <sstream>
|
||||||
|
#include "CubicSDR.h"
|
||||||
|
|
||||||
|
wxBEGIN_EVENT_TABLE(DemodLabelDialog, wxDialog)
|
||||||
|
EVT_CHAR_HOOK(DemodLabelDialog::OnChar)
|
||||||
|
EVT_SHOW(DemodLabelDialog::OnShow)
|
||||||
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
|
DemodLabelDialog::DemodLabelDialog(wxWindow * parent, wxWindowID id, const wxString & title,
|
||||||
|
DemodulatorInstance *demod, const wxPoint & position,
|
||||||
|
const wxSize & size, long style) :
|
||||||
|
wxDialog(parent, id, title, position, size, style) {
|
||||||
|
|
||||||
|
wxString labelStr;
|
||||||
|
|
||||||
|
//by construction, is allways != nullptr
|
||||||
|
activeDemod = demod;
|
||||||
|
|
||||||
|
labelStr = activeDemod->getDemodulatorUserLabel();
|
||||||
|
|
||||||
|
if (labelStr.empty()) {
|
||||||
|
//propose a default value...
|
||||||
|
labelStr = activeDemod->getDemodulatorType();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dialogText = new wxTextCtrl(this, wxID_LABEL_INPUT, labelStr, wxPoint(6, 1), wxSize(size.GetWidth() - 20, size.GetHeight() - 70),
|
||||||
|
wxTE_PROCESS_ENTER);
|
||||||
|
dialogText->SetFont(wxFont(15, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
|
||||||
|
|
||||||
|
Centre();
|
||||||
|
|
||||||
|
dialogText->SetValue(labelStr);
|
||||||
|
dialogText->SetSelection(-1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DemodLabelDialog::OnChar(wxKeyEvent& event) {
|
||||||
|
int c = event.GetKeyCode();
|
||||||
|
|
||||||
|
std::string strValue = dialogText->GetValue().ToStdString();
|
||||||
|
|
||||||
|
switch (c) {
|
||||||
|
case WXK_RETURN:
|
||||||
|
case WXK_NUMPAD_ENTER:
|
||||||
|
|
||||||
|
//No need to display the demodulator type twice if the user do not change the default value...
|
||||||
|
if (strValue != activeDemod->getDemodulatorType()) {
|
||||||
|
activeDemod->setDemodulatorUserLabel(strValue);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
activeDemod->setDemodulatorUserLabel("");
|
||||||
|
}
|
||||||
|
|
||||||
|
Close();
|
||||||
|
break;
|
||||||
|
case WXK_ESCAPE:
|
||||||
|
Close();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.ControlDown() && c == 'V') {
|
||||||
|
// Alter clipboard contents to remove unwanted chars
|
||||||
|
wxTheClipboard->Open();
|
||||||
|
wxTextDataObject data;
|
||||||
|
wxTheClipboard->GetData(data);
|
||||||
|
std::string clipText = data.GetText().ToStdString();
|
||||||
|
wxTheClipboard->SetData(new wxTextDataObject(clipText));
|
||||||
|
wxTheClipboard->Close();
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
else if (c == WXK_RIGHT || c == WXK_LEFT || event.ControlDown()) {
|
||||||
|
event.Skip();
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#ifdef __linux__
|
||||||
|
dialogText->OnChar(event);
|
||||||
|
event.Skip();
|
||||||
|
#else
|
||||||
|
event.DoAllowNextEvent();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DemodLabelDialog::OnShow(wxShowEvent &event) {
|
||||||
|
|
||||||
|
dialogText->SetFocus();
|
||||||
|
dialogText->SetSelection(-1, -1);
|
||||||
|
event.Skip();
|
||||||
|
}
|
29
src/DemodLabelDialog.h
Normal file
29
src/DemodLabelDialog.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "wx/dialog.h"
|
||||||
|
#include "wx/textctrl.h"
|
||||||
|
#include "wx/string.h"
|
||||||
|
#include "wx/button.h"
|
||||||
|
#include "DemodulatorInstance.h"
|
||||||
|
|
||||||
|
#define wxID_LABEL_INPUT 3002
|
||||||
|
|
||||||
|
class DemodLabelDialog : public wxDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
DemodLabelDialog( wxWindow * parent, wxWindowID id, const wxString & title,
|
||||||
|
DemodulatorInstance *demod = NULL,
|
||||||
|
const wxPoint & pos = wxDefaultPosition,
|
||||||
|
const wxSize & size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_DIALOG_STYLE);
|
||||||
|
|
||||||
|
wxTextCtrl * dialogText;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DemodulatorInstance *activeDemod = nullptr;
|
||||||
|
void OnEnter ( wxCommandEvent &event );
|
||||||
|
void OnChar ( wxKeyEvent &event );
|
||||||
|
void OnShow(wxShowEvent &event);
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
@ -30,8 +30,7 @@ void DemodVisualCue::step() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DemodulatorInstance::DemodulatorInstance() :
|
DemodulatorInstance::DemodulatorInstance() {
|
||||||
t_PreDemod(nullptr), t_Demod(nullptr), t_Audio(nullptr) {
|
|
||||||
|
|
||||||
#if ENABLE_DIGITAL_LAB
|
#if ENABLE_DIGITAL_LAB
|
||||||
activeOutput = nullptr;
|
activeOutput = nullptr;
|
||||||
@ -50,7 +49,9 @@ DemodulatorInstance::DemodulatorInstance() :
|
|||||||
follow.store(false);
|
follow.store(false);
|
||||||
tracking.store(false);
|
tracking.store(false);
|
||||||
|
|
||||||
label = new std::string("Unnamed");
|
label.store(new std::string("Unnamed"));
|
||||||
|
user_label.store(new std::string());
|
||||||
|
|
||||||
pipeIQInputData = new DemodulatorThreadInputQueue;
|
pipeIQInputData = new DemodulatorThreadInputQueue;
|
||||||
pipeIQDemodData = new DemodulatorThreadPostInputQueue;
|
pipeIQDemodData = new DemodulatorThreadPostInputQueue;
|
||||||
pipeDemodNotify = new DemodulatorThreadCommandQueue;
|
pipeDemodNotify = new DemodulatorThreadCommandQueue;
|
||||||
@ -149,12 +150,8 @@ std::string DemodulatorInstance::getLabel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DemodulatorInstance::setLabel(std::string labelStr) {
|
void DemodulatorInstance::setLabel(std::string labelStr) {
|
||||||
std::string *newLabel = new std::string;
|
|
||||||
newLabel->append(labelStr);
|
delete label.exchange(new std::string(labelStr));
|
||||||
std::string *oldLabel;
|
|
||||||
oldLabel = label;
|
|
||||||
label = newLabel;
|
|
||||||
delete oldLabel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DemodulatorInstance::isTerminated() {
|
bool DemodulatorInstance::isTerminated() {
|
||||||
@ -330,6 +327,15 @@ std::string DemodulatorInstance::getDemodulatorType() {
|
|||||||
return demodulatorPreThread->getDemodType();
|
return demodulatorPreThread->getDemodType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string DemodulatorInstance::getDemodulatorUserLabel() {
|
||||||
|
return *(user_label.load());
|
||||||
|
}
|
||||||
|
|
||||||
|
void DemodulatorInstance::setDemodulatorUserLabel(const std::string& demod_user_label) {
|
||||||
|
|
||||||
|
delete user_label.exchange(new std::string(demod_user_label));
|
||||||
|
}
|
||||||
|
|
||||||
void DemodulatorInstance::setDemodulatorLock(bool demod_lock_in) {
|
void DemodulatorInstance::setDemodulatorLock(bool demod_lock_in) {
|
||||||
Modem *cModem = demodulatorPreThread->getModem();
|
Modem *cModem = demodulatorPreThread->getModem();
|
||||||
if (cModem && cModem->getType() == "digital") {
|
if (cModem && cModem->getType() == "digital") {
|
||||||
|
@ -35,12 +35,12 @@ public:
|
|||||||
pthread_t t_PreDemod;
|
pthread_t t_PreDemod;
|
||||||
pthread_t t_Demod;
|
pthread_t t_Demod;
|
||||||
#else
|
#else
|
||||||
std::thread *t_PreDemod;
|
std::thread *t_PreDemod = nullptr;
|
||||||
std::thread *t_Demod;
|
std::thread *t_Demod = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AudioThread *audioThread;
|
AudioThread *audioThread = nullptr;
|
||||||
std::thread *t_Audio;
|
std::thread *t_Audio = nullptr;
|
||||||
|
|
||||||
DemodulatorInstance();
|
DemodulatorInstance();
|
||||||
~DemodulatorInstance();
|
~DemodulatorInstance();
|
||||||
@ -74,6 +74,9 @@ public:
|
|||||||
void setDemodulatorType(std::string demod_type_in);
|
void setDemodulatorType(std::string demod_type_in);
|
||||||
std::string getDemodulatorType();
|
std::string getDemodulatorType();
|
||||||
|
|
||||||
|
std::string getDemodulatorUserLabel();
|
||||||
|
void setDemodulatorUserLabel(const std::string& demod_user_label);
|
||||||
|
|
||||||
void setDemodulatorLock(bool demod_lock_in);
|
void setDemodulatorLock(bool demod_lock_in);
|
||||||
int getDemodulatorLock();
|
int getDemodulatorLock();
|
||||||
|
|
||||||
@ -136,6 +139,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
std::atomic<std::string *> label; //
|
std::atomic<std::string *> label; //
|
||||||
|
std::atomic<std::string *> user_label; //
|
||||||
std::atomic_bool terminated; //
|
std::atomic_bool terminated; //
|
||||||
std::atomic_bool demodTerminated; //
|
std::atomic_bool demodTerminated; //
|
||||||
std::atomic_bool audioTerminated; //
|
std::atomic_bool audioTerminated; //
|
||||||
|
@ -351,10 +351,9 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long
|
|||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
std::string demodStr = "";
|
|
||||||
GLFont::Align demodAlign = GLFont::GLFONT_ALIGN_CENTER;
|
GLFont::Align demodAlign = GLFont::GLFONT_ALIGN_CENTER;
|
||||||
|
|
||||||
demodStr = demod->getDemodulatorType();
|
std::string demodStr = demod->getDemodulatorType();
|
||||||
|
|
||||||
demodAlign = GLFont::GLFONT_ALIGN_CENTER;
|
demodAlign = GLFont::GLFONT_ALIGN_CENTER;
|
||||||
|
|
||||||
@ -373,22 +372,42 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long
|
|||||||
|
|
||||||
// add lock to string if we have an lock
|
// add lock to string if we have an lock
|
||||||
if(demod->getDemodulatorLock()) {
|
if(demod->getDemodulatorLock()) {
|
||||||
demodStr = demodStr + " Lock";
|
demodStr += " Lock";
|
||||||
}
|
}
|
||||||
|
|
||||||
// else {
|
// else {
|
||||||
// demodStr = demodStr + " UnLock";
|
// demodStr = demodStr + " UnLock";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
glColor3f(0, 0, 0);
|
//demodulator user label if present: type is displayed above the label, which is at the bottom of the screen.
|
||||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5) + xOfs, -1.0 + hPos - yOfs, 16, demodAlign,
|
if (!demod->getDemodulatorUserLabel().empty()) {
|
||||||
GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
hPos += 1.3 * labelHeight;
|
||||||
glColor3f(1, 1, 1);
|
}
|
||||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5), -1.0 + hPos, 16, demodAlign, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
|
||||||
|
drawSingleDemodLabel(demodStr, uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
|
||||||
|
|
||||||
|
//revert...
|
||||||
|
if (!demod->getDemodulatorUserLabel().empty()) {
|
||||||
|
hPos -= 1.3 * labelHeight;
|
||||||
|
drawSingleDemodLabel(demod->getDemodulatorUserLabel(), uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
|
||||||
|
}
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PrimaryGLContext::drawSingleDemodLabel(std::string demodStr, float uxPos, float hPos, float xOfs, float yOfs, GLFont::Align demodAlign) {
|
||||||
|
|
||||||
|
glColor3f(0, 0, 0);
|
||||||
|
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5) + xOfs,
|
||||||
|
-1.0 + hPos - yOfs, 16, demodAlign,
|
||||||
|
GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||||
|
glColor3f(1, 1, 1);
|
||||||
|
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5),
|
||||||
|
-1.0 + hPos, 16, demodAlign,
|
||||||
|
GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
void PrimaryGLContext::DrawFreqSelector(float uxPos, RGBA4f color, float w, long long /* center_freq */, long long srate) {
|
void PrimaryGLContext::DrawFreqSelector(float uxPos, RGBA4f color, float w, long long /* center_freq */, long long srate) {
|
||||||
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
void DrawFreqSelector(float uxPos, RGBA4f color, float w = 0, long long center_freq = -1, long long srate = 0);
|
void DrawFreqSelector(float uxPos, RGBA4f color, float w = 0, long long center_freq = -1, long long srate = 0);
|
||||||
void DrawRangeSelector(float uxPos1, float uxPos2, RGBA4f color);
|
void DrawRangeSelector(float uxPos1, float uxPos2, RGBA4f color);
|
||||||
void DrawDemod(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0);
|
void DrawDemod(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0);
|
||||||
|
|
||||||
void DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0, bool centerline = false);
|
void DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0, bool centerline = false);
|
||||||
void DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long long center_freq = - 1, long long srate = 0, bool stack = false, bool centerline = false);
|
void DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long long center_freq = - 1, long long srate = 0, bool stack = false, bool centerline = false);
|
||||||
|
|
||||||
@ -31,4 +32,5 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
float hoverAlpha;
|
float hoverAlpha;
|
||||||
|
void drawSingleDemodLabel(std::string demodStr, float uxPos, float hPos, float xOfs, float yOfs, GLFont::Align demodAlign);
|
||||||
};
|
};
|
||||||
|
@ -451,6 +451,9 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
|||||||
case WXK_SPACE:
|
case WXK_SPACE:
|
||||||
wxGetApp().showFrequencyInput();
|
wxGetApp().showFrequencyInput();
|
||||||
break;
|
break;
|
||||||
|
case 'E': //E is for 'Edit the label' of the active demodulator.
|
||||||
|
wxGetApp().showLabelInput();
|
||||||
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
if (wxGetApp().getDemodMgr().getActiveDemodulator()) {
|
if (wxGetApp().getDemodMgr().getActiveDemodulator()) {
|
||||||
wxGetApp().setFrequency(wxGetApp().getDemodMgr().getActiveDemodulator()->getFrequency());
|
wxGetApp().setFrequency(wxGetApp().getDemodMgr().getActiveDemodulator()->getFrequency());
|
||||||
@ -568,14 +571,14 @@ void WaterfallCanvas::updateHoverState() {
|
|||||||
|
|
||||||
mouseTracker.setVertDragLock(true);
|
mouseTracker.setVertDragLock(true);
|
||||||
mouseTracker.setHorizDragLock(false);
|
mouseTracker.setHorizDragLock(false);
|
||||||
setStatusText("Click and drag to change demodulator bandwidth. SPACE or numeric key for direct frequency input. [, ] to nudge, M for mute, D to delete, C to center.");
|
setStatusText("Click and drag to change demodulator bandwidth. SPACE or numeric key for direct frequency input. [, ] to nudge, M for mute, D to delete, C to center, E to edit label.");
|
||||||
} else {
|
} else {
|
||||||
SetCursor(wxCURSOR_SIZING);
|
SetCursor(wxCURSOR_SIZING);
|
||||||
nextDragState = WF_DRAG_FREQUENCY;
|
nextDragState = WF_DRAG_FREQUENCY;
|
||||||
|
|
||||||
mouseTracker.setVertDragLock(true);
|
mouseTracker.setVertDragLock(true);
|
||||||
mouseTracker.setHorizDragLock(false);
|
mouseTracker.setHorizDragLock(false);
|
||||||
setStatusText("Click and drag to change demodulator frequency; SPACE or numeric key for direct input. [, ] to nudge, M for mute, D to delete, C to center.");
|
setStatusText("Click and drag to change demodulator frequency; SPACE or numeric key for direct input. [, ] to nudge, M for mute, D to delete, C to center, E to edit label.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SetCursor(wxCURSOR_CROSS);
|
SetCursor(wxCURSOR_CROSS);
|
||||||
|
Loading…
Reference in New Issue
Block a user