mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
Tx ph.1: Fixes to file sink GUI and some debug messages
This commit is contained in:
parent
8f8f4c2d96
commit
119127fdab
@ -40,6 +40,7 @@ FileSinkGui::FileSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_deviceSampleSink(0),
|
||||
m_sampleRate(0),
|
||||
m_generation(false),
|
||||
m_fileName("./test.sdriq"),
|
||||
m_startingTimeStamp(0),
|
||||
@ -59,14 +60,16 @@ FileSinkGui::FileSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
}
|
||||
|
||||
connect(&(m_deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
m_statusTimer.start(500);
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_deviceSampleSink = new FileSinkOutput(m_deviceAPI, m_deviceAPI->getMainWindow()->getMasterTimer());
|
||||
connect(m_deviceSampleSink->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSinkMessages()));
|
||||
m_deviceAPI->setSink(m_deviceSampleSink);
|
||||
|
||||
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
FileSinkGui::~FileSinkGui()
|
||||
@ -145,21 +148,34 @@ bool FileSinkGui::handleMessage(const Message& message)
|
||||
}
|
||||
}
|
||||
|
||||
void FileSinkGui::handleSinkMessages()
|
||||
void FileSinkGui::handleDSPMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_deviceSampleSink->getOutputMessageQueueToGUI()->pop()) != 0)
|
||||
while ((message = m_deviceAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
||||
{
|
||||
//qDebug("FileSourceGui::handleSourceMessages: message: %s", message->getIdentifier());
|
||||
qDebug("FileSinkGui::handleDSPMessages: message: %s", message->getIdentifier());
|
||||
|
||||
if (handleMessage(*message))
|
||||
if (DSPSignalNotification::match(*message))
|
||||
{
|
||||
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
||||
qDebug("FileSinkGui::handleDSPMessages: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
|
||||
m_sampleRate = notif->getSampleRate();
|
||||
m_deviceCenterFrequency = notif->getCenterFrequency();
|
||||
updateSampleRateAndFrequency();
|
||||
|
||||
delete message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FileSinkGui::updateSampleRateAndFrequency()
|
||||
{
|
||||
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
|
||||
}
|
||||
|
||||
void FileSinkGui::displaySettings()
|
||||
{
|
||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||
@ -169,8 +185,17 @@ void FileSinkGui::displaySettings()
|
||||
|
||||
void FileSinkGui::sendSettings()
|
||||
{
|
||||
if(!m_updateTimer.isActive())
|
||||
m_updateTimer.start(100);
|
||||
}
|
||||
|
||||
|
||||
void FileSinkGui::updateHardware()
|
||||
{
|
||||
qDebug() << "FileSinkGui::updateHardware";
|
||||
FileSinkOutput::MsgConfigureFileSink* message = FileSinkOutput::MsgConfigureFileSink::create(m_settings);
|
||||
m_deviceSampleSink->getInputMessageQueue()->push(message);
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
void FileSinkGui::updateStatus()
|
||||
|
@ -55,9 +55,12 @@ private:
|
||||
DeviceSinkAPI* m_deviceAPI;
|
||||
FileSinkSettings m_settings;
|
||||
QString m_fileName;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
std::vector<int> m_gains;
|
||||
DeviceSampleSink* m_deviceSampleSink;
|
||||
int m_sampleRate;
|
||||
quint64 m_deviceCenterFrequency; //!< Center frequency in device
|
||||
bool m_generation;
|
||||
std::time_t m_startingTimeStamp;
|
||||
int m_samplesCount;
|
||||
@ -70,13 +73,15 @@ private:
|
||||
void configureFileName();
|
||||
void updateWithGeneration();
|
||||
void updateWithStreamTime();
|
||||
void updateSampleRateAndFrequency();
|
||||
|
||||
private slots:
|
||||
void handleSinkMessages();
|
||||
void handleDSPMessages();
|
||||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_showFileDialog_clicked(bool checked);
|
||||
void on_sampleRate_currentIndexChanged(int index);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
void tick();
|
||||
};
|
||||
|
@ -47,7 +47,7 @@
|
||||
<item>
|
||||
<widget class="ButtonSwitch" name="startStop">
|
||||
<property name="toolTip">
|
||||
<string>start/stop acquisition</string>
|
||||
<string>start/stop generation</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -55,7 +55,7 @@
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||
<normaloff>:/record_off.png</normaloff>
|
||||
<normalon>:/record_on.png</normalon>:/record_off.png</iconset>
|
||||
<normalon>:/stop.png</normalon>:/record_off.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -154,6 +154,7 @@ bool FileSinkOutput::handleMessage(const Message& message)
|
||||
}
|
||||
else if (MsgConfigureFileSink::match(message))
|
||||
{
|
||||
qDebug() << "FileSinkOutput::handleMessage: MsgConfigureFileSink";
|
||||
MsgConfigureFileSink& conf = (MsgConfigureFileSink&) message;
|
||||
applySettings(conf.getSettings(), false);
|
||||
return true;
|
||||
@ -214,6 +215,9 @@ void FileSinkOutput::applySettings(const FileSinkSettings& settings, bool force)
|
||||
|
||||
if (forwardChange)
|
||||
{
|
||||
qDebug("FileSinkOutput::applySettings: forward: m_centerFrequency: %llu m_sampleRate: %d",
|
||||
m_settings.m_centerFrequency,
|
||||
m_settings.m_sampleRate);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(m_settings.m_sampleRate, m_settings.m_centerFrequency);
|
||||
m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ void DSPDeviceSinkEngine::handleData()
|
||||
void DSPDeviceSinkEngine::handleSynchronousMessages()
|
||||
{
|
||||
Message *message = m_syncMessenger.getMessage();
|
||||
qDebug() << "DSPDeviceSourceEngine::handleSynchronousMessages: " << message->getIdentifier();
|
||||
qDebug() << "DSPDeviceSinkEngine::handleSynchronousMessages: " << message->getIdentifier();
|
||||
|
||||
if (DSPExit::match(*message))
|
||||
{
|
||||
@ -534,14 +534,6 @@ void DSPDeviceSinkEngine::handleInputMessages()
|
||||
(*it)->handleSourceMessage(*message);
|
||||
}
|
||||
|
||||
// forward source changes to sinks with immediate execution
|
||||
|
||||
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
|
||||
{
|
||||
qDebug() << "DSPDeviceSourceEngine::handleInputMessages: forward message to " << (*it)->objectName().toStdString().c_str();
|
||||
(*it)->handleMessage(*message);
|
||||
}
|
||||
|
||||
// forward changes to listeners on DSP output queue
|
||||
|
||||
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the output queue
|
||||
|
@ -164,7 +164,7 @@ void UpChannelizer::applyConfiguration()
|
||||
|
||||
qDebug() << "UpChannelizer::applyConfiguration in=" << m_outputSampleRate
|
||||
<< ", req=" << m_requestedInputSampleRate
|
||||
<< ", out=" << m_requestedInputSampleRate
|
||||
<< ", out=" << m_currentInputSampleRate
|
||||
<< ", fc=" << m_currentCenterFrequency;
|
||||
|
||||
if (m_sampleSource != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user