mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-22 19:58:39 -05:00
Merge branch 'master' into netsdr_rel_patch
This commit is contained in:
commit
fd8d1e9198
@ -361,15 +361,15 @@ AppFrame::AppFrame() :
|
|||||||
menu = new wxMenu;
|
menu = new wxMenu;
|
||||||
|
|
||||||
#define NUM_RATES_DEFAULT 4
|
#define NUM_RATES_DEFAULT 4
|
||||||
int desired_rates[NUM_RATES_DEFAULT] = { 48000, 44100, 96000, 192000 };
|
unsigned int desired_rates[NUM_RATES_DEFAULT] = { 48000, 44100, 96000, 192000 };
|
||||||
|
|
||||||
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
for (mdevices_i = outputDevices.begin(); mdevices_i != outputDevices.end(); mdevices_i++) {
|
||||||
int desired_rate = 0;
|
unsigned int desired_rate = 0;
|
||||||
int desired_rank = NUM_RATES_DEFAULT + 1;
|
unsigned int desired_rank = NUM_RATES_DEFAULT + 1;
|
||||||
|
|
||||||
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
|
for (std::vector<unsigned int>::iterator srate = mdevices_i->second.sampleRates.begin(); srate != mdevices_i->second.sampleRates.end();
|
||||||
srate++) {
|
srate++) {
|
||||||
for (i = 0; i < NUM_RATES_DEFAULT; i++) {
|
for (unsigned int i = 0; i < NUM_RATES_DEFAULT; i++) {
|
||||||
if (desired_rates[i] == (*srate)) {
|
if (desired_rates[i] == (*srate)) {
|
||||||
if (desired_rank > i) {
|
if (desired_rank > i) {
|
||||||
desired_rank = i;
|
desired_rank = i;
|
||||||
@ -670,7 +670,7 @@ void AppFrame::updateDeviceParams() {
|
|||||||
|
|
||||||
|
|
||||||
void AppFrame::OnMenu(wxCommandEvent& event) {
|
void AppFrame::OnMenu(wxCommandEvent& event) {
|
||||||
if (event.GetId() >= wxID_RT_AUDIO_DEVICE && event.GetId() < wxID_RT_AUDIO_DEVICE + devices.size()) {
|
if (event.GetId() >= wxID_RT_AUDIO_DEVICE && event.GetId() < wxID_RT_AUDIO_DEVICE + (int)devices.size()) {
|
||||||
if (activeDemodulator) {
|
if (activeDemodulator) {
|
||||||
activeDemodulator->setOutputDevice(event.GetId() - wxID_RT_AUDIO_DEVICE);
|
activeDemodulator->setOutputDevice(event.GetId() - wxID_RT_AUDIO_DEVICE);
|
||||||
activeDemodulator = NULL;
|
activeDemodulator = NULL;
|
||||||
@ -775,7 +775,7 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
|||||||
for (std::vector<SoapySDR::ArgInfo>::iterator arg_i = settingArgs.begin(); arg_i != settingArgs.end(); arg_i++) {
|
for (std::vector<SoapySDR::ArgInfo>::iterator arg_i = settingArgs.begin(); arg_i != settingArgs.end(); arg_i++) {
|
||||||
SoapySDR::ArgInfo &arg = (*arg_i);
|
SoapySDR::ArgInfo &arg = (*arg_i);
|
||||||
|
|
||||||
if (arg.type == SoapySDR::ArgInfo::STRING && arg.options.size() && setIdx >= menuIdx && setIdx < menuIdx+arg.options.size()) {
|
if (arg.type == SoapySDR::ArgInfo::STRING && arg.options.size() && setIdx >= menuIdx && setIdx < menuIdx+(int)arg.options.size()) {
|
||||||
int optIdx = setIdx-menuIdx;
|
int optIdx = setIdx-menuIdx;
|
||||||
wxGetApp().getSDRThread()->writeSetting(arg.key, arg.options[optIdx]);
|
wxGetApp().getSDRThread()->writeSetting(arg.key, arg.options[optIdx]);
|
||||||
break;
|
break;
|
||||||
@ -862,7 +862,7 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.GetId() >= wxID_BANDWIDTH_BASE && event.GetId() < wxID_BANDWIDTH_BASE+sampleRates.size()) {
|
if (event.GetId() >= wxID_BANDWIDTH_BASE && event.GetId() < wxID_BANDWIDTH_BASE + (int)sampleRates.size()) {
|
||||||
wxGetApp().setSampleRate(sampleRates[event.GetId()-wxID_BANDWIDTH_BASE]);
|
wxGetApp().setSampleRate(sampleRates[event.GetId()-wxID_BANDWIDTH_BASE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ std::string frequencyToStr(long long freq) {
|
|||||||
long long strToFrequency(std::string freqStr) {
|
long long strToFrequency(std::string freqStr) {
|
||||||
std::string filterStr = filterChars(freqStr, std::string("0123456789.MKGHmkgh"));
|
std::string filterStr = filterChars(freqStr, std::string("0123456789.MKGHmkgh"));
|
||||||
|
|
||||||
int numLen = filterStr.find_first_not_of("0123456789.");
|
size_t numLen = filterStr.find_first_not_of("0123456789.");
|
||||||
|
|
||||||
if (numLen == std::string::npos) {
|
if (numLen == std::string::npos) {
|
||||||
numLen = freqStr.length();
|
numLen = freqStr.length();
|
||||||
@ -806,4 +806,4 @@ bool CubicSDR::rigIsActive() {
|
|||||||
return (rigThread && !rigThread->isTerminated());
|
return (rigThread && !rigThread->isTerminated());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,11 +37,11 @@ void IOThread::terminate() {
|
|||||||
terminated.store(true);
|
terminated.store(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
void IOThread::onBindOutput(std::string name, ThreadQueueBase* threadQueue) {
|
void IOThread::onBindOutput(std::string /* name */, ThreadQueueBase* /* threadQueue */) {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void IOThread::onBindInput(std::string name, ThreadQueueBase* threadQueue) {
|
void IOThread::onBindInput(std::string /* name */, ThreadQueueBase* /* threadQueue */) {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,4 +65,4 @@ void *IOThread::getOutputQueue(std::string qname) {
|
|||||||
|
|
||||||
bool IOThread::isTerminated() {
|
bool IOThread::isTerminated() {
|
||||||
return terminated.load();
|
return terminated.load();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
|
|||||||
|
|
||||||
float peak = 0.0;
|
float peak = 0.0;
|
||||||
|
|
||||||
for (int j = 0; j < src->boundThreads.load()->size(); j++) {
|
for (size_t j = 0; j < src->boundThreads.load()->size(); j++) {
|
||||||
AudioThread *srcmix = (*(src->boundThreads.load()))[j];
|
AudioThread *srcmix = (*(src->boundThreads.load()))[j];
|
||||||
if (srcmix->isTerminated() || !srcmix->inputQueue || srcmix->inputQueue->empty() || !srcmix->isActive()) {
|
if (srcmix->isTerminated() || !srcmix->inputQueue || srcmix->inputQueue->empty() || !srcmix->isActive()) {
|
||||||
continue;
|
continue;
|
||||||
@ -130,7 +130,7 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
|
|||||||
float mixPeak = srcmix->currentInput->peak * srcmix->gain;
|
float mixPeak = srcmix->currentInput->peak * srcmix->gain;
|
||||||
|
|
||||||
if (srcmix->currentInput->channels == 1) {
|
if (srcmix->currentInput->channels == 1) {
|
||||||
for (int i = 0; i < nBufferFrames; i++) {
|
for (unsigned int i = 0; i < nBufferFrames; i++) {
|
||||||
if (srcmix->audioQueuePtr >= srcmix->currentInput->data.size()) {
|
if (srcmix->audioQueuePtr >= srcmix->currentInput->data.size()) {
|
||||||
srcmix->audioQueuePtr = 0;
|
srcmix->audioQueuePtr = 0;
|
||||||
if (srcmix->currentInput) {
|
if (srcmix->currentInput) {
|
||||||
@ -187,7 +187,7 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (peak > 1.0) {
|
if (peak > 1.0) {
|
||||||
for (int i = 0; i < nBufferFrames * 2; i++) {
|
for (unsigned int i = 0; i < nBufferFrames * 2; i++) {
|
||||||
out[i] /= peak;
|
out[i] /= peak;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ void AudioThread::setSampleRate(int sampleRate) {
|
|||||||
dac.stopStream();
|
dac.stopStream();
|
||||||
dac.closeStream();
|
dac.closeStream();
|
||||||
|
|
||||||
for (int j = 0; j < boundThreads.load()->size(); j++) {
|
for (size_t j = 0; j < boundThreads.load()->size(); j++) {
|
||||||
AudioThread *srcmix = (*(boundThreads.load()))[j];
|
AudioThread *srcmix = (*(boundThreads.load()))[j];
|
||||||
srcmix->setSampleRate(sampleRate);
|
srcmix->setSampleRate(sampleRate);
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ DemodulatorPreThread::DemodulatorPreThread(DemodulatorInstance *parent) : IOThre
|
|||||||
bandwidthChanged.store(false);
|
bandwidthChanged.store(false);
|
||||||
audioSampleRateChanged.store(false);
|
audioSampleRateChanged.store(false);
|
||||||
modemSettingsChanged.store(false);
|
modemSettingsChanged.store(false);
|
||||||
|
demodTypeChanged.store(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DemodulatorPreThread::isInitialized() {
|
bool DemodulatorPreThread::isInitialized() {
|
||||||
@ -155,7 +156,7 @@ void DemodulatorPreThread::run() {
|
|||||||
// std::lock_guard < std::mutex > lock(inp->m_mutex);
|
// std::lock_guard < std::mutex > lock(inp->m_mutex);
|
||||||
std::vector<liquid_float_complex> *data = &inp->data;
|
std::vector<liquid_float_complex> *data = &inp->data;
|
||||||
if (data->size() && (inp->sampleRate == currentSampleRate) && cModem && cModemKit) {
|
if (data->size() && (inp->sampleRate == currentSampleRate) && cModem && cModemKit) {
|
||||||
int bufSize = data->size();
|
size_t bufSize = data->size();
|
||||||
|
|
||||||
if (in_buf_data.size() != bufSize) {
|
if (in_buf_data.size() != bufSize) {
|
||||||
if (in_buf_data.capacity() < bufSize) {
|
if (in_buf_data.capacity() < bufSize) {
|
||||||
@ -185,7 +186,7 @@ void DemodulatorPreThread::run() {
|
|||||||
|
|
||||||
DemodulatorThreadPostIQData *resamp = buffers.getBuffer();
|
DemodulatorThreadPostIQData *resamp = buffers.getBuffer();
|
||||||
|
|
||||||
int out_size = ceil((double) (bufSize) * iqResampleRatio) + 512;
|
size_t out_size = ceil((double) (bufSize) * iqResampleRatio) + 512;
|
||||||
|
|
||||||
if (resampledData.size() != out_size) {
|
if (resampledData.size() != out_size) {
|
||||||
if (resampledData.capacity() < out_size) {
|
if (resampledData.capacity() < out_size) {
|
||||||
|
@ -166,7 +166,7 @@ void DemodulatorThread::run() {
|
|||||||
ati_vis->sampleRate = inp->sampleRate;
|
ati_vis->sampleRate = inp->sampleRate;
|
||||||
ati_vis->inputRate = inp->sampleRate;
|
ati_vis->inputRate = inp->sampleRate;
|
||||||
|
|
||||||
int num_vis = DEMOD_VIS_SIZE;
|
size_t num_vis = DEMOD_VIS_SIZE;
|
||||||
if (modemDigital) {
|
if (modemDigital) {
|
||||||
ati_vis->data.resize(inputData->size());
|
ati_vis->data.resize(inputData->size());
|
||||||
ati_vis->channels = 2;
|
ati_vis->channels = 2;
|
||||||
@ -199,7 +199,7 @@ void DemodulatorThread::run() {
|
|||||||
}
|
}
|
||||||
ati_vis->type = 1;
|
ati_vis->type = 1;
|
||||||
} else {
|
} else {
|
||||||
int numAudioWritten = ati->data.size();
|
size_t numAudioWritten = ati->data.size();
|
||||||
ati_vis->channels = 1;
|
ati_vis->channels = 1;
|
||||||
std::vector<float> *demodOutData = (modemAnalog != nullptr)?modemAnalog->getDemodOutputData():nullptr;
|
std::vector<float> *demodOutData = (modemAnalog != nullptr)?modemAnalog->getDemodOutputData():nullptr;
|
||||||
if ((numAudioWritten > bufSize) || (demodOutData == nullptr)) {
|
if ((numAudioWritten > bufSize) || (demodOutData == nullptr)) {
|
||||||
|
@ -19,7 +19,7 @@ std::string ModemDigital::getType() {
|
|||||||
return "digital";
|
return "digital";
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemDigital::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
int ModemDigital::checkSampleRate(long long sampleRate, int /* audioSampleRate */) {
|
||||||
if (sampleRate < MIN_BANDWIDTH) {
|
if (sampleRate < MIN_BANDWIDTH) {
|
||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ void ModemDigital::updateDemodulatorLock(modem mod, float sensitivity) {
|
|||||||
setDemodulatorLock(modem_get_demodulator_evm(mod) <= sensitivity);
|
setDemodulatorLock(modem_get_demodulator_evm(mod) <= sensitivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModemDigital::digitalStart(ModemKitDigital *kit, modem mod, ModemIQData *input) {
|
void ModemDigital::digitalStart(ModemKitDigital * /* kit */, modem /* mod */, ModemIQData *input) {
|
||||||
int bufSize = input->data.size();
|
int bufSize = input->data.size();
|
||||||
|
|
||||||
if (demodOutputDataDigital.size() != bufSize) {
|
if (demodOutputDataDigital.size() != bufSize) {
|
||||||
@ -64,7 +64,7 @@ void ModemDigital::digitalStart(ModemKitDigital *kit, modem mod, ModemIQData *in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModemDigital::digitalFinish(ModemKitDigital *kit, modem mod) {
|
void ModemDigital::digitalFinish(ModemKitDigital * /* kit */, modem /* mod */) {
|
||||||
#if ENABLE_DIGITAL_LAB
|
#if ENABLE_DIGITAL_LAB
|
||||||
if (digitalOut && outStream.str().length()) {
|
if (digitalOut && outStream.str().length()) {
|
||||||
digitalOut->write(outStream.str());
|
digitalOut->write(outStream.str());
|
||||||
@ -79,4 +79,4 @@ void ModemDigital::digitalFinish(ModemKitDigital *kit, modem mod) {
|
|||||||
void ModemDigital::setOutput(ModemDigitalOutput *modemDigitalOutput) {
|
void ModemDigital::setOutput(ModemDigitalOutput *modemDigitalOutput) {
|
||||||
digitalOut = modemDigitalOutput;
|
digitalOut = modemDigitalOutput;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,7 +30,7 @@ Modem *ModemFMStereo::factory() {
|
|||||||
return new ModemFMStereo;
|
return new ModemFMStereo;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemFMStereo::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
int ModemFMStereo::checkSampleRate(long long sampleRate, int /* audioSampleRate */) {
|
||||||
if (sampleRate < 100000) {
|
if (sampleRate < 100000) {
|
||||||
return 100000;
|
return 100000;
|
||||||
} else if (sampleRate < 1500) {
|
} else if (sampleRate < 1500) {
|
||||||
|
@ -27,7 +27,7 @@ void ModemIQ::disposeKit(ModemKit *kit) {
|
|||||||
delete kit;
|
delete kit;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemIQ::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
int ModemIQ::checkSampleRate(long long /* sampleRate */, int audioSampleRate) {
|
||||||
return audioSampleRate;
|
return audioSampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ int ModemIQ::getDefaultSampleRate() {
|
|||||||
return 48000;
|
return 48000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModemIQ::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *audioOut) {
|
void ModemIQ::demodulate(ModemKit * /* kit */, ModemIQData *input, AudioThreadInput *audioOut) {
|
||||||
int bufSize = input->data.size();
|
int bufSize = input->data.size();
|
||||||
|
|
||||||
if (!bufSize) {
|
if (!bufSize) {
|
||||||
|
@ -33,7 +33,7 @@ ModemLSB::~ModemLSB() {
|
|||||||
ampmodem_destroy(demodAM_LSB);
|
ampmodem_destroy(demodAM_LSB);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemLSB::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
int ModemLSB::checkSampleRate(long long sampleRate, int /* audioSampleRate */) {
|
||||||
if (sampleRate < MIN_BANDWIDTH) {
|
if (sampleRate < MIN_BANDWIDTH) {
|
||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ ModemUSB::~ModemUSB() {
|
|||||||
ampmodem_destroy(demodAM_USB);
|
ampmodem_destroy(demodAM_USB);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModemUSB::checkSampleRate(long long sampleRate, int audioSampleRate) {
|
int ModemUSB::checkSampleRate(long long sampleRate, int /* audioSampleRate */) {
|
||||||
if (sampleRate < MIN_BANDWIDTH) {
|
if (sampleRate < MIN_BANDWIDTH) {
|
||||||
return MIN_BANDWIDTH;
|
return MIN_BANDWIDTH;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ WaterfallPanel::WaterfallPanel() : GLPanel(), fft_size(0), waterfall_lines(0), w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaterfallPanel::setup(int fft_size_in, int num_waterfall_lines_in) {
|
void WaterfallPanel::setup(unsigned int fft_size_in, int num_waterfall_lines_in) {
|
||||||
waterfall_lines = num_waterfall_lines_in;
|
waterfall_lines = num_waterfall_lines_in;
|
||||||
fft_size = fft_size_in;
|
fft_size = fft_size_in;
|
||||||
lines_buffered.store(0);
|
lines_buffered.store(0);
|
||||||
@ -34,9 +34,9 @@ void WaterfallPanel::refreshTheme() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WaterfallPanel::setPoints(std::vector<float> &points) {
|
void WaterfallPanel::setPoints(std::vector<float> &points) {
|
||||||
int halfPts = points.size()/2;
|
size_t halfPts = points.size()/2;
|
||||||
if (halfPts == fft_size) {
|
if (halfPts == fft_size) {
|
||||||
for (int i = 0; i < fft_size; i++) {
|
for (unsigned int i = 0; i < fft_size; i++) {
|
||||||
this->points[i] = points[i*2+1];
|
this->points[i] = points[i*2+1];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -45,7 +45,7 @@ void WaterfallPanel::setPoints(std::vector<float> &points) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WaterfallPanel::step() {
|
void WaterfallPanel::step() {
|
||||||
int half_fft_size = fft_size / 2;
|
unsigned int half_fft_size = fft_size / 2;
|
||||||
|
|
||||||
if (!bufferInitialized.load()) {
|
if (!bufferInitialized.load()) {
|
||||||
delete waterfall_slice;
|
delete waterfall_slice;
|
||||||
@ -67,7 +67,7 @@ void WaterfallPanel::step() {
|
|||||||
waterfall_slice[i] = (unsigned char) floor(wv * 255.0);
|
waterfall_slice[i] = (unsigned char) floor(wv * 255.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int newBufSize = (half_fft_size*lines_buffered.load()+half_fft_size);
|
unsigned int newBufSize = (half_fft_size*lines_buffered.load()+half_fft_size);
|
||||||
if (lineBuffer[j].size() < newBufSize) {
|
if (lineBuffer[j].size() < newBufSize) {
|
||||||
lineBuffer[j].resize(newBufSize);
|
lineBuffer[j].resize(newBufSize);
|
||||||
rLineBuffer[j].resize(newBufSize);
|
rLineBuffer[j].resize(newBufSize);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
class WaterfallPanel : public GLPanel {
|
class WaterfallPanel : public GLPanel {
|
||||||
public:
|
public:
|
||||||
WaterfallPanel();
|
WaterfallPanel();
|
||||||
void setup(int fft_size_in, int num_waterfall_lines_in);
|
void setup(unsigned int fft_size_in, int num_waterfall_lines_in);
|
||||||
void refreshTheme();
|
void refreshTheme();
|
||||||
void setPoints(std::vector<float> &points);
|
void setPoints(std::vector<float> &points);
|
||||||
void step();
|
void step();
|
||||||
@ -20,7 +20,7 @@ private:
|
|||||||
|
|
||||||
GLuint waterfall[2];
|
GLuint waterfall[2];
|
||||||
int waterfall_ofs[2];
|
int waterfall_ofs[2];
|
||||||
int fft_size;
|
unsigned int fft_size;
|
||||||
int waterfall_lines;
|
int waterfall_lines;
|
||||||
unsigned char *waterfall_slice;
|
unsigned char *waterfall_slice;
|
||||||
std::vector<unsigned char> lineBuffer[2];
|
std::vector<unsigned char> lineBuffer[2];
|
||||||
|
@ -63,7 +63,7 @@ void ScopeVisualProcessor::process() {
|
|||||||
if (!audioInputData) {
|
if (!audioInputData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int i, iMax = audioInputData->data.size();
|
size_t i, iMax = audioInputData->data.size();
|
||||||
if (!iMax) {
|
if (!iMax) {
|
||||||
audioInputData->decRefCount();
|
audioInputData->decRefCount();
|
||||||
return;
|
return;
|
||||||
@ -191,7 +191,7 @@ void ScopeVisualProcessor::process() {
|
|||||||
fft_floor_ma = fft_floor_ma + (fft_floor - fft_floor_ma) * 0.05;
|
fft_floor_ma = fft_floor_ma + (fft_floor - fft_floor_ma) * 0.05;
|
||||||
fft_floor_maa = fft_floor_maa + (fft_floor_ma - fft_floor_maa) * 0.05;
|
fft_floor_maa = fft_floor_maa + (fft_floor_ma - fft_floor_maa) * 0.05;
|
||||||
|
|
||||||
int outSize = fftSize/2;
|
unsigned int outSize = fftSize/2;
|
||||||
|
|
||||||
if (renderData->sampleRate != renderData->inputRate) {
|
if (renderData->sampleRate != renderData->inputRate) {
|
||||||
outSize = (int)floor((float)outSize * ((float)renderData->sampleRate/(float)renderData->inputRate));
|
outSize = (int)floor((float)outSize * ((float)renderData->sampleRate/(float)renderData->inputRate));
|
||||||
|
@ -36,9 +36,9 @@ protected:
|
|||||||
float *fftInData;
|
float *fftInData;
|
||||||
fftwf_complex *fftwOutput;
|
fftwf_complex *fftwOutput;
|
||||||
fftwf_plan fftw_plan;
|
fftwf_plan fftw_plan;
|
||||||
int fftSize;
|
unsigned int fftSize;
|
||||||
int desiredInputSize;
|
int desiredInputSize;
|
||||||
int maxScopeSamples;
|
unsigned int maxScopeSamples;
|
||||||
|
|
||||||
double fft_ceil_ma, fft_ceil_maa;
|
double fft_ceil_ma, fft_ceil_maa;
|
||||||
double fft_floor_ma, fft_floor_maa;
|
double fft_floor_ma, fft_floor_maa;
|
||||||
|
@ -95,7 +95,7 @@ int SpectrumVisualProcessor::getDesiredInputSize() {
|
|||||||
return desiredInputSize.load();
|
return desiredInputSize.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectrumVisualProcessor::setup(int fftSize_in) {
|
void SpectrumVisualProcessor::setup(unsigned int fftSize_in) {
|
||||||
busy_run.lock();
|
busy_run.lock();
|
||||||
|
|
||||||
fftSize = fftSize_in;
|
fftSize = fftSize_in;
|
||||||
@ -139,7 +139,7 @@ void SpectrumVisualProcessor::setup(int fftSize_in) {
|
|||||||
busy_run.unlock();
|
busy_run.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectrumVisualProcessor::setFFTSize(int fftSize_in) {
|
void SpectrumVisualProcessor::setFFTSize(unsigned int fftSize_in) {
|
||||||
if (fftSize_in == fftSize) {
|
if (fftSize_in == fftSize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
if (peakReset.load() != 0) {
|
if (peakReset.load() != 0) {
|
||||||
peakReset--;
|
peakReset--;
|
||||||
if (peakReset.load() == 0) {
|
if (peakReset.load() == 0) {
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (unsigned int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
fft_result_peak[i] = fft_floor_maa;
|
fft_result_peak[i] = fft_floor_maa;
|
||||||
}
|
}
|
||||||
fft_ceil_peak = fft_floor_maa;
|
fft_ceil_peak = fft_floor_maa;
|
||||||
@ -224,7 +224,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
|
|
||||||
resamplerRatio = (double) (resampleBw) / (double) iqData->sampleRate;
|
resamplerRatio = (double) (resampleBw) / (double) iqData->sampleRate;
|
||||||
|
|
||||||
int desired_input_size = fftSizeInternal / resamplerRatio;
|
size_t desired_input_size = fftSizeInternal / resamplerRatio;
|
||||||
|
|
||||||
this->desiredInputSize.store(desired_input_size);
|
this->desiredInputSize.store(desired_input_size);
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
if (lastBandwidth!=0) {
|
if (lastBandwidth!=0) {
|
||||||
double binPerHz = double(lastBandwidth) / double(fftSizeInternal);
|
double binPerHz = double(lastBandwidth) / double(fftSizeInternal);
|
||||||
|
|
||||||
int numShift = floor(double(abs(freqDiff)) / binPerHz);
|
unsigned int numShift = floor(double(abs(freqDiff)) / binPerHz);
|
||||||
|
|
||||||
if (numShift < fftSizeInternal/2 && numShift) {
|
if (numShift < fftSizeInternal/2 && numShift) {
|
||||||
if (freqDiff > 0) {
|
if (freqDiff > 0) {
|
||||||
@ -300,7 +300,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int out_size = ceil((double) (desired_input_size) * resamplerRatio) + 512;
|
unsigned int out_size = ceil((double) (desired_input_size) * resamplerRatio) + 512;
|
||||||
|
|
||||||
if (resampleBuffer.size() != out_size) {
|
if (resampleBuffer.size() != out_size) {
|
||||||
if (resampleBuffer.capacity() < out_size) {
|
if (resampleBuffer.capacity() < out_size) {
|
||||||
@ -312,16 +312,16 @@ void SpectrumVisualProcessor::process() {
|
|||||||
msresamp_crcf_execute(resampler, &shiftBuffer[0], desired_input_size, &resampleBuffer[0], &num_written);
|
msresamp_crcf_execute(resampler, &shiftBuffer[0], desired_input_size, &resampleBuffer[0], &num_written);
|
||||||
|
|
||||||
if (num_written < fftSizeInternal) {
|
if (num_written < fftSizeInternal) {
|
||||||
for (int i = 0; i < num_written; i++) {
|
for (unsigned int i = 0; i < num_written; i++) {
|
||||||
fftInData[i][0] = resampleBuffer[i].real;
|
fftInData[i][0] = resampleBuffer[i].real;
|
||||||
fftInData[i][1] = resampleBuffer[i].imag;
|
fftInData[i][1] = resampleBuffer[i].imag;
|
||||||
}
|
}
|
||||||
for (int i = num_written; i < fftSizeInternal; i++) {
|
for (unsigned int i = num_written; i < fftSizeInternal; i++) {
|
||||||
fftInData[i][0] = 0;
|
fftInData[i][0] = 0;
|
||||||
fftInData[i][1] = 0;
|
fftInData[i][1] = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < fftSizeInternal; i++) {
|
for (unsigned int i = 0; i < fftSizeInternal; i++) {
|
||||||
fftInData[i][0] = resampleBuffer[i].real;
|
fftInData[i][0] = resampleBuffer[i].real;
|
||||||
fftInData[i][1] = resampleBuffer[i].imag;
|
fftInData[i][1] = resampleBuffer[i].imag;
|
||||||
}
|
}
|
||||||
@ -331,16 +331,16 @@ void SpectrumVisualProcessor::process() {
|
|||||||
|
|
||||||
num_written = data->size();
|
num_written = data->size();
|
||||||
if (data->size() < fftSizeInternal) {
|
if (data->size() < fftSizeInternal) {
|
||||||
for (int i = 0, iMax = data->size(); i < iMax; i++) {
|
for (size_t i = 0, iMax = data->size(); i < iMax; i++) {
|
||||||
fftInData[i][0] = (*data)[i].real;
|
fftInData[i][0] = (*data)[i].real;
|
||||||
fftInData[i][1] = (*data)[i].imag;
|
fftInData[i][1] = (*data)[i].imag;
|
||||||
}
|
}
|
||||||
for (int i = data->size(); i < fftSizeInternal; i++) {
|
for (size_t i = data->size(); i < fftSizeInternal; i++) {
|
||||||
fftInData[i][0] = 0;
|
fftInData[i][0] = 0;
|
||||||
fftInData[i][1] = 0;
|
fftInData[i][1] = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < fftSizeInternal; i++) {
|
for (unsigned int i = 0; i < fftSizeInternal; i++) {
|
||||||
fftInData[i][0] = (*data)[i].real;
|
fftInData[i][0] = (*data)[i].real;
|
||||||
fftInData[i][1] = (*data)[i].imag;
|
fftInData[i][1] = (*data)[i].imag;
|
||||||
}
|
}
|
||||||
@ -404,19 +404,19 @@ void SpectrumVisualProcessor::process() {
|
|||||||
|
|
||||||
if (newResampler && lastView) {
|
if (newResampler && lastView) {
|
||||||
if (bwDiff < 0) {
|
if (bwDiff < 0) {
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (unsigned int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
fft_result_temp[i] = fft_result_ma[(fftSizeInternal/4) + (i/2)];
|
fft_result_temp[i] = fft_result_ma[(fftSizeInternal/4) + (i/2)];
|
||||||
}
|
}
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (unsigned int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
fft_result_ma[i] = fft_result_temp[i];
|
fft_result_ma[i] = fft_result_temp[i];
|
||||||
|
|
||||||
fft_result_temp[i] = fft_result_maa[(fftSizeInternal/4) + (i/2)];
|
fft_result_temp[i] = fft_result_maa[(fftSizeInternal/4) + (i/2)];
|
||||||
}
|
}
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (unsigned int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
fft_result_maa[i] = fft_result_temp[i];
|
fft_result_maa[i] = fft_result_temp[i];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (size_t i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
if (i < fftSizeInternal/4) {
|
if (i < fftSizeInternal/4) {
|
||||||
fft_result_temp[i] = 0; // fft_result_ma[fftSizeInternal/4];
|
fft_result_temp[i] = 0; // fft_result_ma[fftSizeInternal/4];
|
||||||
} else if (i >= fftSizeInternal - fftSizeInternal/4) {
|
} else if (i >= fftSizeInternal - fftSizeInternal/4) {
|
||||||
@ -425,7 +425,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
fft_result_temp[i] = fft_result_ma[(i-fftSizeInternal/4)*2];
|
fft_result_temp[i] = fft_result_ma[(i-fftSizeInternal/4)*2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (unsigned int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
fft_result_ma[i] = fft_result_temp[i];
|
fft_result_ma[i] = fft_result_temp[i];
|
||||||
|
|
||||||
if (i < fftSizeInternal/4) {
|
if (i < fftSizeInternal/4) {
|
||||||
@ -436,7 +436,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
fft_result_temp[i] = fft_result_maa[(i-fftSizeInternal/4)*2];
|
fft_result_temp[i] = fft_result_maa[(i-fftSizeInternal/4)*2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
for (unsigned int i = 0, iMax = fftSizeInternal; i < iMax; i++) {
|
||||||
fft_result_maa[i] = fft_result_temp[i];
|
fft_result_maa[i] = fft_result_temp[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
visualAccum += visualRatio * double(SPECTRUM_VZM);
|
visualAccum += visualRatio * double(SPECTRUM_VZM);
|
||||||
|
|
||||||
while (visualAccum >= 1.0) {
|
while (visualAccum >= 1.0) {
|
||||||
int idx = round(visualStart+i);
|
unsigned int idx = round(visualStart+i);
|
||||||
if (idx > 0 && idx < fftSizeInternal) {
|
if (idx > 0 && idx < fftSizeInternal) {
|
||||||
acc += fft_result_maa[idx];
|
acc += fft_result_maa[idx];
|
||||||
if (doPeak) {
|
if (doPeak) {
|
||||||
@ -547,7 +547,7 @@ void SpectrumVisualProcessor::process() {
|
|||||||
int numSteps = (fftEnd-fftStart);
|
int numSteps = (fftEnd-fftStart);
|
||||||
int halfWay = fftStart+(numSteps/2);
|
int halfWay = fftStart+(numSteps/2);
|
||||||
|
|
||||||
if ((fftEnd+numSteps/2+1 < fftSize) && (fftStart-numSteps/2-1 >= 0) && (fftEnd > fftStart)) {
|
if ((fftEnd+numSteps/2+1 < (long long) fftSize) && (fftStart-numSteps/2-1 >= 0) && (fftEnd > fftStart)) {
|
||||||
int n = 1;
|
int n = 1;
|
||||||
for (int i = fftStart; i < halfWay; i++) {
|
for (int i = fftStart; i < halfWay; i++) {
|
||||||
output->spectrum_points[i * 2 + 1] = output->spectrum_points[(fftStart - n) * 2 + 1];
|
output->spectrum_points[i * 2 + 1] = output->spectrum_points[(fftStart - n) * 2 + 1];
|
||||||
|
@ -42,8 +42,8 @@ public:
|
|||||||
|
|
||||||
int getDesiredInputSize();
|
int getDesiredInputSize();
|
||||||
|
|
||||||
void setup(int fftSize);
|
void setup(unsigned int fftSize);
|
||||||
void setFFTSize(int fftSize);
|
void setFFTSize(unsigned int fftSize);
|
||||||
void setHideDC(bool hideDC);
|
void setHideDC(bool hideDC);
|
||||||
|
|
||||||
void setScaleFactor(float sf);
|
void setScaleFactor(float sf);
|
||||||
@ -54,8 +54,8 @@ protected:
|
|||||||
|
|
||||||
ReBuffer<SpectrumVisualData> outputBuffers;
|
ReBuffer<SpectrumVisualData> outputBuffers;
|
||||||
std::atomic_bool is_view;
|
std::atomic_bool is_view;
|
||||||
std::atomic_int fftSize, newFFTSize;
|
std::atomic_uint fftSize, newFFTSize;
|
||||||
std::atomic_int fftSizeInternal;
|
std::atomic_uint fftSizeInternal;
|
||||||
std::atomic_llong centerFreq;
|
std::atomic_llong centerFreq;
|
||||||
std::atomic_long bandwidth;
|
std::atomic_long bandwidth;
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
|||||||
results = SoapySDR::Device::enumerate();
|
results = SoapySDR::Device::enumerate();
|
||||||
}
|
}
|
||||||
|
|
||||||
int manualsIdx = results.size();
|
size_t manualsIdx = results.size();
|
||||||
std::vector<std::string> manualParams;
|
std::vector<std::string> manualParams;
|
||||||
std::vector<bool> manualResult;
|
std::vector<bool> manualResult;
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
|||||||
for (ConfigSettings::const_iterator set_i = devSettings.begin(); set_i != devSettings.end(); set_i++) {
|
for (ConfigSettings::const_iterator set_i = devSettings.begin(); set_i != devSettings.end(); set_i++) {
|
||||||
deviceArgs[set_i->first] = set_i->second;
|
deviceArgs[set_i->first] = set_i->second;
|
||||||
}
|
}
|
||||||
for (int j = 0; j < settingsInfo.size(); j++) {
|
for (size_t j = 0; j < settingsInfo.size(); j++) {
|
||||||
if (deviceArgs.find(settingsInfo[j].key) != deviceArgs.end()) {
|
if (deviceArgs.find(settingsInfo[j].key) != deviceArgs.end()) {
|
||||||
settingsInfo[j].value = deviceArgs[settingsInfo[j].key];
|
settingsInfo[j].value = deviceArgs[settingsInfo[j].key];
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ void SDRPostThread::run() {
|
|||||||
data_in->decRefCount();
|
data_in->decRefCount();
|
||||||
|
|
||||||
bool doUpdate = false;
|
bool doUpdate = false;
|
||||||
for (int j = 0; j < nRunDemods; j++) {
|
for (size_t j = 0; j < nRunDemods; j++) {
|
||||||
DemodulatorInstance *demod = runDemods[j];
|
DemodulatorInstance *demod = runDemods[j];
|
||||||
if (abs(frequency - demod->getFrequency()) > (sampleRate / 2)) {
|
if (abs(frequency - demod->getFrequency()) > (sampleRate / 2)) {
|
||||||
doUpdate = true;
|
doUpdate = true;
|
||||||
@ -214,8 +214,8 @@ void SDRPostThread::runSingleCH(SDRThreadIQData *data_in) {
|
|||||||
doRefresh.store(true);
|
doRefresh.store(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dataSize = data_in->data.size();
|
size_t dataSize = data_in->data.size();
|
||||||
int outSize = data_in->data.size();
|
size_t outSize = data_in->data.size();
|
||||||
|
|
||||||
if (outSize > dataOut.capacity()) {
|
if (outSize > dataOut.capacity()) {
|
||||||
dataOut.reserve(outSize);
|
dataOut.reserve(outSize);
|
||||||
@ -234,7 +234,7 @@ void SDRPostThread::runSingleCH(SDRThreadIQData *data_in) {
|
|||||||
doRefresh.store(false);
|
doRefresh.store(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int refCount = nRunDemods;
|
size_t refCount = nRunDemods;
|
||||||
bool doIQDataOut = (iqDataOutQueue != NULL && !iqDataOutQueue->full());
|
bool doIQDataOut = (iqDataOutQueue != NULL && !iqDataOutQueue->full());
|
||||||
bool doDemodVisOut = (nRunDemods && iqActiveDemodVisualQueue != NULL && !iqActiveDemodVisualQueue->full());
|
bool doDemodVisOut = (nRunDemods && iqActiveDemodVisualQueue != NULL && !iqActiveDemodVisualQueue->full());
|
||||||
bool doVisOut = (iqVisualQueue != NULL && !iqVisualQueue->full());
|
bool doVisOut = (iqVisualQueue != NULL && !iqVisualQueue->full());
|
||||||
@ -276,7 +276,7 @@ void SDRPostThread::runSingleCH(SDRThreadIQData *data_in) {
|
|||||||
iqVisualQueue->push(demodDataOut);
|
iqVisualQueue->push(demodDataOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nRunDemods; i++) {
|
for (size_t i = 0; i < nRunDemods; i++) {
|
||||||
runDemods[i]->getIQInputDataPipe()->push(demodDataOut);
|
runDemods[i]->getIQInputDataPipe()->push(demodDataOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,8 +290,8 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
doRefresh.store(true);
|
doRefresh.store(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dataSize = data_in->data.size();
|
size_t dataSize = data_in->data.size();
|
||||||
int outSize = data_in->data.size();
|
size_t outSize = data_in->data.size();
|
||||||
|
|
||||||
if (outSize > dataOut.capacity()) {
|
if (outSize > dataOut.capacity()) {
|
||||||
dataOut.reserve(outSize);
|
dataOut.reserve(outSize);
|
||||||
@ -349,7 +349,7 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find nearest channel for each demodulator
|
// Find nearest channel for each demodulator
|
||||||
for (int i = 0; i < nRunDemods; i++) {
|
for (size_t i = 0; i < nRunDemods; i++) {
|
||||||
DemodulatorInstance *demod = runDemods[i];
|
DemodulatorInstance *demod = runDemods[i];
|
||||||
demodChannel[i] = getChannelAt(demod->getFrequency());
|
demodChannel[i] = getChannelAt(demod->getFrequency());
|
||||||
if (demod == activeDemod) {
|
if (demod == activeDemod) {
|
||||||
@ -357,7 +357,7 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nRunDemods; i++) {
|
for (size_t i = 0; i < nRunDemods; i++) {
|
||||||
// cache channel usage refcounts
|
// cache channel usage refcounts
|
||||||
if (demodChannel[i] >= 0) {
|
if (demodChannel[i] >= 0) {
|
||||||
demodChannelActive[demodChannel[i]]++;
|
demodChannelActive[demodChannel[i]]++;
|
||||||
@ -378,7 +378,7 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
demodDataOut->sampleRate = chanBw;
|
demodDataOut->sampleRate = chanBw;
|
||||||
|
|
||||||
// Calculate channel buffer size
|
// Calculate channel buffer size
|
||||||
int chanDataSize = (outSize/numChannels);
|
size_t chanDataSize = (outSize/numChannels);
|
||||||
|
|
||||||
if (demodDataOut->data.size() != chanDataSize) {
|
if (demodDataOut->data.size() != chanDataSize) {
|
||||||
if (demodDataOut->data.capacity() < chanDataSize) {
|
if (demodDataOut->data.capacity() < chanDataSize) {
|
||||||
@ -400,13 +400,13 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
if (dcBuf.size() != chanDataSize) {
|
if (dcBuf.size() != chanDataSize) {
|
||||||
dcBuf.resize(chanDataSize);
|
dcBuf.resize(chanDataSize);
|
||||||
}
|
}
|
||||||
for (int j = 0; j < chanDataSize; j++) {
|
for (size_t j = 0; j < chanDataSize; j++) {
|
||||||
dcBuf[j] = dataOut[idx];
|
dcBuf[j] = dataOut[idx];
|
||||||
idx += numChannels;
|
idx += numChannels;
|
||||||
}
|
}
|
||||||
iirfilt_crcf_execute_block(dcFilter, &dcBuf[0], chanDataSize, &demodDataOut->data[0]);
|
iirfilt_crcf_execute_block(dcFilter, &dcBuf[0], chanDataSize, &demodDataOut->data[0]);
|
||||||
} else {
|
} else {
|
||||||
for (int j = 0; j < chanDataSize; j++) {
|
for (size_t j = 0; j < chanDataSize; j++) {
|
||||||
demodDataOut->data[j] = dataOut[idx];
|
demodDataOut->data[j] = dataOut[idx];
|
||||||
idx += numChannels;
|
idx += numChannels;
|
||||||
}
|
}
|
||||||
@ -416,7 +416,7 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
iqActiveDemodVisualQueue->push(demodDataOut);
|
iqActiveDemodVisualQueue->push(demodDataOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < nRunDemods; j++) {
|
for (size_t j = 0; j < nRunDemods; j++) {
|
||||||
if (demodChannel[j] == i) {
|
if (demodChannel[j] == i) {
|
||||||
DemodulatorInstance *demod = runDemods[j];
|
DemodulatorInstance *demod = runDemods[j];
|
||||||
demod->getIQInputDataPipe()->push(demodDataOut);
|
demod->getIQInputDataPipe()->push(demodDataOut);
|
||||||
@ -424,4 +424,4 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ private:
|
|||||||
std::vector<long long> chanCenters;
|
std::vector<long long> chanCenters;
|
||||||
long long chanBw;
|
long long chanBw;
|
||||||
|
|
||||||
int nRunDemods;
|
size_t nRunDemods;
|
||||||
std::vector<DemodulatorInstance *> runDemods;
|
std::vector<DemodulatorInstance *> runDemods;
|
||||||
std::vector<int> demodChannel;
|
std::vector<int> demodChannel;
|
||||||
std::vector<int> demodChannelActive;
|
std::vector<int> demodChannelActive;
|
||||||
|
@ -141,7 +141,7 @@ void SDRThread::init() {
|
|||||||
|
|
||||||
SoapySDR::ArgInfoList devSettings = deviceInfo.load()->getSettingsArgInfo();
|
SoapySDR::ArgInfoList devSettings = deviceInfo.load()->getSettingsArgInfo();
|
||||||
if (devSettings.size()) {
|
if (devSettings.size()) {
|
||||||
for (int j = 0; j < settingsInfo.size(); j++) {
|
for (size_t j = 0; j < settingsInfo.size(); j++) {
|
||||||
if (settings.find(settingsInfo[j].key) != settings.end()) {
|
if (settings.find(settingsInfo[j].key) != settings.end()) {
|
||||||
devSettings[j].value = settings[devSettings[j].key];
|
devSettings[j].value = settings[devSettings[j].key];
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ DataElement::~DataElement() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataElement::data_init(long data_size_in) {
|
void DataElement::data_init(size_t data_size_in) {
|
||||||
if (data_val) {
|
if (data_val) {
|
||||||
delete data_val;
|
delete data_val;
|
||||||
data_val = NULL;
|
data_val = NULL;
|
||||||
@ -62,11 +62,11 @@ int DataElement::getDataType() {
|
|||||||
return data_type;
|
return data_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
long DataElement::getDataSize() {
|
size_t DataElement::getDataSize() {
|
||||||
return data_size;
|
return data_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DataElement::getUnitSize() {
|
unsigned int DataElement::getUnitSize() {
|
||||||
return unit_size;
|
return unit_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ return; \
|
|||||||
int _compat[] = {__VA_ARGS__}; \
|
int _compat[] = {__VA_ARGS__}; \
|
||||||
if (data_type != enumtype) { \
|
if (data_type != enumtype) { \
|
||||||
bool compat = false; \
|
bool compat = false; \
|
||||||
for (int i = 0; i < sizeof(_compat)/sizeof(int); i++) { \
|
for (size_t i = 0; i < sizeof(_compat)/sizeof(int); i++) { \
|
||||||
if (_compat[i] == data_type) { \
|
if (_compat[i] == data_type) { \
|
||||||
compat = true; \
|
compat = true; \
|
||||||
break; \
|
break; \
|
||||||
@ -213,7 +213,7 @@ return; \
|
|||||||
int _compat[] = {__VA_ARGS__}; \
|
int _compat[] = {__VA_ARGS__}; \
|
||||||
if (data_type != enumtype) { \
|
if (data_type != enumtype) { \
|
||||||
bool compat = false; \
|
bool compat = false; \
|
||||||
for (int i = 0; i < sizeof(_compat)/sizeof(int); i++) { \
|
for (size_t i = 0; i < sizeof(_compat)/sizeof(int); i++) { \
|
||||||
if (_compat[i] == data_type) { \
|
if (_compat[i] == data_type) { \
|
||||||
compat = true; \
|
compat = true; \
|
||||||
break; \
|
break; \
|
||||||
@ -275,7 +275,7 @@ void DataElement::get(string &str_in) throw (DataTypeMismatchException) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DataElement::get(vector<string> &strvect_in) throw (DataTypeMismatchException) {
|
void DataElement::get(vector<string> &strvect_in) throw (DataTypeMismatchException) {
|
||||||
long ptr;
|
size_t ptr;
|
||||||
if (!data_type)
|
if (!data_type)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ if (!data_type || !unit_size) return; \
|
|||||||
if (data_type != enumtype) { \
|
if (data_type != enumtype) { \
|
||||||
int _compat[] = {__VA_ARGS__}; \
|
int _compat[] = {__VA_ARGS__}; \
|
||||||
bool compat = false; \
|
bool compat = false; \
|
||||||
for (int i = 0; i < sizeof(_compat)/sizeof(int); i++) { \
|
for (size_t i = 0; i < sizeof(_compat)/sizeof(int); i++) { \
|
||||||
if (_compat[i] == data_type) { \
|
if (_compat[i] == data_type) { \
|
||||||
compat = true; \
|
compat = true; \
|
||||||
break; \
|
break; \
|
||||||
@ -326,7 +326,7 @@ if (data_type != enumtype) { \
|
|||||||
std::cout << "Warning, data type mismatch for vector<" #datatype ">; " #datatype " size " << sizeof(datatype) << " is less than unit size " << unit_size << "; possible loss of data."; \
|
std::cout << "Warning, data type mismatch for vector<" #datatype ">; " #datatype " size " << sizeof(datatype) << " is less than unit size " << unit_size << "; possible loss of data."; \
|
||||||
} \
|
} \
|
||||||
datatype temp_val; \
|
datatype temp_val; \
|
||||||
long ptr = 0; \
|
size_t ptr = 0; \
|
||||||
while (ptr < data_size) { \
|
while (ptr < data_size) { \
|
||||||
temp_val = 0; \
|
temp_val = 0; \
|
||||||
memcpy(&temp_val, data_val + ptr, (unit_size > sizeof(datatype))?sizeof(datatype):unit_size); \
|
memcpy(&temp_val, data_val + ptr, (unit_size > sizeof(datatype))?sizeof(datatype):unit_size); \
|
||||||
@ -1551,7 +1551,7 @@ bool DataTree::SaveToFileXML(const std::string& filename) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool DataTree::SaveToFile(const std::string& filename, bool compress, int compress_level) {
|
bool DataTree::SaveToFile(const std::string& filename, bool compress, int /* compress_level */) {
|
||||||
long dataSize, compressedSize, headerSize;
|
long dataSize, compressedSize, headerSize;
|
||||||
char *serialized = nullptr, *hdr_serialized = nullptr, *compressed = nullptr;
|
char *serialized = nullptr, *hdr_serialized = nullptr, *compressed = nullptr;
|
||||||
DataTree dtHeader;
|
DataTree dtHeader;
|
||||||
|
@ -119,12 +119,12 @@ class DataElement
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int data_type;
|
int data_type;
|
||||||
long data_size;
|
size_t data_size;
|
||||||
int unit_size;
|
unsigned int unit_size;
|
||||||
|
|
||||||
char *data_val;
|
char *data_val;
|
||||||
|
|
||||||
void data_init(long data_size_in);
|
void data_init(size_t data_size_in);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DataElement();
|
DataElement();
|
||||||
@ -132,8 +132,8 @@ public:
|
|||||||
|
|
||||||
int getDataType();
|
int getDataType();
|
||||||
char *getDataPointer();
|
char *getDataPointer();
|
||||||
long getDataSize();
|
size_t getDataSize();
|
||||||
int getUnitSize();
|
unsigned int getUnitSize();
|
||||||
|
|
||||||
/* set overloads */
|
/* set overloads */
|
||||||
void set(const char &char_in);
|
void set(const char &char_in);
|
||||||
|
@ -47,7 +47,7 @@ void MouseTracker::OnMouseMoved(wxMouseEvent& event) {
|
|||||||
lastMouseY = mouseY;
|
lastMouseY = mouseY;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseTracker::OnMouseWheelMoved(wxMouseEvent& event) {
|
void MouseTracker::OnMouseWheelMoved(wxMouseEvent& /* event */) {
|
||||||
// std::cout << "wheel?" << std::endl;
|
// std::cout << "wheel?" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ void MouseTracker::OnMouseDown(wxMouseEvent& event) {
|
|||||||
isMouseDown = true;
|
isMouseDown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseTracker::OnMouseReleased(wxMouseEvent& event) {
|
void MouseTracker::OnMouseReleased(wxMouseEvent& /* event */) {
|
||||||
isMouseDown = false;
|
isMouseDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,17 +87,17 @@ void MouseTracker::OnMouseRightDown(wxMouseEvent& event) {
|
|||||||
isMouseRightDown = true;
|
isMouseRightDown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseTracker::OnMouseRightReleased(wxMouseEvent& event) {
|
void MouseTracker::OnMouseRightReleased(wxMouseEvent& /* event */) {
|
||||||
isMouseRightDown = false;
|
isMouseRightDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseTracker::OnMouseEnterWindow(wxMouseEvent& event) {
|
void MouseTracker::OnMouseEnterWindow(wxMouseEvent& /* event */) {
|
||||||
isMouseInView = true;
|
isMouseInView = true;
|
||||||
isMouseDown = false;
|
isMouseDown = false;
|
||||||
isMouseRightDown = false;
|
isMouseRightDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MouseTracker::OnMouseLeftWindow(wxMouseEvent& event) {
|
void MouseTracker::OnMouseLeftWindow(wxMouseEvent& /* event */) {
|
||||||
isMouseDown = false;
|
isMouseDown = false;
|
||||||
isMouseRightDown = false;
|
isMouseRightDown = false;
|
||||||
isMouseInView = false;
|
isMouseInView = false;
|
||||||
|
@ -112,7 +112,7 @@ void TuningContext::DrawTuner(long long freq, int count, float displayPos, float
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TuningContext::DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, RGBA4f c) {
|
void TuningContext::DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, RGBA4f /* c */) {
|
||||||
GLint vp[4];
|
GLint vp[4];
|
||||||
glGetIntegerv( GL_VIEWPORT, vp);
|
glGetIntegerv( GL_VIEWPORT, vp);
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ int TuningContext::GetTunerDigitIndex(float mPos, int count, float displayPos, f
|
|||||||
return count - index;
|
return count - index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TuningContext::DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGBA4f color, float alpha, bool top,
|
void TuningContext::DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, RGBA4f color, float /* alpha */, bool top,
|
||||||
bool bottom) {
|
bool bottom) {
|
||||||
float ofs = (displayWidth / (float) count);
|
float ofs = (displayWidth / (float) count);
|
||||||
float p2 = displayPos + ofs * (float) (count - start + 1);
|
float p2 = displayPos + ofs * (float) (count - start + 1);
|
||||||
|
@ -49,7 +49,7 @@ WaterfallCanvas::WaterfallCanvas(wxWindow *parent, int *attribList) :
|
|||||||
WaterfallCanvas::~WaterfallCanvas() {
|
WaterfallCanvas::~WaterfallCanvas() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaterfallCanvas::setup(int fft_size_in, int waterfall_lines_in) {
|
void WaterfallCanvas::setup(unsigned int fft_size_in, int waterfall_lines_in) {
|
||||||
if (fft_size == fft_size_in && waterfall_lines_in == waterfall_lines) {
|
if (fft_size == fft_size_in && waterfall_lines_in == waterfall_lines) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ void WaterfallCanvas::setup(int fft_size_in, int waterfall_lines_in) {
|
|||||||
gTimer.start();
|
gTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaterfallCanvas::setFFTSize(int fft_size_in) {
|
void WaterfallCanvas::setFFTSize(unsigned int fft_size_in) {
|
||||||
if (fft_size_in == fft_size) {
|
if (fft_size_in == fft_size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
WaterfallCanvas(wxWindow *parent, int *attribList = NULL);
|
WaterfallCanvas(wxWindow *parent, int *attribList = NULL);
|
||||||
void setup(int fft_size_in, int waterfall_lines_in);
|
void setup(unsigned int fft_size_in, int waterfall_lines_in);
|
||||||
void setFFTSize(int fft_size_in);
|
void setFFTSize(unsigned int fft_size_in);
|
||||||
~WaterfallCanvas();
|
~WaterfallCanvas();
|
||||||
|
|
||||||
DragState getDragState();
|
DragState getDragState();
|
||||||
@ -60,7 +60,7 @@ private:
|
|||||||
DragState dragState;
|
DragState dragState;
|
||||||
DragState nextDragState;
|
DragState nextDragState;
|
||||||
|
|
||||||
int fft_size, new_fft_size;
|
unsigned int fft_size, new_fft_size;
|
||||||
int waterfall_lines;
|
int waterfall_lines;
|
||||||
int dragOfs;
|
int dragOfs;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user