mirror of https://github.com/f4exb/sdrangel.git
Plugin interface: use enum for single Rx or single Tx type and added the any type
This commit is contained in:
parent
fcc8817f62
commit
7ea814c180
|
@ -94,7 +94,7 @@ PluginInterface::SamplingDevices Bladerf1OutputPlugin::enumSampleSinks()
|
||||||
QString(devinfo[i].serial),
|
QString(devinfo[i].serial),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ PluginInterface::SamplingDevices BladeRF2OutputPlugin::enumSampleSinks()
|
||||||
QString(devinfo[i].serial),
|
QString(devinfo[i].serial),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
nbTxChannels,
|
nbTxChannels,
|
||||||
j));
|
j));
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ PluginInterface::SamplingDevices FileSinkPlugin::enumSampleSinks()
|
||||||
QString::null,
|
QString::null,
|
||||||
0,
|
0,
|
||||||
PluginInterface::SamplingDevice::BuiltInDevice,
|
PluginInterface::SamplingDevice::BuiltInDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks()
|
||||||
QString(deviceList[i]),
|
QString(deviceList[i]),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
limeSDRParams.m_nbTxChannels,
|
limeSDRParams.m_nbTxChannels,
|
||||||
j));
|
j));
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ PluginInterface::SamplingDevices PlutoSDROutputPlugin::enumSampleSinks()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ PluginInterface::SamplingDevices RemoteOutputPlugin::enumSampleSinks()
|
||||||
QString::null,
|
QString::null,
|
||||||
0,
|
0,
|
||||||
PluginInterface::SamplingDevice::BuiltInDevice,
|
PluginInterface::SamplingDevice::BuiltInDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ PluginInterface::SamplingDevices SoapySDROutputPlugin::enumSampleSinks()
|
||||||
serial,
|
serial,
|
||||||
idev,
|
idev,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
nbTxChannels,
|
nbTxChannels,
|
||||||
ichan));
|
ichan));
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ PluginInterface::SamplingDevices XTRXOutputPlugin::enumSampleSinks()
|
||||||
QString(devs[i].uniqname),
|
QString(devs[i].uniqname),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
false,
|
PluginInterface::SamplingDevice::StreamSingleTx,
|
||||||
XTRXParams.m_nbTxChannels,
|
XTRXParams.m_nbTxChannels,
|
||||||
j));
|
j));
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ PluginInterface::SamplingDevices AirspyHFPlugin::enumSampleSources()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ PluginInterface::SamplingDevices Blderf1InputPlugin::enumSampleSources()
|
||||||
QString(devinfo[i].serial),
|
QString(devinfo[i].serial),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ PluginInterface::SamplingDevices Blderf2InputPlugin::enumSampleSources()
|
||||||
QString(devinfo[i].serial),
|
QString(devinfo[i].serial),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
nbRxChannels,
|
nbRxChannels,
|
||||||
j));
|
j));
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
|
||||||
serialNumber,
|
serialNumber,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
|
||||||
serialNumber,
|
serialNumber,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
|
||||||
QString::null,
|
QString::null,
|
||||||
0,
|
0,
|
||||||
PluginInterface::SamplingDevice::BuiltInDevice,
|
PluginInterface::SamplingDevice::BuiltInDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
|
||||||
QString(deviceList[i]),
|
QString(deviceList[i]),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
limeSDRParams.m_nbRxChannels,
|
limeSDRParams.m_nbRxChannels,
|
||||||
j));
|
j));
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ PluginInterface::SamplingDevices LocalInputPlugin::enumSampleSources()
|
||||||
QString::null,
|
QString::null,
|
||||||
0,
|
0,
|
||||||
PluginInterface::SamplingDevice::BuiltInDevice,
|
PluginInterface::SamplingDevice::BuiltInDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ PluginInterface::SamplingDevices PerseusPlugin::enumSampleSources()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
|
||||||
serial_str,
|
serial_str,
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ PluginInterface::SamplingDevices RemoteInputPlugin::enumSampleSources()
|
||||||
QString::null,
|
QString::null,
|
||||||
0,
|
0,
|
||||||
PluginInterface::SamplingDevice::BuiltInDevice,
|
PluginInterface::SamplingDevice::BuiltInDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
|
||||||
QString(serial),
|
QString(serial),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
|
||||||
QString(serial),
|
QString(serial),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ PluginInterface::SamplingDevices SoapySDRInputPlugin::enumSampleSources()
|
||||||
serial,
|
serial,
|
||||||
idev,
|
idev,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
nbRxChannels,
|
nbRxChannels,
|
||||||
ichan));
|
ichan));
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ PluginInterface::SamplingDevices TestSourcePlugin::enumSampleSources()
|
||||||
QString::null,
|
QString::null,
|
||||||
0,
|
0,
|
||||||
PluginInterface::SamplingDevice::BuiltInDevice,
|
PluginInterface::SamplingDevice::BuiltInDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
1,
|
1,
|
||||||
0));
|
0));
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ PluginInterface::SamplingDevices XTRXInputPlugin::enumSampleSources()
|
||||||
QString(devs[i].uniqname),
|
QString(devs[i].uniqname),
|
||||||
i,
|
i,
|
||||||
PluginInterface::SamplingDevice::PhysicalDevice,
|
PluginInterface::SamplingDevice::PhysicalDevice,
|
||||||
true,
|
PluginInterface::SamplingDevice::StreamSingleRx,
|
||||||
XTRXParams.m_nbRxChannels,
|
XTRXParams.m_nbRxChannels,
|
||||||
j));
|
j));
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,20 @@ public:
|
||||||
BuiltInDevice
|
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 displayedName; //!< The human readable name
|
||||||
QString hardwareId; //!< The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
|
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 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)
|
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
|
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
|
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 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 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
|
int claimed; //!< This is the device set index if claimed else -1
|
||||||
|
@ -56,7 +63,7 @@ public:
|
||||||
const QString& _serial,
|
const QString& _serial,
|
||||||
int _sequence,
|
int _sequence,
|
||||||
SamplingDeviceType _type,
|
SamplingDeviceType _type,
|
||||||
bool _rxElseTx,
|
StreamType _streamType,
|
||||||
int _deviceNbItems,
|
int _deviceNbItems,
|
||||||
int _deviceItemIndex) :
|
int _deviceItemIndex) :
|
||||||
displayedName(_displayedName),
|
displayedName(_displayedName),
|
||||||
|
@ -65,7 +72,7 @@ public:
|
||||||
serial(_serial),
|
serial(_serial),
|
||||||
sequence(_sequence),
|
sequence(_sequence),
|
||||||
type(_type),
|
type(_type),
|
||||||
rxElseTx(_rxElseTx),
|
streamType(_streamType),
|
||||||
deviceNbItems(_deviceNbItems),
|
deviceNbItems(_deviceNbItems),
|
||||||
deviceItemIndex(_deviceItemIndex),
|
deviceItemIndex(_deviceItemIndex),
|
||||||
claimed(-1)
|
claimed(-1)
|
||||||
|
|
|
@ -133,7 +133,7 @@ int WebAPIAdapterGUI::instanceDevices(
|
||||||
*devices->back()->getHwType() = samplingDevice.hardwareId;
|
*devices->back()->getHwType() = samplingDevice.hardwareId;
|
||||||
*devices->back()->getSerial() = samplingDevice.serial;
|
*devices->back()->getSerial() = samplingDevice.serial;
|
||||||
devices->back()->setSequence(samplingDevice.sequence);
|
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()->setDeviceNbStreams(samplingDevice.deviceNbItems);
|
||||||
devices->back()->setDeviceSetIndex(samplingDevice.claimed);
|
devices->back()->setDeviceSetIndex(samplingDevice.claimed);
|
||||||
devices->back()->setIndex(i);
|
devices->back()->setIndex(i);
|
||||||
|
|
|
@ -133,7 +133,7 @@ int WebAPIAdapterSrv::instanceDevices(
|
||||||
*devices->back()->getHwType() = samplingDevice.hardwareId;
|
*devices->back()->getHwType() = samplingDevice.hardwareId;
|
||||||
*devices->back()->getSerial() = samplingDevice.serial;
|
*devices->back()->getSerial() = samplingDevice.serial;
|
||||||
devices->back()->setSequence(samplingDevice.sequence);
|
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()->setDeviceNbStreams(samplingDevice.deviceNbItems);
|
||||||
devices->back()->setDeviceSetIndex(samplingDevice.claimed);
|
devices->back()->setDeviceSetIndex(samplingDevice.claimed);
|
||||||
devices->back()->setIndex(i);
|
devices->back()->setIndex(i);
|
||||||
|
|
Loading…
Reference in New Issue