mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-23 20:58:42 -04:00
New AMBE engine (3)
This commit is contained in:
parent
f04b6eb975
commit
144b0db196
sdrbase
ambe
dsp
resources/webapi/doc
settings
sdrbench
sdrgui
sdrsrv
swagger/sdrangel
@ -33,7 +33,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
#include <QThread>
|
||||
#include <QBuffer>
|
||||
#include <QDataStream>
|
||||
|
||||
#include "ambeworker.h"
|
||||
#include "ambeengine.h"
|
||||
@ -42,10 +47,12 @@ AMBEEngine::AMBEEngine()
|
||||
{}
|
||||
|
||||
AMBEEngine::~AMBEEngine()
|
||||
{}
|
||||
{
|
||||
qDebug("AMBEEngine::~AMBEEngine: %lu controllers", m_controllers.size());
|
||||
}
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
void DVSerialEngine::getComList()
|
||||
void AMBEEngine::getComList()
|
||||
{
|
||||
m_comList.clear();
|
||||
m_comList8250.clear();
|
||||
@ -100,8 +107,8 @@ void AMBEEngine::getComList()
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
void AMBEEngine::register_comport(
|
||||
std::list<std::string>& comList,
|
||||
std::list<std::string>& comList8250,
|
||||
std::vector<std::string>& comList,
|
||||
std::vector<std::string>& comList8250,
|
||||
const std::string& dir)
|
||||
{
|
||||
// Get the driver the device is using
|
||||
@ -123,11 +130,11 @@ void AMBEEngine::register_comport(
|
||||
}
|
||||
|
||||
void AMBEEngine::probe_serial8250_comports(
|
||||
std::list<std::string>& comList,
|
||||
std::list<std::string> comList8250)
|
||||
std::vector<std::string>& comList,
|
||||
std::vector<std::string> comList8250)
|
||||
{
|
||||
struct serial_struct serinfo;
|
||||
std::list<std::string>::iterator it = comList8250.begin();
|
||||
std::vector<std::string>::iterator it = comList8250.begin();
|
||||
|
||||
// Iterate over all serial8250-devices
|
||||
while (it != comList8250.end())
|
||||
@ -177,16 +184,17 @@ std::string AMBEEngine::get_driver(const std::string& tty)
|
||||
}
|
||||
#endif // not Windows
|
||||
|
||||
bool AMBEEngine::scan(std::vector<QString>& ambeDevices)
|
||||
void AMBEEngine::scan(std::vector<QString>& ambeDevices)
|
||||
{
|
||||
getComList();
|
||||
std::list<std::string>::const_iterator it = m_comList.begin();
|
||||
std::vector<std::string>::const_iterator it = m_comList.begin();
|
||||
ambeDevices.clear();
|
||||
|
||||
while (it != m_comList.end())
|
||||
{
|
||||
AMBEWorker *worker = new AMBEWorker();
|
||||
qDebug("AMBEEngine::scan: com: %s", it->c_str());
|
||||
|
||||
if (worker->open(*it))
|
||||
{
|
||||
ambeDevices.push_back(QString(it->c_str()));
|
||||
@ -214,6 +222,7 @@ bool AMBEEngine::registerController(const std::string& deviceRef)
|
||||
connect(m_controllers.back().worker, SIGNAL(finished()), m_controllers.back().worker, SLOT(deleteLater()));
|
||||
connect(m_controllers.back().thread, SIGNAL(finished()), m_controllers.back().thread, SLOT(deleteLater()));
|
||||
connect(&m_controllers.back().worker->m_inputMessageQueue, SIGNAL(messageEnqueued()), m_controllers.back().worker, SLOT(handleInputMessages()));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
m_controllers.back().thread->start();
|
||||
|
||||
return true;
|
||||
@ -224,7 +233,6 @@ bool AMBEEngine::registerController(const std::string& deviceRef)
|
||||
|
||||
void AMBEEngine::releaseController(const std::string& deviceRef)
|
||||
{
|
||||
qDebug("AMBEEngine::releaseController");
|
||||
std::vector<AMBEController>::iterator it = m_controllers.begin();
|
||||
|
||||
while (it != m_controllers.end())
|
||||
@ -237,7 +245,7 @@ void AMBEEngine::releaseController(const std::string& deviceRef)
|
||||
it->worker->m_inputMessageQueue.clear();
|
||||
it->worker->close();
|
||||
m_controllers.erase(it);
|
||||
qDebug() << "DVSerialEngine::releaseController: closed device at: " << it->device.c_str();
|
||||
qDebug() << "AMBEEngine::releaseController: closed device at: " << it->device.c_str();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -247,7 +255,6 @@ void AMBEEngine::releaseController(const std::string& deviceRef)
|
||||
|
||||
void AMBEEngine::releaseAll()
|
||||
{
|
||||
qDebug("AMBEEngine::releaseAll");
|
||||
std::vector<AMBEController>::iterator it = m_controllers.begin();
|
||||
|
||||
while (it != m_controllers.end())
|
||||
@ -257,7 +264,7 @@ void AMBEEngine::releaseAll()
|
||||
it->thread->wait(100);
|
||||
it->worker->m_inputMessageQueue.clear();
|
||||
it->worker->close();
|
||||
qDebug() << "DVSerialEngine::release: closed device at: " << it->device.c_str();
|
||||
qDebug() << "AMBEEngine::release: closed device at: " << it->device.c_str();
|
||||
++it;
|
||||
}
|
||||
|
||||
@ -319,3 +326,47 @@ void AMBEEngine::pushMbeFrame(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray AMBEEngine::serialize() const
|
||||
{
|
||||
QStringList qDeviceList;
|
||||
std::vector<AMBEController>::const_iterator it = m_controllers.begin();
|
||||
|
||||
while (it != m_controllers.end())
|
||||
{
|
||||
qDebug("AMBEEngine::serialize: %s", it->device.c_str());
|
||||
qDeviceList << QString(it->device.c_str());
|
||||
++it;
|
||||
}
|
||||
|
||||
QByteArray data;
|
||||
QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly);
|
||||
(*stream) << qDeviceList;
|
||||
delete stream;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
bool AMBEEngine::deserialize(const QByteArray& data)
|
||||
{
|
||||
if (data.size() <= 0)
|
||||
{
|
||||
qDebug("AMBEEngine::deserialize: invalid or no data");
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList qDeviceList;
|
||||
QDataStream *stream = new QDataStream(data);
|
||||
(*stream) >> qDeviceList;
|
||||
delete stream;
|
||||
|
||||
releaseAll();
|
||||
|
||||
for (int i = 0; i < qDeviceList.size(); ++i)
|
||||
{
|
||||
qDebug(" AMBEEngine::deserialize: %s", qDeviceList.at(i).toStdString().c_str());
|
||||
registerController(qDeviceList.at(i).toStdString());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -21,11 +21,11 @@
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
@ -40,7 +40,7 @@ public:
|
||||
AMBEEngine();
|
||||
~AMBEEngine();
|
||||
|
||||
bool scan(std::vector<QString>& ambeDevices);
|
||||
void scan(std::vector<QString>& ambeDevices);
|
||||
void releaseAll();
|
||||
|
||||
int getNbDevices() const { return m_controllers.size(); } //!< number of devices used
|
||||
@ -57,9 +57,17 @@ public:
|
||||
int upsampling,
|
||||
AudioFifo *audioFifo);
|
||||
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
|
||||
private:
|
||||
struct AMBEController
|
||||
{
|
||||
AMBEController() :
|
||||
thread(nullptr),
|
||||
worker(nullptr)
|
||||
{}
|
||||
|
||||
QThread *thread;
|
||||
AMBEWorker *worker;
|
||||
std::string device;
|
||||
@ -67,14 +75,14 @@ private:
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
static std::string get_driver(const std::string& tty);
|
||||
static void register_comport(std::list<std::string>& comList, std::list<std::string>& comList8250, const std::string& dir);
|
||||
static void probe_serial8250_comports(std::list<std::string>& comList, std::list<std::string> comList8250);
|
||||
static void register_comport(std::vector<std::string>& comList, std::vector<std::string>& comList8250, const std::string& dir);
|
||||
static void probe_serial8250_comports(std::vector<std::string>& comList, std::vector<std::string> comList8250);
|
||||
#endif
|
||||
void getComList();
|
||||
|
||||
std::list<std::string> m_comList;
|
||||
std::list<std::string> m_comList8250;
|
||||
std::vector<AMBEController> m_controllers;
|
||||
std::vector<std::string> m_comList;
|
||||
std::vector<std::string> m_comList8250;
|
||||
QMutex m_mutex;
|
||||
};
|
||||
|
||||
|
@ -200,7 +200,7 @@ void AMBEWorker::noUpsample(short *in, int nbSamplesIn, unsigned char channels)
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("DVSerialWorker::noUpsample: audio buffer is full check its size");
|
||||
qDebug("AMBEWorker::noUpsample: audio buffer is full check its size");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -155,44 +155,25 @@ DSPDeviceMIMOEngine *DSPEngine::getDeviceMIMOEngineByUID(uint uid)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
void DSPEngine::setDVSerialSupport(bool support)
|
||||
{
|
||||
if (support)
|
||||
{
|
||||
m_dvSerialSupport = m_dvSerialEngine.scan();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dvSerialEngine.release();
|
||||
m_dvSerialSupport = false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
void DSPEngine::setDVSerialSupport(bool support)
|
||||
{ (void) support; }
|
||||
#endif
|
||||
|
||||
bool DSPEngine::hasDVSerialSupport()
|
||||
{
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
return m_dvSerialSupport;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
return m_ambeEngine.getNbDevices() > 0;
|
||||
}
|
||||
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
void DSPEngine::setDVSerialSupport(bool support)
|
||||
{ (void) support; }
|
||||
|
||||
void DSPEngine::getDVSerialNames(std::vector<std::string>& deviceNames)
|
||||
{
|
||||
m_dvSerialEngine.getDevicesNames(deviceNames);
|
||||
}
|
||||
#else
|
||||
void DSPEngine::getDVSerialNames(std::vector<std::string>& deviceNames)
|
||||
{ (void) deviceNames; }
|
||||
#endif
|
||||
std::vector<QString> qDeviceRefs;
|
||||
m_ambeEngine.getDeviceRefs(qDeviceRefs);
|
||||
deviceNames.clear();
|
||||
|
||||
for (std::vector<QString>::const_iterator it = qDeviceRefs.begin(); it != qDeviceRefs.end(); ++it) {
|
||||
deviceNames.push_back(it->toStdString());
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
void DSPEngine::pushMbeFrame(
|
||||
const unsigned char *mbeFrame,
|
||||
int mbeRateIndex,
|
||||
@ -202,24 +183,5 @@ void DSPEngine::pushMbeFrame(
|
||||
int upsampling,
|
||||
AudioFifo *audioFifo)
|
||||
{
|
||||
m_dvSerialEngine.pushMbeFrame(mbeFrame, mbeRateIndex, mbeVolumeIndex, channels, useHP, upsampling, audioFifo);
|
||||
m_ambeEngine.pushMbeFrame(mbeFrame, mbeRateIndex, mbeVolumeIndex, channels, useHP, upsampling, audioFifo);
|
||||
}
|
||||
#else
|
||||
void DSPEngine::pushMbeFrame(
|
||||
const unsigned char *mbeFrame,
|
||||
int mbeRateIndex,
|
||||
int mbeVolumeIndex,
|
||||
unsigned char channels,
|
||||
bool useHP,
|
||||
int upsampling,
|
||||
AudioFifo *audioFifo)
|
||||
{
|
||||
(void) mbeFrame;
|
||||
(void) mbeRateIndex;
|
||||
(void) mbeVolumeIndex;
|
||||
(void) channels;
|
||||
(void) useHP;
|
||||
(void) upsampling;
|
||||
(void) audioFifo;
|
||||
}
|
||||
#endif
|
||||
|
@ -27,9 +27,6 @@
|
||||
#include "audio/audiooutput.h"
|
||||
#include "audio/audioinput.h"
|
||||
#include "export.h"
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
#include "dsp/dvserialengine.h"
|
||||
#endif
|
||||
#include "ambe/ambeengine.h"
|
||||
|
||||
class DSPDeviceSourceEngine;
|
||||
@ -56,6 +53,7 @@ public:
|
||||
void removeLastDeviceMIMOEngine();
|
||||
|
||||
AudioDeviceManager *getAudioDeviceManager() { return &m_audioDeviceManager; }
|
||||
AMBEEngine *getAMBEEngine() { return &m_ambeEngine; }
|
||||
|
||||
uint32_t getDeviceSourceEnginesNumber() const { return m_deviceSourceEngines.size(); }
|
||||
DSPDeviceSourceEngine *getDeviceSourceEngineByIndex(uint deviceIndex) { return m_deviceSourceEngines[deviceIndex]; }
|
||||
@ -82,7 +80,6 @@ public:
|
||||
bool useHP,
|
||||
int upsampling,
|
||||
AudioFifo *audioFifo);
|
||||
AMBEEngine& getAMBEEngine() { return m_ambeEngine; }
|
||||
|
||||
const QTimer& getMasterTimer() const { return m_masterTimer; }
|
||||
void setMIMOSupport(bool mimoSupport) { m_mimoSupport = mimoSupport; }
|
||||
@ -101,9 +98,6 @@ private:
|
||||
QTimer m_masterTimer;
|
||||
bool m_dvSerialSupport;
|
||||
bool m_mimoSupport;
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
DVSerialEngine m_dvSerialEngine;
|
||||
#endif
|
||||
AMBEEngine m_ambeEngine;
|
||||
};
|
||||
|
||||
|
@ -707,7 +707,7 @@ margin-bottom: 20px;
|
||||
"description" : "1 if device is to be removed from active list"
|
||||
}
|
||||
},
|
||||
"description" : "AMBE devices actibe in the system"
|
||||
"description" : "AMBE devices active in the system"
|
||||
};
|
||||
defs.AMBEDevices = {
|
||||
"required" : [ "nbDevices" ],
|
||||
@ -27046,7 +27046,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2019-07-19T18:33:26.198+02:00
|
||||
Generated 2019-07-20T20:43:22.760+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1767,7 +1767,7 @@ definitions:
|
||||
$ref: "#/definitions/AMBEDevice"
|
||||
|
||||
AMBEDevice:
|
||||
description: "AMBE devices actibe in the system"
|
||||
description: "AMBE devices active in the system"
|
||||
properties:
|
||||
deviceRef:
|
||||
description: "Serial device name or server address"
|
||||
|
@ -3,8 +3,12 @@
|
||||
|
||||
#include "settings/mainsettings.h"
|
||||
#include "commands/command.h"
|
||||
#include "audio/audiodevicemanager.h"
|
||||
#include "ambe/ambeengine.h"
|
||||
|
||||
MainSettings::MainSettings() : m_audioDeviceManager(0)
|
||||
MainSettings::MainSettings() :
|
||||
m_audioDeviceManager(nullptr),
|
||||
m_ambeEngine(nullptr)
|
||||
{
|
||||
resetToDefaults();
|
||||
qInfo("MainSettings::MainSettings: settings file: format: %d location: %s", getFileFormat(), qPrintable(getFileLocation()));
|
||||
@ -42,11 +46,14 @@ void MainSettings::load()
|
||||
m_preferences.deserialize(qUncompress(QByteArray::fromBase64(s.value("preferences").toByteArray())));
|
||||
m_workingPreset.deserialize(qUncompress(QByteArray::fromBase64(s.value("current").toByteArray())));
|
||||
|
||||
if (m_audioDeviceManager)
|
||||
{
|
||||
if (m_audioDeviceManager) {
|
||||
m_audioDeviceManager->deserialize(qUncompress(QByteArray::fromBase64(s.value("audio").toByteArray())));
|
||||
}
|
||||
|
||||
if (m_ambeEngine) {
|
||||
m_ambeEngine->deserialize(qUncompress(QByteArray::fromBase64(s.value("ambe").toByteArray())));
|
||||
}
|
||||
|
||||
QStringList groups = s.childGroups();
|
||||
|
||||
for(int i = 0; i < groups.size(); ++i)
|
||||
@ -95,11 +102,14 @@ void MainSettings::save() const
|
||||
s.setValue("preferences", qCompress(m_preferences.serialize()).toBase64());
|
||||
s.setValue("current", qCompress(m_workingPreset.serialize()).toBase64());
|
||||
|
||||
if (m_audioDeviceManager)
|
||||
{
|
||||
if (m_audioDeviceManager) {
|
||||
s.setValue("audio", qCompress(m_audioDeviceManager->serialize()).toBase64());
|
||||
}
|
||||
|
||||
if (m_ambeEngine) {
|
||||
s.setValue("ambe", qCompress(m_ambeEngine->serialize()).toBase64());
|
||||
}
|
||||
|
||||
QStringList groups = s.childGroups();
|
||||
|
||||
for(int i = 0; i < groups.size(); ++i)
|
||||
|
@ -2,13 +2,14 @@
|
||||
#define INCLUDE_SETTINGS_H
|
||||
|
||||
#include <QString>
|
||||
#include "audio/audiodevicemanager.h"
|
||||
#include "device/deviceuserargs.h"
|
||||
#include "preferences.h"
|
||||
#include "preset.h"
|
||||
#include "export.h"
|
||||
|
||||
class Command;
|
||||
class AudioDeviceManager;
|
||||
class AMBEEngine;
|
||||
|
||||
class SDRBASE_API MainSettings {
|
||||
public:
|
||||
@ -63,6 +64,7 @@ public:
|
||||
|
||||
const AudioDeviceManager *getAudioDeviceManager() const { return m_audioDeviceManager; }
|
||||
void setAudioDeviceManager(AudioDeviceManager *audioDeviceManager) { m_audioDeviceManager = audioDeviceManager; }
|
||||
void setAMBEEngine(AMBEEngine *ambeEngine) { m_ambeEngine = ambeEngine; }
|
||||
|
||||
protected:
|
||||
Preferences m_preferences;
|
||||
@ -73,6 +75,7 @@ protected:
|
||||
typedef QList<Command*> Commands;
|
||||
Commands m_commands;
|
||||
DeviceUserArgs m_hardwareDeviceUserArgs;
|
||||
AMBEEngine *m_ambeEngine;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_SETTINGS_H
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
ParserBench::ParserBench() :
|
||||
m_testOption(QStringList() << "t" << "test",
|
||||
"Test type.",
|
||||
"Test type: decimateii, decimatefi, decimateff, decimateif, decimateinfii, decimatesupii, ambe",
|
||||
"test",
|
||||
"decimateii"),
|
||||
m_nbSamplesOption(QStringList() << "n" << "nb-samples",
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "ambedevicesdialog.h"
|
||||
#include "ui_ambedevicesdialog.h"
|
||||
|
||||
AMBEDevicesDialog::AMBEDevicesDialog(AMBEEngine& ambeEngine, QWidget* parent) :
|
||||
AMBEDevicesDialog::AMBEDevicesDialog(AMBEEngine* ambeEngine, QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AMBEDevicesDialog),
|
||||
m_ambeEngine(ambeEngine)
|
||||
@ -40,7 +40,7 @@ AMBEDevicesDialog::~AMBEDevicesDialog()
|
||||
void AMBEDevicesDialog::populateSerialList()
|
||||
{
|
||||
std::vector<QString> ambeSerialDevices;
|
||||
m_ambeEngine.scan(ambeSerialDevices);
|
||||
m_ambeEngine->scan(ambeSerialDevices);
|
||||
ui->ambeSerialDevices->clear();
|
||||
std::vector<QString>::const_iterator it = ambeSerialDevices.begin();
|
||||
|
||||
@ -53,7 +53,7 @@ void AMBEDevicesDialog::populateSerialList()
|
||||
void AMBEDevicesDialog::refreshInUseList()
|
||||
{
|
||||
std::vector<QString> inUseDevices;
|
||||
m_ambeEngine.getDeviceRefs(inUseDevices);
|
||||
m_ambeEngine->getDeviceRefs(inUseDevices);
|
||||
ui->ambeDeviceRefs->clear();
|
||||
std::vector<QString>::const_iterator it = inUseDevices.begin();
|
||||
|
||||
@ -80,7 +80,7 @@ void AMBEDevicesDialog::on_importSerial_clicked(bool checked)
|
||||
|
||||
if (foundItems.size() == 0)
|
||||
{
|
||||
if (m_ambeEngine.registerController(serialName.toStdString()))
|
||||
if (m_ambeEngine->registerController(serialName.toStdString()))
|
||||
{
|
||||
ui->ambeDeviceRefs->addItem(serialName);
|
||||
ui->statusText->setText(tr("%1 added").arg(serialName));
|
||||
@ -109,7 +109,7 @@ void AMBEDevicesDialog::on_importAllSerial_clicked(bool checked)
|
||||
|
||||
if (foundItems.size() == 0)
|
||||
{
|
||||
if (m_ambeEngine.registerController(serialName.toStdString()))
|
||||
if (m_ambeEngine->registerController(serialName.toStdString()))
|
||||
{
|
||||
ui->ambeDeviceRefs->addItem(serialName);
|
||||
count++;
|
||||
@ -132,7 +132,7 @@ void AMBEDevicesDialog::on_removeAmbeDevice_clicked(bool checked)
|
||||
}
|
||||
|
||||
QString deviceName = deviceItem->text();
|
||||
m_ambeEngine.releaseController(deviceName.toStdString());
|
||||
m_ambeEngine->releaseController(deviceName.toStdString());
|
||||
ui->statusText->setText(tr("%1 removed").arg(deviceName));
|
||||
refreshInUseList();
|
||||
}
|
||||
@ -151,7 +151,7 @@ void AMBEDevicesDialog::on_clearAmbeList_clicked(bool checked)
|
||||
return;
|
||||
}
|
||||
|
||||
m_ambeEngine.releaseAll();
|
||||
m_ambeEngine->releaseAll();
|
||||
ui->ambeDeviceRefs->clear();
|
||||
ui->statusText->setText("All items released");
|
||||
}
|
||||
@ -164,7 +164,7 @@ void AMBEDevicesDialog::on_importAddress_clicked(bool checked)
|
||||
|
||||
if (foundItems.size() == 0)
|
||||
{
|
||||
if (m_ambeEngine.registerController(addressAndPort.toStdString()))
|
||||
if (m_ambeEngine->registerController(addressAndPort.toStdString()))
|
||||
{
|
||||
ui->ambeDeviceRefs->addItem(addressAndPort);
|
||||
ui->statusText->setText(tr("%1 added").arg(addressAndPort));
|
||||
|
@ -34,7 +34,7 @@ class SDRGUI_API AMBEDevicesDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AMBEDevicesDialog(AMBEEngine& ambeEngine, QWidget* parent = nullptr);
|
||||
explicit AMBEDevicesDialog(AMBEEngine* ambeEngine, QWidget* parent = nullptr);
|
||||
~AMBEDevicesDialog();
|
||||
|
||||
private:
|
||||
@ -42,7 +42,7 @@ private:
|
||||
void refreshInUseList();
|
||||
|
||||
Ui::AMBEDevicesDialog* ui;
|
||||
AMBEEngine& m_ambeEngine;
|
||||
AMBEEngine* m_ambeEngine;
|
||||
|
||||
private slots:
|
||||
void on_importSerial_clicked(bool checked);
|
||||
|
@ -123,6 +123,7 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
|
||||
splash->showStatusMessage("starting...", Qt::white);
|
||||
|
||||
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
|
||||
m_settings.setAMBEEngine(m_dspEngine->getAMBEEngine());
|
||||
|
||||
ui->setupUi(this);
|
||||
createStatusBar();
|
||||
@ -1628,48 +1629,6 @@ void MainWindow::on_action_AMBE_triggered()
|
||||
ambeDevicesDialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_DV_Serial_triggered(bool checked)
|
||||
{
|
||||
m_dspEngine->setDVSerialSupport(checked);
|
||||
|
||||
if (checked)
|
||||
{
|
||||
if (m_dspEngine->hasDVSerialSupport())
|
||||
{
|
||||
std::vector<std::string> deviceNames;
|
||||
m_dspEngine->getDVSerialNames(deviceNames);
|
||||
|
||||
if (deviceNames.size() == 0)
|
||||
{
|
||||
QMessageBox::information(this, tr("Message"), tr("No DV serial devices found"));
|
||||
qDebug("MainWindow::on_action_DV_Serial_triggered: No DV serial devices found");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<std::string>::iterator it = deviceNames.begin();
|
||||
std::string deviceNamesStr = "DV Serial devices found: ";
|
||||
|
||||
while (it != deviceNames.end())
|
||||
{
|
||||
if (it != deviceNames.begin()) {
|
||||
deviceNamesStr += ",";
|
||||
}
|
||||
|
||||
deviceNamesStr += *it;
|
||||
++it;
|
||||
}
|
||||
|
||||
QMessageBox::information(this, tr("Message"), tr(deviceNamesStr.c_str()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(this, tr("Message"), tr("No DV serial support"));
|
||||
qDebug("MainWindow::on_action_DV_Serial_triggered: No DV serial support");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::sampleSourceChanged()
|
||||
{
|
||||
// Do it in the currently selected source tab
|
||||
|
@ -380,7 +380,6 @@ private slots:
|
||||
void on_action_Audio_triggered();
|
||||
void on_action_Logging_triggered();
|
||||
void on_action_AMBE_triggered();
|
||||
void on_action_DV_Serial_triggered(bool checked);
|
||||
void on_action_My_Position_triggered();
|
||||
void on_action_DeviceUserArguments_triggered();
|
||||
void sampleSourceChanged();
|
||||
|
@ -64,7 +64,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1012</width>
|
||||
<height>19</height>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
@ -126,7 +126,6 @@
|
||||
<addaction name="action_Audio"/>
|
||||
<addaction name="action_Logging"/>
|
||||
<addaction name="action_AMBE"/>
|
||||
<addaction name="action_DV_Serial"/>
|
||||
<addaction name="action_My_Position"/>
|
||||
<addaction name="menuDevices"/>
|
||||
</widget>
|
||||
|
@ -59,6 +59,7 @@ MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, Q
|
||||
|
||||
m_instance = this;
|
||||
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
|
||||
m_settings.setAMBEEngine(m_dspEngine->getAMBEEngine());
|
||||
|
||||
m_pluginManager = new PluginManager(this);
|
||||
m_pluginManager->loadPlugins(QString("pluginssrv"));
|
||||
|
@ -1767,7 +1767,7 @@ definitions:
|
||||
$ref: "#/definitions/AMBEDevice"
|
||||
|
||||
AMBEDevice:
|
||||
description: "AMBE devices actibe in the system"
|
||||
description: "AMBE devices active in the system"
|
||||
properties:
|
||||
deviceRef:
|
||||
description: "Serial device name or server address"
|
||||
|
@ -707,7 +707,7 @@ margin-bottom: 20px;
|
||||
"description" : "1 if device is to be removed from active list"
|
||||
}
|
||||
},
|
||||
"description" : "AMBE devices actibe in the system"
|
||||
"description" : "AMBE devices active in the system"
|
||||
};
|
||||
defs.AMBEDevices = {
|
||||
"required" : [ "nbDevices" ],
|
||||
@ -27046,7 +27046,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2019-07-19T18:33:26.198+02:00
|
||||
Generated 2019-07-20T20:43:22.760+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* SWGAMBEDevice.h
|
||||
*
|
||||
* AMBE devices actibe in the system
|
||||
* AMBE devices active in the system
|
||||
*/
|
||||
|
||||
#ifndef SWGAMBEDevice_H_
|
||||
|
Loading…
Reference in New Issue
Block a user