mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 07:24:44 -04:00
Airspy: refactoring: device open close moved in the constructor and destructor respectively of the input object
This commit is contained in:
@@ -38,7 +38,10 @@ AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
m_sampleSource(0),
|
||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_sampleSource = new AirspyInput(m_deviceAPI);
|
||||
m_deviceAPI->setSource(m_sampleSource);
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||
ui->centerFrequency->setValueRange(7, 24000U, 1900000U);
|
||||
|
||||
@@ -48,11 +51,9 @@ AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_sampleSource = new AirspyInput(m_deviceAPI);
|
||||
m_rates = ((AirspyInput*) m_sampleSource)->getSampleRates();
|
||||
displaySampleRates();
|
||||
connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
m_deviceAPI->setSource(m_sampleSource);
|
||||
|
||||
char recFileNameCStr[30];
|
||||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
@@ -123,17 +124,18 @@ bool AirspyGui::deserialize(const QByteArray& data)
|
||||
|
||||
bool AirspyGui::handleMessage(const Message& message)
|
||||
{
|
||||
if (AirspyInput::MsgReportAirspy::match(message))
|
||||
{
|
||||
qDebug() << "AirspyGui::handleMessage: MsgReportAirspy";
|
||||
m_rates = ((AirspyInput::MsgReportAirspy&) message).getSampleRates();
|
||||
displaySampleRates();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
// if (AirspyInput::MsgReportAirspy::match(message))
|
||||
// {
|
||||
// qDebug() << "AirspyGui::handleMessage: MsgReportAirspy";
|
||||
// m_rates = ((AirspyInput::MsgReportAirspy&) message).getSampleRates();
|
||||
// displaySampleRates();
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
void AirspyGui::handleDSPMessages()
|
||||
|
||||
Reference in New Issue
Block a user