mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
File sample source plugin now functional
This commit is contained in:
parent
047e9f3e24
commit
110956ba9c
@ -127,8 +127,8 @@ Done since the fork
|
|||||||
- Spectrum histogram clear
|
- Spectrum histogram clear
|
||||||
- Trigger line display for all trigger modes
|
- Trigger line display for all trigger modes
|
||||||
- Coarse and fine trigger level sliders
|
- Coarse and fine trigger level sliders
|
||||||
- Minimalist recording
|
- Minimalist recording (no file choice)
|
||||||
- Minimalist file source (recording reader) compilable but untested
|
- File sample source plugin (recording reader)
|
||||||
|
|
||||||
=====
|
=====
|
||||||
To Do
|
To Do
|
||||||
|
@ -38,13 +38,15 @@ FileSourceGui::FileSourceGui(PluginAPI* pluginAPI, QWidget* parent) :
|
|||||||
m_sampleRate(0),
|
m_sampleRate(0),
|
||||||
m_centerFrequency(0),
|
m_centerFrequency(0),
|
||||||
m_startingTimeStamp(0),
|
m_startingTimeStamp(0),
|
||||||
m_samplesCount(0)
|
m_samplesCount(0),
|
||||||
|
m_tickCount(0)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||||
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
|
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
|
||||||
ui->fileNameText->setText(m_fileName);
|
ui->fileNameText->setText(m_fileName);
|
||||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||||
|
connect(&(m_pluginAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
|
||||||
displaySettings();
|
displaySettings();
|
||||||
|
|
||||||
m_sampleSource = new FileSourceInput(m_pluginAPI->getMainWindowMessageQueue(), m_pluginAPI->getMainWindow()->getMasterTimer());
|
m_sampleSource = new FileSourceInput(m_pluginAPI->getMainWindowMessageQueue(), m_pluginAPI->getMainWindow()->getMasterTimer());
|
||||||
@ -133,15 +135,17 @@ bool FileSourceGui::handleMessage(Message* message)
|
|||||||
m_sampleRate = ((FileSourceInput::MsgReportFileSourceStreamData*)message)->getSampleRate();
|
m_sampleRate = ((FileSourceInput::MsgReportFileSourceStreamData*)message)->getSampleRate();
|
||||||
m_centerFrequency = ((FileSourceInput::MsgReportFileSourceStreamData*)message)->getCenterFrequency();
|
m_centerFrequency = ((FileSourceInput::MsgReportFileSourceStreamData*)message)->getCenterFrequency();
|
||||||
m_startingTimeStamp = ((FileSourceInput::MsgReportFileSourceStreamData*)message)->getStartingTimeStamp();
|
m_startingTimeStamp = ((FileSourceInput::MsgReportFileSourceStreamData*)message)->getStartingTimeStamp();
|
||||||
updateWithStreamData();
|
|
||||||
message->completed();
|
message->completed();
|
||||||
|
updateWithStreamData();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if(FileSourceInput::MsgReportFileSourceStreamTiming::match(message))
|
else if(FileSourceInput::MsgReportFileSourceStreamTiming::match(message))
|
||||||
{
|
{
|
||||||
m_samplesCount = ((FileSourceInput::MsgReportFileSourceStreamTiming*)message)->getSamplesCount();
|
m_samplesCount = ((FileSourceInput::MsgReportFileSourceStreamTiming*)message)->getSamplesCount();
|
||||||
std::cerr << "FileSourceGui::handleMessage: MsgReportFileSourceStreamTiming: " << m_samplesCount << std::endl;
|
//std::cerr << "FileSourceGui::handleMessage: MsgReportFileSourceStreamTiming: " << m_samplesCount << std::endl;
|
||||||
|
message->completed();
|
||||||
updateWithStreamTime();
|
updateWithStreamTime();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -234,3 +238,11 @@ void FileSourceGui::updateWithStreamTime()
|
|||||||
QString s_date = dt.toString("yyyyMMdd hh.mm.ss.zzz");
|
QString s_date = dt.toString("yyyyMMdd hh.mm.ss.zzz");
|
||||||
ui->absTimeText->setText(s_date);
|
ui->absTimeText->setText(s_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileSourceGui::tick()
|
||||||
|
{
|
||||||
|
if ((++m_tickCount & 0xf) == 0) {
|
||||||
|
FileSourceInput::MsgConfigureFileSourceStreamTiming* message = FileSourceInput::MsgConfigureFileSourceStreamTiming::create();
|
||||||
|
message->submit(m_pluginAPI->getDSPEngineMessageQueue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -62,6 +62,7 @@ private:
|
|||||||
quint64 m_centerFrequency;
|
quint64 m_centerFrequency;
|
||||||
std::time_t m_startingTimeStamp;
|
std::time_t m_startingTimeStamp;
|
||||||
int m_samplesCount;
|
int m_samplesCount;
|
||||||
|
std::size_t m_tickCount;
|
||||||
|
|
||||||
void displaySettings();
|
void displaySettings();
|
||||||
void displayTime();
|
void displayTime();
|
||||||
@ -76,6 +77,7 @@ private slots:
|
|||||||
void on_playLoop_toggled(bool checked);
|
void on_playLoop_toggled(bool checked);
|
||||||
void on_play_toggled(bool checked);
|
void on_play_toggled(bool checked);
|
||||||
void on_showFileDialog_clicked(bool checked);
|
void on_showFileDialog_clicked(bool checked);
|
||||||
|
void tick();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INCLUDE_FILESOURCEGUI_H
|
#endif // INCLUDE_FILESOURCEGUI_H
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSource, Message)
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSource, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceName, Message)
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceName, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceWork, Message)
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceWork, Message)
|
||||||
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceStreamTiming, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceAcquisition, Message)
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceAcquisition, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamData, Message)
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamData, Message)
|
||||||
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamTiming, Message)
|
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamTiming, Message)
|
||||||
@ -217,6 +218,14 @@ bool FileSourceInput::handleMessage(Message* message)
|
|||||||
message->completed();
|
message->completed();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (MsgConfigureFileSourceStreamTiming::match(message))
|
||||||
|
{
|
||||||
|
if (m_fileSourceThread != 0) {
|
||||||
|
MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount())->submit(m_guiMessageQueue);
|
||||||
|
}else {
|
||||||
|
MsgReportFileSourceStreamTiming::create(0)->submit(m_guiMessageQueue);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -100,6 +100,23 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MsgConfigureFileSourceStreamTiming : public Message {
|
||||||
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
static MsgConfigureFileSourceStreamTiming* create()
|
||||||
|
{
|
||||||
|
return new MsgConfigureFileSourceStreamTiming();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
MsgConfigureFileSourceStreamTiming() :
|
||||||
|
Message()
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
class MsgReportFileSourceAcquisition : public Message {
|
class MsgReportFileSourceAcquisition : public Message {
|
||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user