Pass device item index to the device API when creating or assigning a new device

pull/127/head
f4exb 2017-11-02 09:17:38 +01:00
rodzic 7650d11486
commit a32d508256
6 zmienionych plików z 36 dodań i 13 usunięć

Wyświetl plik

@ -27,6 +27,7 @@ DeviceSinkAPI::DeviceSinkAPI(int deviceTabIndex,
m_deviceTabIndex(deviceTabIndex),
m_deviceSinkEngine(deviceSinkEngine),
m_sampleSinkSequence(0),
m_itemIndex(0),
m_pluginInterface(0),
m_sampleSinkPluginInstanceUI(0),
m_buddySharedPtr(0),
@ -159,6 +160,11 @@ void DeviceSinkAPI::setSampleSinkSequence(int sequence)
m_deviceSinkEngine->setSinkSequence(sequence);
}
void DeviceSinkAPI::setItemIndex(uint32_t index)
{
m_itemIndex = index;
}
void DeviceSinkAPI::setSampleSinkPluginInterface(PluginInterface *iface)
{
m_pluginInterface = iface;

Wyświetl plik

@ -66,6 +66,7 @@ public:
void setSampleSinkSerial(const QString& serial);
void setSampleSinkDisplayName(const QString& serial);
void setSampleSinkSequence(int sequence);
void setItemIndex(uint32_t index);
void setSampleSinkPluginInterface(PluginInterface *iface);
void setSampleSinkPluginInstanceUI(PluginInstanceGUI *gui);
@ -73,8 +74,9 @@ public:
const QString& getSampleSinkId() const { return m_sampleSinkId; }
const QString& getSampleSinkSerial() const { return m_sampleSinkSerial; }
const QString& getSampleSinkDisplayName() const { return m_sampleSinkDisplayName; }
PluginInterface *getPluginInterface() { return m_pluginInterface; }
uint32_t getSampleSinkSequence() const { return m_sampleSinkSequence; }
uint32_t getItemIndex() const { return m_itemIndex; }
PluginInterface *getPluginInterface() { return m_pluginInterface; }
PluginInstanceGUI *getSampleSinkPluginInstanceGUI() { return m_sampleSinkPluginInstanceUI; }
void registerChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
@ -104,11 +106,12 @@ protected:
int m_deviceTabIndex;
DSPDeviceSinkEngine *m_deviceSinkEngine;
QString m_hardwareId;
QString m_sampleSinkId;
QString m_sampleSinkSerial;
QString m_sampleSinkDisplayName;
uint32_t m_sampleSinkSequence;
QString m_hardwareId; //!< The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
QString m_sampleSinkId; //!< The internal plugin ID corresponding to the device (i.e. for HackRF input, for HackRF output ...)
QString m_sampleSinkSerial; //!< The device serial number defined by the vendor
QString m_sampleSinkDisplayName; //!< The human readable name identifying this instance
uint32_t m_sampleSinkSequence; //!< The device sequence. >0 when more than one device of the same type is connected
uint32_t m_itemIndex; //!< The Rx stream index. Can be >0 for NxM devices (i.e. 0 or 1 for LimeSDR)
PluginInterface* m_pluginInterface;
PluginInstanceGUI* m_sampleSinkPluginInstanceUI;

Wyświetl plik

@ -27,6 +27,7 @@ DeviceSourceAPI::DeviceSourceAPI(int deviceTabIndex,
m_deviceTabIndex(deviceTabIndex),
m_deviceSourceEngine(deviceSourceEngine),
m_sampleSourceSequence(0),
m_itemIndex(0),
m_pluginInterface(0),
m_sampleSourcePluginInstanceUI(0),
m_buddySharedPtr(0),
@ -151,6 +152,11 @@ void DeviceSourceAPI::setSampleSourceSequence(int sequence)
m_deviceSourceEngine->setSourceSequence(sequence);
}
void DeviceSourceAPI::setItemIndex(uint32_t index)
{
m_itemIndex = index;
}
void DeviceSourceAPI::setSampleSourcePluginInterface(PluginInterface *iface)
{
m_pluginInterface = iface;

Wyświetl plik

@ -66,6 +66,7 @@ public:
void setSampleSourceSerial(const QString& serial);
void setSampleSourceDisplayName(const QString& serial);
void setSampleSourceSequence(int sequence);
void setItemIndex(uint32_t index);
void setSampleSourcePluginInterface(PluginInterface *iface);
void setSampleSourcePluginInstanceGUI(PluginInstanceGUI *gui);
@ -73,8 +74,9 @@ public:
const QString& getSampleSourceId() const { return m_sampleSourceId; }
const QString& getSampleSourceSerial() const { return m_sampleSourceSerial; }
const QString& getSampleSourceDisplayName() const { return m_sampleSourceDisplayName; }
PluginInterface *getPluginInterface() { return m_pluginInterface; }
uint32_t getSampleSourceSequence() const { return m_sampleSourceSequence; }
uint32_t getItemIndex() const { return m_itemIndex; }
PluginInterface *getPluginInterface() { return m_pluginInterface; }
PluginInstanceGUI *getSampleSourcePluginInstanceGUI() { return m_sampleSourcePluginInstanceUI; }
void loadSourceSettings(const Preset* preset);
@ -100,11 +102,12 @@ protected:
int m_deviceTabIndex;
DSPDeviceSourceEngine *m_deviceSourceEngine;
QString m_hardwareId;
QString m_sampleSourceId;
QString m_sampleSourceSerial;
QString m_sampleSourceDisplayName;
uint32_t m_sampleSourceSequence;
QString m_hardwareId; //!< The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
QString m_sampleSourceId; //!< The internal plugin ID corresponding to the device (i.e. for HackRF input, for HackRF output ...)
QString m_sampleSourceSerial; //!< The device serial number defined by the vendor or a fake one (SDRplay)
QString m_sampleSourceDisplayName; //!< The human readable name identifying this instance
uint32_t m_sampleSourceSequence; //!< The device sequence. >0 when more than one device of the same type is connected
uint32_t m_itemIndex; //!< The Rx stream index. Can be >0 for NxM devices (i.e. 0 or 1 for LimeSDR)
PluginInterface* m_pluginInterface;
PluginInstanceGUI* m_sampleSourcePluginInstanceUI;

Wyświetl plik

@ -36,7 +36,7 @@ public:
QString displayedName; //!< The human readable name
QString hardwareId; //!< The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
QString id; //!< The internal plugin ID corresponding to the device (i.e. for HackRF input, for HackRF output ...)
QString serial; //!< The device serial number
QString serial; //!< The device serial number defined by the vendor or a fake one (SDRplay)
int sequence; //!< The device sequence. >0 when more than one device of the same type is connected
SamplingDeviceType type; //!< The sampling device type for behavior information
bool rxElseTx; //!< This is the Rx part else the Tx part of the device

Wyświetl plik

@ -155,6 +155,7 @@ MainWindow::MainWindow(QWidget* parent) :
PluginInterface::SamplingDevice samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(deviceIndex);
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourceSequence(samplingDevice.sequence);
m_deviceUIs.back()->m_deviceSourceAPI->setItemIndex(samplingDevice.deviceItemIndex);
m_deviceUIs.back()->m_deviceSourceAPI->setHardwareId(samplingDevice.hardwareId);
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourceId(samplingDevice.id);
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourceSerial(samplingDevice.serial);
@ -243,6 +244,7 @@ void MainWindow::addSourceDevice()
int fileSourceDeviceIndex = DeviceEnumerator::instance()->getFileSourceDeviceIndex();
PluginInterface::SamplingDevice samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(fileSourceDeviceIndex);
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourceSequence(samplingDevice.sequence);
m_deviceUIs.back()->m_deviceSourceAPI->setItemIndex(samplingDevice.deviceItemIndex);
m_deviceUIs.back()->m_deviceSourceAPI->setHardwareId(samplingDevice.hardwareId);
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourceId(samplingDevice.id);
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourceSerial(samplingDevice.serial);
@ -312,6 +314,7 @@ void MainWindow::addSinkDevice()
int fileSinkDeviceIndex = DeviceEnumerator::instance()->getFileSinkDeviceIndex();
PluginInterface::SamplingDevice samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(fileSinkDeviceIndex);
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkSequence(samplingDevice.sequence);
m_deviceUIs.back()->m_deviceSinkAPI->setItemIndex(samplingDevice.deviceItemIndex);
m_deviceUIs.back()->m_deviceSinkAPI->setHardwareId(samplingDevice.hardwareId);
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkId(samplingDevice.id);
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkSerial(samplingDevice.serial);
@ -898,6 +901,7 @@ void MainWindow::on_sampleSource_changed()
PluginInterface::SamplingDevice samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(deviceUI->m_samplingDeviceControl->getSelectedDeviceIndex());
deviceUI->m_deviceSourceAPI->setSampleSourceSequence(samplingDevice.sequence);
deviceUI->m_deviceSourceAPI->setItemIndex(samplingDevice.deviceItemIndex);
deviceUI->m_deviceSourceAPI->setHardwareId(samplingDevice.hardwareId);
deviceUI->m_deviceSourceAPI->setSampleSourceId(samplingDevice.id);
deviceUI->m_deviceSourceAPI->setSampleSourceSerial(samplingDevice.serial);
@ -984,6 +988,7 @@ void MainWindow::on_sampleSink_changed()
PluginInterface::SamplingDevice samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(deviceUI->m_samplingDeviceControl->getSelectedDeviceIndex());
deviceUI->m_deviceSinkAPI->setSampleSinkSequence(samplingDevice.sequence);
deviceUI->m_deviceSinkAPI->setItemIndex(samplingDevice.deviceItemIndex);
deviceUI->m_deviceSinkAPI->setHardwareId(samplingDevice.hardwareId);
deviceUI->m_deviceSinkAPI->setSampleSinkId(samplingDevice.id);
deviceUI->m_deviceSinkAPI->setSampleSinkSerial(samplingDevice.serial);