1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

Plugin interface: use enum for single Rx or single Tx type and added the any type

This commit is contained in:
f4exb 2019-05-07 18:58:20 +02:00
parent fcc8817f62
commit 7ea814c180
30 changed files with 39 additions and 32 deletions

View File

@ -94,7 +94,7 @@ PluginInterface::SamplingDevices Bladerf1OutputPlugin::enumSampleSinks()
QString(devinfo[i].serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
1,
0));

View File

@ -98,7 +98,7 @@ PluginInterface::SamplingDevices BladeRF2OutputPlugin::enumSampleSinks()
QString(devinfo[i].serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
nbTxChannels,
j));
}

View File

@ -66,7 +66,7 @@ PluginInterface::SamplingDevices FileSinkPlugin::enumSampleSinks()
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
1,
0));

View File

@ -101,7 +101,7 @@ PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
1,
0));

View File

@ -101,7 +101,7 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks()
QString(deviceList[i]),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
limeSDRParams.m_nbTxChannels,
j));
}

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices PlutoSDROutputPlugin::enumSampleSinks()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
1,
0));

View File

@ -66,7 +66,7 @@ PluginInterface::SamplingDevices RemoteOutputPlugin::enumSampleSinks()
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
1,
0));

View File

@ -81,7 +81,7 @@ PluginInterface::SamplingDevices SoapySDROutputPlugin::enumSampleSinks()
serial,
idev,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
nbTxChannels,
ichan));
}

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices XTRXOutputPlugin::enumSampleSinks()
QString(devs[i].uniqname),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
PluginInterface::SamplingDevice::StreamSingleTx,
XTRXParams.m_nbTxChannels,
j));
}

View File

@ -107,7 +107,7 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -83,7 +83,7 @@ PluginInterface::SamplingDevices AirspyHFPlugin::enumSampleSources()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -94,7 +94,7 @@ PluginInterface::SamplingDevices Blderf1InputPlugin::enumSampleSources()
QString(devinfo[i].serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));
}

View File

@ -98,7 +98,7 @@ PluginInterface::SamplingDevices Blderf2InputPlugin::enumSampleSources()
QString(devinfo[i].serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
nbRxChannels,
j));
}

View File

@ -71,7 +71,7 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
serialNumber,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -73,7 +73,7 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
serialNumber,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -66,7 +66,7 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -104,7 +104,7 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -100,7 +100,7 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
QString(deviceList[i]),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
limeSDRParams.m_nbRxChannels,
j));
}

View File

@ -66,7 +66,7 @@ PluginInterface::SamplingDevices LocalInputPlugin::enumSampleSources()
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices PerseusPlugin::enumSampleSources()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
serial_str,
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -66,7 +66,7 @@ PluginInterface::SamplingDevices RemoteInputPlugin::enumSampleSources()
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -62,7 +62,7 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
QString(serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));
}

View File

@ -83,7 +83,7 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
QString(serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));
}

View File

@ -80,7 +80,7 @@ PluginInterface::SamplingDevices SoapySDRInputPlugin::enumSampleSources()
serial,
idev,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
nbRxChannels,
ichan));
}

View File

@ -66,7 +66,7 @@ PluginInterface::SamplingDevices TestSourcePlugin::enumSampleSources()
QString::null,
0,
PluginInterface::SamplingDevice::BuiltInDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
1,
0));

View File

@ -79,7 +79,7 @@ PluginInterface::SamplingDevices XTRXInputPlugin::enumSampleSources()
QString(devs[i].uniqname),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
true,
PluginInterface::SamplingDevice::StreamSingleRx,
XTRXParams.m_nbRxChannels,
j));
}

View File

@ -39,13 +39,20 @@ public:
BuiltInDevice
};
enum StreamType
{
StreamSingleRx, //!< Exposes a single input stream that can be one of the streams of a physical device
StreamSingleTx, //!< Exposes a single output stream that can be one of the streams of a physical device
StreamAny //!< May expose any number of input and/or output streams
};
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 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
StreamType streamType; //!< This is the type of stream supported
int deviceNbItems; //!< Number of items (or streams) in the device. >1 for composite devices.
int deviceItemIndex; //!< For composite devices this is the Rx or Tx stream index. -1 if not initialized
int claimed; //!< This is the device set index if claimed else -1
@ -56,7 +63,7 @@ public:
const QString& _serial,
int _sequence,
SamplingDeviceType _type,
bool _rxElseTx,
StreamType _streamType,
int _deviceNbItems,
int _deviceItemIndex) :
displayedName(_displayedName),
@ -65,7 +72,7 @@ public:
serial(_serial),
sequence(_sequence),
type(_type),
rxElseTx(_rxElseTx),
streamType(_streamType),
deviceNbItems(_deviceNbItems),
deviceItemIndex(_deviceItemIndex),
claimed(-1)

View File

@ -133,7 +133,7 @@ int WebAPIAdapterGUI::instanceDevices(
*devices->back()->getHwType() = samplingDevice.hardwareId;
*devices->back()->getSerial() = samplingDevice.serial;
devices->back()->setSequence(samplingDevice.sequence);
devices->back()->setDirection(samplingDevice.rxElseTx ? 0 : 1);
devices->back()->setDirection((int) samplingDevice.streamType);
devices->back()->setDeviceNbStreams(samplingDevice.deviceNbItems);
devices->back()->setDeviceSetIndex(samplingDevice.claimed);
devices->back()->setIndex(i);

View File

@ -133,7 +133,7 @@ int WebAPIAdapterSrv::instanceDevices(
*devices->back()->getHwType() = samplingDevice.hardwareId;
*devices->back()->getSerial() = samplingDevice.serial;
devices->back()->setSequence(samplingDevice.sequence);
devices->back()->setDirection(samplingDevice.rxElseTx ? 0 : 1);
devices->back()->setDirection((int) samplingDevice.streamType);
devices->back()->setDeviceNbStreams(samplingDevice.deviceNbItems);
devices->back()->setDeviceSetIndex(samplingDevice.claimed);
devices->back()->setIndex(i);