mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
CLEANUP: some compiler and static analysis warnings
This commit is contained in:
parent
af6a32902f
commit
115b0ffa58
@ -84,7 +84,7 @@ void DeviceConfig::save(DataNode *node) {
|
|||||||
std::lock_guard < std::mutex > lock(busy_lock);
|
std::lock_guard < std::mutex > lock(busy_lock);
|
||||||
*node->newChild("id") = deviceId;
|
*node->newChild("id") = deviceId;
|
||||||
*node->newChild("name") = deviceName;
|
*node->newChild("name") = deviceName;
|
||||||
*node->newChild("ppm") = (int)ppm.load();
|
*node->newChild("ppm") = ppm.load();
|
||||||
*node->newChild("offset") = offset.load();
|
*node->newChild("offset") = offset.load();
|
||||||
*node->newChild("sample_rate") = sampleRate.load();
|
*node->newChild("sample_rate") = sampleRate.load();
|
||||||
*node->newChild("agc_mode") = agcMode.load()?1:0;
|
*node->newChild("agc_mode") = agcMode.load()?1:0;
|
||||||
@ -611,12 +611,13 @@ bool AppConfig::load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.rootNode()->hasAnother("window")) {
|
if (cfg.rootNode()->hasAnother("window")) {
|
||||||
int x,y,w,h;
|
int x = 0 ,y = 0 ,w = 0 ,h = 0;
|
||||||
int max,tips,lpm,mpc;
|
int max = 0 ,tips = 0 ,lpm = 0 ,mpc = 0;
|
||||||
|
|
||||||
DataNode *win_node = cfg.rootNode()->getNext("window");
|
DataNode *win_node = cfg.rootNode()->getNext("window");
|
||||||
|
|
||||||
if (win_node->hasAnother("w") && win_node->hasAnother("h") && win_node->hasAnother("x") && win_node->hasAnother("y")) {
|
if (win_node->hasAnother("w") && win_node->hasAnother("h") && win_node->hasAnother("x") && win_node->hasAnother("y")) {
|
||||||
|
|
||||||
win_node->getNext("x")->element()->get(x);
|
win_node->getNext("x")->element()->get(x);
|
||||||
win_node->getNext("y")->element()->get(y);
|
win_node->getNext("y")->element()->get(y);
|
||||||
win_node->getNext("w")->element()->get(w);
|
win_node->getNext("w")->element()->get(w);
|
||||||
|
@ -66,7 +66,7 @@ AppFrame::AppFrame() :
|
|||||||
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
|
||||||
wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
int attribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
||||||
//wxGLAttributes attribList;
|
//wxGLAttributes attribList;
|
||||||
//attribList.PlatformDefaults().RGBA().DoubleBuffer().EndList();
|
//attribList.PlatformDefaults().RGBA().DoubleBuffer().EndList();
|
||||||
//attribList.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(16).EndList();
|
//attribList.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(16).EndList();
|
||||||
@ -104,9 +104,8 @@ AppFrame::AppFrame() :
|
|||||||
gainSpacerItem = demodTray->AddSpacer(1);
|
gainSpacerItem = demodTray->AddSpacer(1);
|
||||||
gainSpacerItem->Show(false);
|
gainSpacerItem->Show(false);
|
||||||
|
|
||||||
std::string modemListArr[] = { "FM", "FMS", "NBFM", "AM", "LSB", "USB", "DSB", "I/Q" };
|
std::vector<std::string> modemList = { "FM", "FMS", "NBFM", "AM", "LSB", "USB", "DSB", "I/Q" };
|
||||||
std::vector<std::string> modemList( modemListArr, modemListArr + 8 );
|
|
||||||
|
|
||||||
#ifdef CUBICSDR_MODEM_EXCLUDE
|
#ifdef CUBICSDR_MODEM_EXCLUDE
|
||||||
std::string excludeListStr = "" CUBICSDR_MODEM_EXCLUDE;
|
std::string excludeListStr = "" CUBICSDR_MODEM_EXCLUDE;
|
||||||
std::vector<std::string> excludeList = str_explode(",",excludeListStr);
|
std::vector<std::string> excludeList = str_explode(",",excludeListStr);
|
||||||
@ -1197,7 +1196,7 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
|||||||
}
|
}
|
||||||
else if (event.GetId() == wxID_BANDWIDTH_MANUAL_DIALOG) {
|
else if (event.GetId() == wxID_BANDWIDTH_MANUAL_DIALOG) {
|
||||||
|
|
||||||
int rateHigh, rateLow;
|
int rateHigh = 0, rateLow = 0;
|
||||||
|
|
||||||
SDRDeviceInfo *dev = wxGetApp().getDevice();
|
SDRDeviceInfo *dev = wxGetApp().getDevice();
|
||||||
if (dev != nullptr) {
|
if (dev != nullptr) {
|
||||||
|
@ -175,12 +175,12 @@ private:
|
|||||||
std::map<int, wxMenuItem *> directSamplingMenuItems;
|
std::map<int, wxMenuItem *> directSamplingMenuItems;
|
||||||
wxMenuBar *menuBar;
|
wxMenuBar *menuBar;
|
||||||
|
|
||||||
wxMenu *sampleRateMenu;
|
wxMenu *sampleRateMenu = nullptr;
|
||||||
wxMenu *displayMenu;
|
wxMenu *displayMenu = nullptr;
|
||||||
wxMenuItem *agcMenuItem;
|
wxMenuItem *agcMenuItem = nullptr;
|
||||||
wxMenuItem *iqSwapMenuItem;
|
wxMenuItem *iqSwapMenuItem = nullptr;
|
||||||
wxMenuItem *lowPerfMenuItem;
|
wxMenuItem *lowPerfMenuItem = nullptr;
|
||||||
wxMenu *settingsMenu;
|
wxMenu *settingsMenu = nullptr;
|
||||||
|
|
||||||
SoapySDR::ArgInfoList settingArgs;
|
SoapySDR::ArgInfoList settingArgs;
|
||||||
int settingsIdMax;
|
int settingsIdMax;
|
||||||
|
@ -15,7 +15,7 @@ int ModemAnalog::checkSampleRate(long long sampleRate, int /* audioSampleRate */
|
|||||||
if (sampleRate < MIN_BANDWIDTH) {
|
if (sampleRate < MIN_BANDWIDTH) {
|
||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModemKit *ModemAnalog::buildKit(long long sampleRate, int audioSampleRate) {
|
ModemKit *ModemAnalog::buildKit(long long sampleRate, int audioSampleRate) {
|
||||||
@ -27,7 +27,7 @@ ModemKit *ModemAnalog::buildKit(long long sampleRate, int audioSampleRate) {
|
|||||||
akit->sampleRate = sampleRate;
|
akit->sampleRate = sampleRate;
|
||||||
akit->audioSampleRate = audioSampleRate;
|
akit->audioSampleRate = audioSampleRate;
|
||||||
akit->audioResampleRatio = double(audioSampleRate) / double(sampleRate);
|
akit->audioResampleRatio = double(audioSampleRate) / double(sampleRate);
|
||||||
akit->audioResampler = msresamp_rrrf_create(akit->audioResampleRatio, As);
|
akit->audioResampler = msresamp_rrrf_create((float)akit->audioResampleRatio, As);
|
||||||
|
|
||||||
return akit;
|
return akit;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ void ModemAnalog::buildAudioOutput(ModemKitAnalog *akit, AudioThreadInput *audio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msresamp_rrrf_execute(akit->audioResampler, &demodOutputData[0], demodOutputData.size(), &resampledOutputData[0], &numAudioWritten);
|
msresamp_rrrf_execute(akit->audioResampler, &demodOutputData[0], (int)demodOutputData.size(), &resampledOutputData[0], &numAudioWritten);
|
||||||
|
|
||||||
audioOut->channels = 1;
|
audioOut->channels = 1;
|
||||||
audioOut->sampleRate = akit->audioSampleRate;
|
audioOut->sampleRate = akit->audioSampleRate;
|
||||||
|
@ -26,7 +26,7 @@ int ModemDigital::checkSampleRate(long long sampleRate, int /* audioSampleRate *
|
|||||||
if (sampleRate < MIN_BANDWIDTH) {
|
if (sampleRate < MIN_BANDWIDTH) {
|
||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModemKit *ModemDigital::buildKit(long long sampleRate, int audioSampleRate) {
|
ModemKit *ModemDigital::buildKit(long long sampleRate, int audioSampleRate) {
|
||||||
|
@ -33,7 +33,7 @@ void ModemFM::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *au
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
freqdem_demodulate_block(demodFM, &input->data[0], bufSize, &demodOutputData[0]);
|
freqdem_demodulate_block(demodFM, &input->data[0], (int)bufSize, &demodOutputData[0]);
|
||||||
|
|
||||||
buildAudioOutput(fmkit, audioOut, false);
|
buildAudioOutput(fmkit, audioOut, false);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ int ModemFMStereo::checkSampleRate(long long sampleRate, int /* audioSampleRate
|
|||||||
} else if (sampleRate < 1500) {
|
} else if (sampleRate < 1500) {
|
||||||
return 1500;
|
return 1500;
|
||||||
} else {
|
} else {
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,13 +95,13 @@ ModemKit *ModemFMStereo::buildKit(long long sampleRate, int audioSampleRate) {
|
|||||||
|
|
||||||
float As = 60.0f; // stop-band attenuation [dB]
|
float As = 60.0f; // stop-band attenuation [dB]
|
||||||
|
|
||||||
kit->audioResampler = msresamp_rrrf_create(kit->audioResampleRatio, As);
|
kit->audioResampler = msresamp_rrrf_create((float)kit->audioResampleRatio, As);
|
||||||
kit->stereoResampler = msresamp_rrrf_create(kit->audioResampleRatio, As);
|
kit->stereoResampler = msresamp_rrrf_create((float)kit->audioResampleRatio, As);
|
||||||
|
|
||||||
// Stereo filters / shifters
|
// Stereo filters / shifters
|
||||||
double firStereoCutoff = 16000.0 / double(audioSampleRate);
|
float firStereoCutoff = 16000.0f / float(audioSampleRate);
|
||||||
// filter transition
|
// filter transition
|
||||||
float ft = 1000.0f / double(audioSampleRate);
|
float ft = 1000.0f / float(audioSampleRate);
|
||||||
// fractional timing offset
|
// fractional timing offset
|
||||||
float mu = 0.0f;
|
float mu = 0.0f;
|
||||||
|
|
||||||
@ -142,13 +142,13 @@ ModemKit *ModemFMStereo::buildKit(long long sampleRate, int audioSampleRate) {
|
|||||||
kit->demph = _demph;
|
kit->demph = _demph;
|
||||||
|
|
||||||
if (_demph) {
|
if (_demph) {
|
||||||
float f = (1.0f / (2.0f * M_PI * double(_demph) * 1e-6));
|
double f = (1.0 / (2.0 * M_PI * double(_demph) * 1e-6));
|
||||||
float t = 1.0f / (2.0f * M_PI * f);
|
double t = 1.0 / (2.0 * M_PI * f);
|
||||||
t = 1.0f / (2.0f * float(audioSampleRate) * tan(1.0f / (2.0f * float(audioSampleRate) * t)));
|
t = 1.0 / (2.0 * double(audioSampleRate) * tan(1.0 / (2.0 * double(audioSampleRate) * t)));
|
||||||
|
|
||||||
float tb = (1.0f + 2.0f * t * float(audioSampleRate));
|
double tb = (1.0 + 2.0 * t * double(audioSampleRate));
|
||||||
float b_demph[2] = { 1.0f / tb, 1.0f / tb };
|
float b_demph[2] = { (float)(1.0 / tb), (float)(1.0 / tb) };
|
||||||
float a_demph[2] = { 1.0f, (1.0f - 2.0f * t * float(audioSampleRate)) / tb };
|
float a_demph[2] = { 1.0, (float)((1.0 - 2.0 * t * double(audioSampleRate)) / tb) };
|
||||||
|
|
||||||
kit->iirDemphL = iirfilt_rrrf_create(b_demph, 2, a_demph, 2);
|
kit->iirDemphL = iirfilt_rrrf_create(b_demph, 2, a_demph, 2);
|
||||||
kit->iirDemphR = iirfilt_rrrf_create(b_demph, 2, a_demph, 2);
|
kit->iirDemphR = iirfilt_rrrf_create(b_demph, 2, a_demph, 2);
|
||||||
@ -191,7 +191,7 @@ void ModemFMStereo::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInp
|
|||||||
|
|
||||||
size_t audio_out_size = (size_t)ceil((double) (bufSize) * audio_resample_ratio) + 512;
|
size_t audio_out_size = (size_t)ceil((double) (bufSize) * audio_resample_ratio) + 512;
|
||||||
|
|
||||||
freqdem_demodulate_block(demodFM, &input->data[0], bufSize, &demodOutputData[0]);
|
freqdem_demodulate_block(demodFM, &input->data[0], (int)bufSize, &demodOutputData[0]);
|
||||||
|
|
||||||
if (resampledOutputData.size() != audio_out_size) {
|
if (resampledOutputData.size() != audio_out_size) {
|
||||||
if (resampledOutputData.capacity() < audio_out_size) {
|
if (resampledOutputData.capacity() < audio_out_size) {
|
||||||
@ -202,7 +202,7 @@ void ModemFMStereo::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInp
|
|||||||
|
|
||||||
unsigned int numAudioWritten;
|
unsigned int numAudioWritten;
|
||||||
|
|
||||||
msresamp_rrrf_execute(fmkit->audioResampler, &demodOutputData[0], bufSize, &resampledOutputData[0], &numAudioWritten);
|
msresamp_rrrf_execute(fmkit->audioResampler, &demodOutputData[0], (int)bufSize, &resampledOutputData[0], &numAudioWritten);
|
||||||
|
|
||||||
if (demodStereoData.size() != bufSize) {
|
if (demodStereoData.size() != bufSize) {
|
||||||
if (demodStereoData.capacity() < bufSize) {
|
if (demodStereoData.capacity() < bufSize) {
|
||||||
@ -252,7 +252,7 @@ void ModemFMStereo::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInp
|
|||||||
resampledStereoData.resize(audio_out_size);
|
resampledStereoData.resize(audio_out_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
msresamp_rrrf_execute(fmkit->stereoResampler, &demodStereoData[0], bufSize, &resampledStereoData[0], &numAudioWritten);
|
msresamp_rrrf_execute(fmkit->stereoResampler, &demodStereoData[0], (int)bufSize, &resampledStereoData[0], &numAudioWritten);
|
||||||
|
|
||||||
audioOut->channels = 2;
|
audioOut->channels = 2;
|
||||||
if (audioOut->data.capacity() < (numAudioWritten * 2)) {
|
if (audioOut->data.capacity() < (numAudioWritten * 2)) {
|
||||||
|
@ -12,7 +12,7 @@ ModemLSB::ModemLSB() : ModemAnalog() {
|
|||||||
ssbFilt = iirfilt_crcf_create_lowpass(6, 0.25);
|
ssbFilt = iirfilt_crcf_create_lowpass(6, 0.25);
|
||||||
#endif
|
#endif
|
||||||
ssbShift = nco_crcf_create(LIQUID_NCO);
|
ssbShift = nco_crcf_create(LIQUID_NCO);
|
||||||
nco_crcf_set_frequency(ssbShift, (2.0 * M_PI) * 0.25);
|
nco_crcf_set_frequency(ssbShift, (float)((2.0 * M_PI) * 0.25));
|
||||||
c2rFilt = firhilbf_create(5, 90.0);
|
c2rFilt = firhilbf_create(5, 90.0);
|
||||||
useSignalOutput(true);
|
useSignalOutput(true);
|
||||||
}
|
}
|
||||||
@ -41,9 +41,9 @@ int ModemLSB::checkSampleRate(long long sampleRate, int /* audioSampleRate */) {
|
|||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
if (sampleRate % 2 == 0) {
|
if (sampleRate % 2 == 0) {
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
return sampleRate+1;
|
return (int)(sampleRate+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemLSB::getDefaultSampleRate() {
|
int ModemLSB::getDefaultSampleRate() {
|
||||||
|
@ -33,7 +33,7 @@ void ModemNBFM::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
freqdem_demodulate_block(demodFM, &input->data[0], bufSize, &demodOutputData[0]);
|
freqdem_demodulate_block(demodFM, &input->data[0], (unsigned int)bufSize, &demodOutputData[0]);
|
||||||
|
|
||||||
buildAudioOutput(fmkit, audioOut, false);
|
buildAudioOutput(fmkit, audioOut, false);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ ModemUSB::ModemUSB() : ModemAnalog() {
|
|||||||
ssbFilt = iirfilt_crcf_create_lowpass(6, 0.25);
|
ssbFilt = iirfilt_crcf_create_lowpass(6, 0.25);
|
||||||
#endif
|
#endif
|
||||||
ssbShift = nco_crcf_create(LIQUID_NCO);
|
ssbShift = nco_crcf_create(LIQUID_NCO);
|
||||||
nco_crcf_set_frequency(ssbShift, (2.0f * M_PI) * 0.25f);
|
nco_crcf_set_frequency(ssbShift, (float)((2.0 * M_PI) * 0.25));
|
||||||
c2rFilt = firhilbf_create(5, 90.0);
|
c2rFilt = firhilbf_create(5, 90.0);
|
||||||
useSignalOutput(true);
|
useSignalOutput(true);
|
||||||
}
|
}
|
||||||
@ -41,9 +41,9 @@ int ModemUSB::checkSampleRate(long long sampleRate, int /* audioSampleRate */) {
|
|||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
if (sampleRate % 2 == 0) {
|
if (sampleRate % 2 == 0) {
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
return sampleRate+1;
|
return (int)(sampleRate+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemUSB::getDefaultSampleRate() {
|
int ModemUSB::getDefaultSampleRate() {
|
||||||
|
@ -8,7 +8,7 @@ ModemFSK::ModemFSK() : ModemDigital() {
|
|||||||
// DMR defaults?
|
// DMR defaults?
|
||||||
bps = 1;
|
bps = 1;
|
||||||
sps = 9600;
|
sps = 9600;
|
||||||
bw = 0.45;
|
bw = 0.45f;
|
||||||
outStream << std::hex;
|
outStream << std::hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,12 +17,12 @@ ModemBase *ModemFSK::factory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ModemFSK::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
int ModemFSK::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
||||||
float minSps = pow(2.0,bps);
|
double minSps = pow(2.0,bps);
|
||||||
float nextSps = (float(sampleRate) / float(sps));
|
double nextSps = (double(sampleRate) / double(sps));
|
||||||
if (nextSps < minSps) {
|
if (nextSps < minSps) {
|
||||||
return 2 * bps * sps;
|
return 2 * bps * sps;
|
||||||
} else {
|
} else {
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ std::string ModemFSK::readSetting(std::string setting) {
|
|||||||
ModemKit *ModemFSK::buildKit(long long sampleRate, int audioSampleRate) {
|
ModemKit *ModemFSK::buildKit(long long sampleRate, int audioSampleRate) {
|
||||||
ModemKitFSK *dkit = new ModemKitFSK;
|
ModemKitFSK *dkit = new ModemKitFSK;
|
||||||
dkit->m = bps;
|
dkit->m = bps;
|
||||||
dkit->k = sampleRate / sps;
|
dkit->k = (unsigned int)(sampleRate / sps);
|
||||||
dkit->bw = bw;
|
dkit->bw = bw;
|
||||||
|
|
||||||
dkit->demodFSK = fskdem_create(dkit->m, dkit->k, dkit->bw);
|
dkit->demodFSK = fskdem_create(dkit->m, dkit->k, dkit->bw);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
ModemGMSK::ModemGMSK() : ModemDigital() {
|
ModemGMSK::ModemGMSK() : ModemDigital() {
|
||||||
_sps = 4;
|
_sps = 4;
|
||||||
_fdelay = 3;
|
_fdelay = 3;
|
||||||
_ebf = 0.3;
|
_ebf = 0.3f;
|
||||||
outStream << std::hex;
|
outStream << std::hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ int ModemGMSK::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
|||||||
if (sampleRate < MIN_BANDWIDTH) {
|
if (sampleRate < MIN_BANDWIDTH) {
|
||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemGMSK::getDefaultSampleRate() {
|
int ModemGMSK::getDefaultSampleRate() {
|
||||||
|
@ -23,7 +23,7 @@ int ModemOOK::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
|||||||
if (sampleRate < 100) {
|
if (sampleRate < 100) {
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
return sampleRate;
|
return (int)sampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModemOOK::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *audioOut) {
|
void ModemOOK::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *audioOut) {
|
||||||
|
@ -42,14 +42,14 @@ MeterPanel::MeterPanel(std::string name, float low, float high, float current) {
|
|||||||
|
|
||||||
addChild(&bgPanel);
|
addChild(&bgPanel);
|
||||||
|
|
||||||
labelPanel.setSize(1.0, 0.1);
|
labelPanel.setSize(1.0f, 0.1f);
|
||||||
labelPanel.setPosition(0.0, 1.0);
|
labelPanel.setPosition(0.0, 1.0);
|
||||||
labelPanel.setText(name,GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, true);
|
labelPanel.setText(name,GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, true);
|
||||||
labelPanel.setFill(GLPanel::GLPANEL_FILL_NONE);
|
labelPanel.setFill(GLPanel::GLPANEL_FILL_NONE);
|
||||||
|
|
||||||
addChild(&labelPanel);
|
addChild(&labelPanel);
|
||||||
|
|
||||||
valuePanel.setSize(1.0, 0.1);
|
valuePanel.setSize(1.0f, 0.1f);
|
||||||
valuePanel.setPosition(0.0, -1.0);
|
valuePanel.setPosition(0.0, -1.0);
|
||||||
|
|
||||||
setValueLabel(std::to_string(int(current)));
|
setValueLabel(std::to_string(int(current)));
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "FFTDataDistributor.h"
|
#include "FFTDataDistributor.h"
|
||||||
|
|
||||||
FFTDataDistributor::FFTDataDistributor() : outputBuffers("FFTDataDistributorBuffers"), fftSize(DEFAULT_FFT_SIZE), linesPerSecond(DEFAULT_WATERFALL_LPS), lineRateAccum(0.0) {
|
FFTDataDistributor::FFTDataDistributor() : outputBuffers("FFTDataDistributorBuffers"), fftSize(DEFAULT_FFT_SIZE), linesPerSecond(DEFAULT_WATERFALL_LPS), lineRateAccum(0.0) {
|
||||||
bufferedItems = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFTDataDistributor::setFFTSize(unsigned int fftSize) {
|
void FFTDataDistributor::setFFTSize(unsigned int fftSize) {
|
||||||
@ -60,14 +60,14 @@ void FFTDataDistributor::process() {
|
|||||||
double lineRateStep = ((double)linesPerSecond * inputTime)/(double)inputLines;
|
double lineRateStep = ((double)linesPerSecond * inputTime)/(double)inputLines;
|
||||||
|
|
||||||
if (bufferedItems >= fftSize) {
|
if (bufferedItems >= fftSize) {
|
||||||
int numProcessed = 0;
|
size_t numProcessed = 0;
|
||||||
|
|
||||||
if (lineRateAccum + (lineRateStep * ((double)bufferedItems/(double)fftSize)) < 1.0) {
|
if (lineRateAccum + (lineRateStep * ((double)bufferedItems/(double)fftSize)) < 1.0) {
|
||||||
// move along, nothing to see here..
|
// move along, nothing to see here..
|
||||||
lineRateAccum += (lineRateStep * ((double)bufferedItems/(double)fftSize));
|
lineRateAccum += (lineRateStep * ((double)bufferedItems/(double)fftSize));
|
||||||
numProcessed = bufferedItems;
|
numProcessed = bufferedItems;
|
||||||
} else {
|
} else {
|
||||||
for (unsigned int i = 0, iMax = bufferedItems; i < iMax; i += fftSize) {
|
for (size_t i = 0, iMax = bufferedItems; i < iMax; i += fftSize) {
|
||||||
if ((i + fftSize) > iMax) {
|
if ((i + fftSize) > iMax) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -23,5 +23,7 @@ protected:
|
|||||||
unsigned int fftSize;
|
unsigned int fftSize;
|
||||||
unsigned int linesPerSecond;
|
unsigned int linesPerSecond;
|
||||||
double lineRateAccum;
|
double lineRateAccum;
|
||||||
size_t bufferMax, bufferOffset, bufferedItems;
|
size_t bufferMax = 0;
|
||||||
|
size_t bufferOffset = 0;
|
||||||
|
size_t bufferedItems = 0;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
class ScopeRenderData: public ReferenceCounter {
|
class ScopeRenderData: public ReferenceCounter {
|
||||||
public:
|
public:
|
||||||
std::vector<float> waveform_points;
|
std::vector<float> waveform_points;
|
||||||
ScopePanel::ScopeMode mode;
|
ScopePanel::ScopeMode mode = ScopePanel::SCOPE_MODE_Y;
|
||||||
int inputRate;
|
int inputRate;
|
||||||
int sampleRate;
|
int sampleRate;
|
||||||
int channels;
|
int channels;
|
||||||
@ -39,7 +39,7 @@ protected:
|
|||||||
std::vector<liquid_float_complex> fftOutput;
|
std::vector<liquid_float_complex> fftOutput;
|
||||||
fftplan fftPlan;
|
fftplan fftPlan;
|
||||||
|
|
||||||
unsigned int fftSize;
|
unsigned int fftSize = 0;
|
||||||
int desiredInputSize;
|
int desiredInputSize;
|
||||||
unsigned int maxScopeSamples;
|
unsigned int maxScopeSamples;
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ SpectrumVisualProcessor::SpectrumVisualProcessor() : outputBuffers("SpectrumVisu
|
|||||||
|
|
||||||
fft_ceil_ma = fft_ceil_maa = 100.0;
|
fft_ceil_ma = fft_ceil_maa = 100.0;
|
||||||
fft_floor_ma = fft_floor_maa = 0.0;
|
fft_floor_ma = fft_floor_maa = 0.0;
|
||||||
|
fft_floor_peak = 0.0;
|
||||||
desiredInputSize.store(0);
|
desiredInputSize.store(0);
|
||||||
fft_average_rate = 0.65f;
|
fft_average_rate = 0.65f;
|
||||||
scaleFactor.store(1.0);
|
scaleFactor.store(1.0);
|
||||||
|
@ -87,7 +87,7 @@ protected:
|
|||||||
// distribute outputs
|
// distribute outputs
|
||||||
std::lock_guard < std::recursive_mutex > busy_lock(busy_update);
|
std::lock_guard < std::recursive_mutex > busy_lock(busy_update);
|
||||||
|
|
||||||
output->setRefCount(outputs.size());
|
output->setRefCount((int)outputs.size());
|
||||||
for (outputs_i = outputs.begin(); outputs_i != outputs.end(); outputs_i++) {
|
for (outputs_i = outputs.begin(); outputs_i != outputs.end(); outputs_i++) {
|
||||||
|
|
||||||
if (!(*outputs_i)->push(output)) {
|
if (!(*outputs_i)->push(output)) {
|
||||||
@ -96,7 +96,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadQueue<InputDataType *> *input;
|
ThreadQueue<InputDataType *> *input = nullptr;
|
||||||
std::vector<ThreadQueue<OutputDataType *> *> outputs;
|
std::vector<ThreadQueue<OutputDataType *> *> outputs;
|
||||||
typename std::vector<ThreadQueue<OutputDataType *> *>::iterator outputs_i;
|
typename std::vector<ThreadQueue<OutputDataType *> *>::iterator outputs_i;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public:
|
|||||||
SDRRangeMap getGains(int direction, size_t channel);
|
SDRRangeMap getGains(int direction, size_t channel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int index;
|
int index = 0;
|
||||||
std::string name, serial, product, manufacturer, tuner;
|
std::string name, serial, product, manufacturer, tuner;
|
||||||
std::string driver, hardware, manual_params;
|
std::string driver, hardware, manual_params;
|
||||||
bool timestamps, available, remote, manual;
|
bool timestamps, available, remote, manual;
|
||||||
|
@ -45,7 +45,7 @@ private:
|
|||||||
std::vector<liquid_float_complex> fpData;
|
std::vector<liquid_float_complex> fpData;
|
||||||
std::vector<liquid_float_complex> dataOut;
|
std::vector<liquid_float_complex> dataOut;
|
||||||
std::vector<long long> chanCenters;
|
std::vector<long long> chanCenters;
|
||||||
long long chanBw;
|
long long chanBw = 0;
|
||||||
|
|
||||||
size_t nRunDemods;
|
size_t nRunDemods;
|
||||||
std::vector<DemodulatorInstance *> runDemods;
|
std::vector<DemodulatorInstance *> runDemods;
|
||||||
|
@ -38,10 +38,10 @@ private:
|
|||||||
public:
|
public:
|
||||||
typedef enum GLPanelFillType { GLPANEL_FILL_NONE, GLPANEL_FILL_SOLID, GLPANEL_FILL_GRAD_X, GLPANEL_FILL_GRAD_Y, GLPANEL_FILL_GRAD_BAR_X, GLPANEL_FILL_GRAD_BAR_Y } GLPanelFillType;
|
typedef enum GLPanelFillType { GLPANEL_FILL_NONE, GLPANEL_FILL_SOLID, GLPANEL_FILL_GRAD_X, GLPANEL_FILL_GRAD_Y, GLPANEL_FILL_GRAD_BAR_X, GLPANEL_FILL_GRAD_BAR_Y } GLPanelFillType;
|
||||||
typedef enum GLPanelCoordinateSystem { GLPANEL_Y_DOWN_ZERO_ONE, GLPANEL_Y_UP_ZERO_ONE, GLPANEL_Y_UP, GLPANEL_Y_DOWN } GLPanelCoordinateSystem;
|
typedef enum GLPanelCoordinateSystem { GLPANEL_Y_DOWN_ZERO_ONE, GLPANEL_Y_UP_ZERO_ONE, GLPANEL_Y_UP, GLPANEL_Y_DOWN } GLPanelCoordinateSystem;
|
||||||
float pos[2];
|
float pos[2] = {0.0f,0.0f};
|
||||||
float rot[3];
|
float rot[3] = { 0.0f,0.0f,0.0f };
|
||||||
float size[2];
|
float size[2] = { 0.0f,0.0f };
|
||||||
float view[2];
|
float view[2] = { 0.0f,0.0f };
|
||||||
GLPanelFillType fillType;
|
GLPanelFillType fillType;
|
||||||
GLPanelCoordinateSystem coord;
|
GLPanelCoordinateSystem coord;
|
||||||
float marginPx;
|
float marginPx;
|
||||||
|
@ -27,7 +27,7 @@ EVT_LEAVE_WINDOW(UITestCanvas::OnMouseLeftWindow)
|
|||||||
EVT_ENTER_WINDOW(UITestCanvas::OnMouseEnterWindow)
|
EVT_ENTER_WINDOW(UITestCanvas::OnMouseEnterWindow)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
UITestCanvas::UITestCanvas(wxWindow *parent, int *dispAttrs) :
|
UITestCanvas::UITestCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs) {
|
InteractiveCanvas(parent, dispAttrs) {
|
||||||
|
|
||||||
glContext = new UITestContext(this, &wxGetApp().GetContext(this));
|
glContext = new UITestContext(this, &wxGetApp().GetContext(this));
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
class UITestCanvas: public InteractiveCanvas {
|
class UITestCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
UITestCanvas(wxWindow *parent, int *dispAttrs);
|
UITestCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~UITestCanvas();
|
~UITestCanvas();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -45,7 +45,7 @@ PrimaryGLContext(canvas, sharedContext), testMeter("TEST",0,100,50) {
|
|||||||
// testPanel.addChild(&testChildPanel);
|
// testPanel.addChild(&testChildPanel);
|
||||||
// testPanel.addChild(&testChildPanel2);
|
// testPanel.addChild(&testChildPanel2);
|
||||||
// testPanel.addChild(&testChildPanel3);
|
// testPanel.addChild(&testChildPanel3);
|
||||||
testMeter.setSize(0.1,0.9);
|
testMeter.setSize(0.1f,0.9f);
|
||||||
testPanel.addChild(&testMeter);
|
testPanel.addChild(&testMeter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ public:
|
|||||||
GLFontStringCache();
|
GLFontStringCache();
|
||||||
int drawlen;
|
int drawlen;
|
||||||
int vpx, vpy;
|
int vpx, vpy;
|
||||||
int pxHeight;
|
int pxHeight = 0;
|
||||||
float msgWidth;
|
float msgWidth = 0.0f;
|
||||||
std::atomic_int gc;
|
std::atomic_int gc;
|
||||||
std::vector<float> gl_vertices;
|
std::vector<float> gl_vertices;
|
||||||
std::vector<float> gl_uv;
|
std::vector<float> gl_uv;
|
||||||
|
@ -24,19 +24,19 @@ std::vector<float> &Gradient::getBlue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gradient::generate(unsigned int len) {
|
void Gradient::generate(unsigned int len) {
|
||||||
unsigned int chunk_size = len / (colors.size() - 1);
|
size_t chunk_size = len / (colors.size() - 1);
|
||||||
|
|
||||||
unsigned int p = 0;
|
size_t p = 0;
|
||||||
r_val.resize(len);
|
r_val.resize(len);
|
||||||
g_val.resize(len);
|
g_val.resize(len);
|
||||||
b_val.resize(len);
|
b_val.resize(len);
|
||||||
|
|
||||||
for (unsigned int j = 0, jMax = colors.size() - 1; j < jMax; j++) {
|
for (size_t j = 0, jMax = colors.size() - 1; j < jMax; j++) {
|
||||||
if ((chunk_size * (jMax)) < len && (j == jMax - 1)) {
|
if ((chunk_size * (jMax)) < len && (j == jMax - 1)) {
|
||||||
chunk_size += len - chunk_size * (jMax);
|
chunk_size += len - chunk_size * (jMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < chunk_size; i++) {
|
for (size_t i = 0; i < chunk_size; i++) {
|
||||||
float idx = (float) (i) / (float) chunk_size;
|
float idx = (float) (i) / (float) chunk_size;
|
||||||
|
|
||||||
float r1 = colors[j].r;
|
float r1 = colors[j].r;
|
||||||
|
@ -56,7 +56,7 @@ void Timer::unlock()
|
|||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
last_update = system_milliseconds-lock_rate;
|
last_update = system_milliseconds-(unsigned long)lock_rate;
|
||||||
|
|
||||||
offset += msec_tmp-system_milliseconds;
|
offset += msec_tmp-system_milliseconds;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ EVT_ENTER_WINDOW(GainCanvas::OnMouseEnterWindow)
|
|||||||
EVT_MOUSEWHEEL(GainCanvas::OnMouseWheelMoved)
|
EVT_MOUSEWHEEL(GainCanvas::OnMouseWheelMoved)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
GainCanvas::GainCanvas(wxWindow *parent, int *dispAttrs) :
|
GainCanvas::GainCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs) {
|
InteractiveCanvas(parent, dispAttrs) {
|
||||||
|
|
||||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
class GainCanvas: public InteractiveCanvas {
|
class GainCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
GainCanvas(wxWindow *parent, int *dispAttrs);
|
GainCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~GainCanvas();
|
~GainCanvas();
|
||||||
|
|
||||||
void setHelpTip(std::string tip);
|
void setHelpTip(std::string tip);
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
#include <wx/numformatter.h>
|
#include <wx/numformatter.h>
|
||||||
|
|
||||||
InteractiveCanvas::InteractiveCanvas(wxWindow *parent, int *dispAttrs) :
|
InteractiveCanvas::InteractiveCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
wxGLCanvas(parent, wxID_ANY, dispAttrs, wxDefaultPosition, wxDefaultSize,
|
wxGLCanvas(parent, wxID_ANY, dispAttrs.data(), wxDefaultPosition, wxDefaultSize,
|
||||||
wxFULL_REPAINT_ON_RESIZE), parent(parent), shiftDown(false), altDown(false), ctrlDown(false), centerFreq(0), bandwidth(0), lastBandwidth(0), isView(
|
wxFULL_REPAINT_ON_RESIZE), parent(parent), shiftDown(false), altDown(false), ctrlDown(false), centerFreq(0), bandwidth(0), lastBandwidth(0), isView(
|
||||||
false) {
|
false) {
|
||||||
mouseTracker.setTarget(this);
|
mouseTracker.setTarget(this);
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
|
|
||||||
#include "MouseTracker.h"
|
#include "MouseTracker.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class InteractiveCanvas: public wxGLCanvas {
|
class InteractiveCanvas: public wxGLCanvas {
|
||||||
public:
|
public:
|
||||||
InteractiveCanvas(wxWindow *parent, int *dispAttrs);
|
InteractiveCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~InteractiveCanvas();
|
~InteractiveCanvas();
|
||||||
|
|
||||||
long long getFrequencyAt(float x);
|
long long getFrequencyAt(float x);
|
||||||
|
@ -30,7 +30,7 @@ EVT_LEAVE_WINDOW(MeterCanvas::OnMouseLeftWindow)
|
|||||||
EVT_ENTER_WINDOW(MeterCanvas::OnMouseEnterWindow)
|
EVT_ENTER_WINDOW(MeterCanvas::OnMouseEnterWindow)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
MeterCanvas::MeterCanvas(wxWindow *parent, int *dispAttrs) :
|
MeterCanvas::MeterCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs), level(0), level_min(0), level_max(1), inputValue(0), userInputValue(0), showUserInput(true) {
|
InteractiveCanvas(parent, dispAttrs), level(0), level_min(0), level_max(1), inputValue(0), userInputValue(0), showUserInput(true) {
|
||||||
|
|
||||||
glContext = new MeterContext(this, &wxGetApp().GetContext(this));
|
glContext = new MeterContext(this, &wxGetApp().GetContext(this));
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
class MeterCanvas: public InteractiveCanvas {
|
class MeterCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
MeterCanvas(wxWindow *parent, int *dispAttrs);
|
MeterCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~MeterCanvas();
|
~MeterCanvas();
|
||||||
|
|
||||||
void setLevel(float level_in);
|
void setLevel(float level_in);
|
||||||
|
@ -27,7 +27,7 @@ EVT_LEAVE_WINDOW(ModeSelectorCanvas::OnMouseLeftWindow)
|
|||||||
EVT_ENTER_WINDOW(ModeSelectorCanvas::OnMouseEnterWindow)
|
EVT_ENTER_WINDOW(ModeSelectorCanvas::OnMouseEnterWindow)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
ModeSelectorCanvas::ModeSelectorCanvas(wxWindow *parent, int *dispAttrs) :
|
ModeSelectorCanvas::ModeSelectorCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs), numChoices(0), currentSelection(-1), toggleMode(false), inputChanged(false), padX(4.0), padY(4.0), highlightOverride(false) {
|
InteractiveCanvas(parent, dispAttrs), numChoices(0), currentSelection(-1), toggleMode(false), inputChanged(false), padX(4.0), padY(4.0), highlightOverride(false) {
|
||||||
|
|
||||||
glContext = new ModeSelectorContext(this, &wxGetApp().GetContext(this));
|
glContext = new ModeSelectorContext(this, &wxGetApp().GetContext(this));
|
||||||
|
@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
class ModeSelectorCanvas: public InteractiveCanvas {
|
class ModeSelectorCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
ModeSelectorCanvas(wxWindow *parent, int *dispAttrs);
|
ModeSelectorCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~ModeSelectorCanvas();
|
~ModeSelectorCanvas();
|
||||||
|
|
||||||
int getHoveredSelection();
|
int getHoveredSelection();
|
||||||
|
@ -31,7 +31,7 @@ EVT_LEAVE_WINDOW(ScopeCanvas::OnMouseLeftWindow)
|
|||||||
EVT_ENTER_WINDOW(ScopeCanvas::OnMouseEnterWindow)
|
EVT_ENTER_WINDOW(ScopeCanvas::OnMouseEnterWindow)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
ScopeCanvas::ScopeCanvas(wxWindow *parent, int *dispAttrs) : InteractiveCanvas(parent, dispAttrs), ppmMode(false), ctr(0), ctrTarget(0), dragAccel(0), helpTip("") {
|
ScopeCanvas::ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs) : InteractiveCanvas(parent, dispAttrs), ppmMode(false), ctr(0), ctrTarget(0), dragAccel(0), helpTip("") {
|
||||||
|
|
||||||
glContext = new ScopeContext(this, &wxGetApp().GetContext(this));
|
glContext = new ScopeContext(this, &wxGetApp().GetContext(this));
|
||||||
inputData.set_max_num_items(2);
|
inputData.set_max_num_items(2);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
class ScopeCanvas: public InteractiveCanvas {
|
class ScopeCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
ScopeCanvas(wxWindow *parent, int *dispAttrs);
|
ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~ScopeCanvas();
|
~ScopeCanvas();
|
||||||
|
|
||||||
//This is public because it is indeed forwarded from
|
//This is public because it is indeed forwarded from
|
||||||
|
@ -32,7 +32,7 @@ EVT_RIGHT_DOWN(SpectrumCanvas::OnMouseRightDown)
|
|||||||
EVT_RIGHT_UP(SpectrumCanvas::OnMouseRightReleased)
|
EVT_RIGHT_UP(SpectrumCanvas::OnMouseRightReleased)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
SpectrumCanvas::SpectrumCanvas(wxWindow *parent, int *dispAttrs) :
|
SpectrumCanvas::SpectrumCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs), waterfallCanvas(NULL) {
|
InteractiveCanvas(parent, dispAttrs), waterfallCanvas(NULL) {
|
||||||
|
|
||||||
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
|
||||||
|
@ -16,7 +16,7 @@ class WaterfallCanvas;
|
|||||||
|
|
||||||
class SpectrumCanvas: public InteractiveCanvas {
|
class SpectrumCanvas: public InteractiveCanvas {
|
||||||
public:
|
public:
|
||||||
SpectrumCanvas(wxWindow *parent, int *dispAttrs);
|
SpectrumCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~SpectrumCanvas();
|
~SpectrumCanvas();
|
||||||
|
|
||||||
//This is public because it is indeed forwarded from
|
//This is public because it is indeed forwarded from
|
||||||
|
@ -33,7 +33,7 @@ EVT_MOUSEWHEEL(TuningCanvas::OnMouseWheelMoved)
|
|||||||
//EVT_KEY_UP(TuningCanvas::OnKeyUp)
|
//EVT_KEY_UP(TuningCanvas::OnKeyUp)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
TuningCanvas::TuningCanvas(wxWindow *parent, int *dispAttrs) :
|
TuningCanvas::TuningCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs), dragAccum(0), uxDown(0), top(false), bottom(false), freq(-1), bw(-1), center(-1), halfBand(false) {
|
InteractiveCanvas(parent, dispAttrs), dragAccum(0), uxDown(0), top(false), bottom(false), freq(-1), bw(-1), center(-1), halfBand(false) {
|
||||||
|
|
||||||
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
||||||
|
@ -20,7 +20,7 @@ public:
|
|||||||
enum ActiveState {
|
enum ActiveState {
|
||||||
TUNING_HOVER_NONE, TUNING_HOVER_FREQ, TUNING_HOVER_BW, TUNING_HOVER_PPM, TUNING_HOVER_CENTER
|
TUNING_HOVER_NONE, TUNING_HOVER_FREQ, TUNING_HOVER_BW, TUNING_HOVER_PPM, TUNING_HOVER_CENTER
|
||||||
};
|
};
|
||||||
TuningCanvas(wxWindow *parent, int *dispAttrs);
|
TuningCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
~TuningCanvas();
|
~TuningCanvas();
|
||||||
|
|
||||||
void setHelpTip(std::string tip);
|
void setHelpTip(std::string tip);
|
||||||
|
@ -37,7 +37,7 @@ EVT_ENTER_WINDOW(WaterfallCanvas::OnMouseEnterWindow)
|
|||||||
EVT_MOUSEWHEEL(WaterfallCanvas::OnMouseWheelMoved)
|
EVT_MOUSEWHEEL(WaterfallCanvas::OnMouseWheelMoved)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
WaterfallCanvas::WaterfallCanvas(wxWindow *parent, int *dispAttrs) :
|
WaterfallCanvas::WaterfallCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
|
||||||
InteractiveCanvas(parent, dispAttrs), dragState(WF_DRAG_NONE), nextDragState(WF_DRAG_NONE), fft_size(0), new_fft_size(0), waterfall_lines(0),
|
InteractiveCanvas(parent, dispAttrs), dragState(WF_DRAG_NONE), nextDragState(WF_DRAG_NONE), fft_size(0), new_fft_size(0), waterfall_lines(0),
|
||||||
dragOfs(0), mouseZoom(1), zoom(1), freqMoving(false), freqMove(0.0), hoverAlpha(1.0) {
|
dragOfs(0), mouseZoom(1), zoom(1), freqMoving(false), freqMove(0.0), hoverAlpha(1.0) {
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
WF_DRAG_NONE, WF_DRAG_BANDWIDTH_LEFT, WF_DRAG_BANDWIDTH_RIGHT, WF_DRAG_FREQUENCY, WF_DRAG_RANGE
|
WF_DRAG_NONE, WF_DRAG_BANDWIDTH_LEFT, WF_DRAG_BANDWIDTH_RIGHT, WF_DRAG_FREQUENCY, WF_DRAG_RANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
WaterfallCanvas(wxWindow *parent, int *dispAttrs);
|
WaterfallCanvas(wxWindow *parent, std::vector<int> dispAttrs);
|
||||||
void setup(unsigned int fft_size_in, int waterfall_lines_in);
|
void setup(unsigned int fft_size_in, int waterfall_lines_in);
|
||||||
void setFFTSize(unsigned int fft_size_in);
|
void setFFTSize(unsigned int fft_size_in);
|
||||||
~WaterfallCanvas();
|
~WaterfallCanvas();
|
||||||
@ -69,8 +69,8 @@ private:
|
|||||||
|
|
||||||
std::vector<float> spectrum_points;
|
std::vector<float> spectrum_points;
|
||||||
|
|
||||||
SpectrumCanvas *spectrumCanvas;
|
SpectrumCanvas *spectrumCanvas = nullptr;
|
||||||
PrimaryGLContext *glContext;
|
PrimaryGLContext *glContext = nullptr;
|
||||||
WaterfallPanel waterfallPanel;
|
WaterfallPanel waterfallPanel;
|
||||||
|
|
||||||
DragState dragState;
|
DragState dragState;
|
||||||
|
Loading…
Reference in New Issue
Block a user