Fixed minors.

master
Hannes Matuschek 12 years ago
parent 5c865488fe
commit f40f04c52d

@ -44,7 +44,7 @@ public:
_buffer = Buffer<Scalar>(src_cfg.bufferSize());
LogMessage msg(LOG_DEBUG);
msg << "Configure AMDemod:" << std::endl
msg << "Configure AMDemod: " << this << std::endl
<< " input type: " << Traits< std::complex<Scalar> >::scalarId << std::endl
<< " output type: " << Traits<Scalar>::scalarId << std::endl
<< " sample rate: " << src_cfg.sampleRate() << std::endl
@ -128,7 +128,7 @@ public:
_buffer = Buffer<Scalar>(src_cfg.bufferSize());
LogMessage msg(LOG_DEBUG);
msg << "Configure USBDemod:" << std::endl
msg << "Configure USBDemod: " << this << std::endl
<< " input type: " << Traits< std::complex<Scalar> >::scalarId << std::endl
<< " output type: " << Traits<Scalar>::scalarId << std::endl
<< " sample rate: " << src_cfg.sampleRate() << std::endl
@ -216,7 +216,7 @@ public:
_can_overwrite = (sizeof(std::complex<iScalar>) >= sizeof(oScalar));
LogMessage msg(LOG_DEBUG);
msg << "Configured FMDemod node:" << std::endl
msg << "Configured FMDemod node: " << this << std::endl
<< " sample-rate: " << src_cfg.sampleRate() << std::endl
<< " in-type / out-type: " << src_cfg.type()
<< " / " << Config::typeId<oScalar>() << std::endl

@ -102,6 +102,7 @@ WaterFallView::_onSpectrumUpdated() {
for (size_t i=0; i<_N; i++) {
int idx = (_spectrum->fftSize()/2+i) % _spectrum->fftSize();
double value = 10*log10(_spectrum->spectrum()[idx])-10*log10(_N);
if (value != value) { value = 0; }
painter.setPen((*_colorMap)(value));
painter.drawPoint(i, _M-1);
}

@ -73,10 +73,11 @@ Source::send(const RawBuffer &buffer, bool allow_overwrite) {
// iff, the sink is the only one receiving this buffer, the source allows it and the
// connection is direct.
allow_overwrite = allow_overwrite && (1 == _sinks.size());
// Call sink directly
item->first->handleBuffer(buffer, allow_overwrite);
}
// otherwise, queue buffer
else {
// otherwise, queue buffer
allow_overwrite = allow_overwrite && (1 == _sinks.size());
Queue::get().send(buffer, item->first, allow_overwrite);
}

@ -68,8 +68,15 @@ Queue::stop() {
void
Queue::wait() {
void *p;
pthread_join(_thread, &p);
// Wait for the queue to quit
void *p; pthread_join(_thread, &p);
// Clear queue.
std::list<Message>::iterator item = _queue.begin();
for (; item != _queue.end(); item++) {
item->buffer().unref();
}
_queue.clear();
}
@ -110,7 +117,11 @@ Queue::_main()
}
// Call all stop-signal handlers
_signalStop();
Logger::get().log(LogMessage(LOG_DEBUG, "Queue stopped."));
{
LogMessage msg(LOG_DEBUG, "Queue stopped.");
msg << " Messages left in queue: " << _queue.size();
Logger::get().log(msg);
}
}
void

@ -80,8 +80,11 @@ RTLSource::setSampleRate(double sample_rate) {
if (sr < 225001) { sr = 225001; }
else if ((sr>300000) && (sr<900001)) { sr = 900001; }
else if (sr>2400000) { sr = 2400000; }
rtlsdr_set_sample_rate(_device, sr);
rtlsdr_reset_buffer(_device);
_sample_rate = rtlsdr_get_sample_rate(_device);
this->setConfig(Config(Config::Type_cu8, _sample_rate, _buffer_size, 15));
}
@ -110,7 +113,9 @@ RTLSource::stop() {
void *p;
// stop async reading of RTL device
rtlsdr_cancel_async(_device);
// Wait for blocked thread to exit
// Wait for blocked thread to exit:
// This is important to ensure that no new messages are added to the
// queue after this function returned.
pthread_join(_thread, &p);
}

Loading…
Cancel
Save