mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
SDRDaemonSink: refactoring (2)
This commit is contained in:
parent
af5e61ca48
commit
a8d45fd253
@ -43,7 +43,6 @@ SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_deviceUISet(deviceUISet),
|
||||
m_settings(),
|
||||
m_deviceSampleSink(0),
|
||||
m_sampleRate(0),
|
||||
m_samplesCount(0),
|
||||
m_tickCount(0),
|
||||
m_nbSinceLastFlowCheck(0),
|
||||
@ -193,9 +192,9 @@ void SDRdaemonSinkGui::handleInputMessages()
|
||||
if (DSPSignalNotification::match(*message))
|
||||
{
|
||||
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
||||
qDebug("SDRdaemonSinkGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
|
||||
m_sampleRate = notif->getSampleRate();
|
||||
m_deviceCenterFrequency = notif->getCenterFrequency();
|
||||
qDebug("SDRdaemonSinkGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
|
||||
updateSampleRateAndFrequency();
|
||||
|
||||
delete message;
|
||||
@ -224,9 +223,9 @@ void SDRdaemonSinkGui::updateTxDelayTooltip()
|
||||
|
||||
void SDRdaemonSinkGui::displaySettings()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||
ui->sampleRate->setValue(m_settings.m_sampleRate);
|
||||
ui->deviceRateText->setText(tr("%1k").arg((float)(m_sampleRate) / 1000));
|
||||
ui->txDelay->setValue(m_settings.m_txDelay*100);
|
||||
ui->txDelayText->setText(tr("%1").arg(m_settings.m_txDelay*100));
|
||||
ui->nbFECBlocks->setValue(m_settings.m_nbFECBlocks);
|
||||
@ -239,6 +238,7 @@ void SDRdaemonSinkGui::displaySettings()
|
||||
ui->apiPort->setText(tr("%1").arg(m_settings.m_apiPort));
|
||||
ui->dataAddress->setText(m_settings.m_dataAddress);
|
||||
ui->dataPort->setText(tr("%1").arg(m_settings.m_dataPort));
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
void SDRdaemonSinkGui::sendSettings()
|
||||
|
@ -86,6 +86,7 @@ void SDRdaemonSinkThread::setSamplerate(int samplerate)
|
||||
|
||||
m_samplerate = samplerate;
|
||||
m_samplesChunkSize = (m_samplerate * m_throttlems) / 1000;
|
||||
m_udpSinkFEC.setSampleRate(m_samplerate);
|
||||
|
||||
if (wasRunning) {
|
||||
startWork();
|
||||
@ -126,12 +127,6 @@ void SDRdaemonSinkThread::tick()
|
||||
m_throttleToggle = !m_throttleToggle;
|
||||
}
|
||||
|
||||
// if (m_throttlems > m_maxThrottlems)
|
||||
// {
|
||||
// qDebug("FileSinkThread::tick: m_maxThrottlems: %d", m_maxThrottlems);
|
||||
// m_maxThrottlems = m_throttlems;
|
||||
// }
|
||||
|
||||
SampleVector::iterator readUntil;
|
||||
|
||||
m_sampleFifo->readAdvance(readUntil, m_samplesChunkSize); // pull samples
|
||||
@ -139,43 +134,5 @@ void SDRdaemonSinkThread::tick()
|
||||
m_samplesCount += m_samplesChunkSize;
|
||||
|
||||
m_udpSinkFEC.write(beginRead, m_samplesChunkSize);
|
||||
// m_ofstream->write(reinterpret_cast<char*>(&(*beginRead)), m_samplesChunkSize*sizeof(Sample)); // send samples
|
||||
|
||||
// interpolation is done on the far side
|
||||
// if (m_log2Interpolation == 0)
|
||||
// {
|
||||
// m_ofstream->write(reinterpret_cast<char*>(&(*beginRead)), m_samplesChunkSize*sizeof(Sample)); // send samples
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// int chunkSize = std::min((int) m_samplesChunkSize, m_samplerate);
|
||||
//
|
||||
// switch (m_log2Interpolation)
|
||||
// {
|
||||
// case 1:
|
||||
// m_interpolators.interpolate2_cen(&beginRead, m_buf, chunkSize*(1<<m_log2Interpolation)*2);
|
||||
// break;
|
||||
// case 2:
|
||||
// m_interpolators.interpolate4_cen(&beginRead, m_buf, chunkSize*(1<<m_log2Interpolation)*2);
|
||||
// break;
|
||||
// case 3:
|
||||
// m_interpolators.interpolate8_cen(&beginRead, m_buf, chunkSize*(1<<m_log2Interpolation)*2);
|
||||
// break;
|
||||
// case 4:
|
||||
// m_interpolators.interpolate16_cen(&beginRead, m_buf, chunkSize*(1<<m_log2Interpolation)*2);
|
||||
// break;
|
||||
// case 5:
|
||||
// m_interpolators.interpolate32_cen(&beginRead, m_buf, chunkSize*(1<<m_log2Interpolation)*2);
|
||||
// break;
|
||||
// case 6:
|
||||
// m_interpolators.interpolate64_cen(&beginRead, m_buf, chunkSize*(1<<m_log2Interpolation)*2);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// m_ofstream->write(reinterpret_cast<char*>(m_buf), m_samplesChunkSize*(1<<m_log2Interpolation)*2*sizeof(int16_t)); // send samples
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user