76 qWarning(
"Preset::serialize: too many sources");
119 qint32 sourcesCount = 0;
120 d.
readS32(20, &sourcesCount, 0);
122 if (sourcesCount >= (200-23)/4)
124 sourcesCount = ((200-23)/4) - 1;
129 for (
int i = 0;
i < sourcesCount;
i++)
131 QString sourceId, sourceSerial;
133 QByteArray sourceConfig;
137 d.
readS32(26 +
i*4, &sourceSequence, 0);
140 if (!sourceId.isEmpty())
152 d.
readS32(200, &channelCount, 0);
156 for (
int i = 0;
i < channelCount;
i++)
161 d.
readString(201 +
i * 2, &channel,
"unknown-channel");
178 const QString& sourceSerial,
186 if (it->m_deviceId == sourceId)
188 if (sourceSerial.isNull() || sourceSerial.isEmpty())
190 if (it->m_deviceSequence == sourceSequence)
197 if (it->m_deviceSerial == sourceSerial)
211 it->m_config = config;
216 const QString& sourceSerial,
217 int sourceSequence)
const 220 if (sourceId ==
"sdrangel.samplesource.soapysdrinput") {
222 }
else if (sourceId ==
"sdrangel.samplesource.soapysdroutput") {
228 DeviceeConfigs::const_iterator itMatchSequence =
m_deviceConfigs.end();
232 if (it->m_deviceId == sourceId)
239 if (sourceSerial.isNull() || sourceSerial.isEmpty())
241 if (it->m_deviceSequence == sourceSequence)
248 if (it->m_deviceSerial == sourceSerial)
252 else if(it->m_deviceSequence == sourceSequence)
254 itMatchSequence = it;
264 qDebug(
"Preset::findBestSourceConfig: sequence matched: id: %s ser: %s seq: %d",
265 qPrintable(itMatchSequence->m_deviceId), qPrintable(itMatchSequence->m_deviceSerial), itMatchSequence->m_deviceSequence);
266 return &(itMatchSequence->m_config);
270 qDebug(
"Preset::findBestSourceConfig: first of kind matched: id: %s ser: %s seq: %d",
271 qPrintable(itFirstOfKind->m_deviceId), qPrintable(itFirstOfKind->m_deviceSerial), itFirstOfKind->m_deviceSequence);
272 return &(itFirstOfKind->m_config);
276 qDebug(
"Preset::findBestSourceConfig: no match");
282 qDebug(
"Preset::findBestSourceConfig: serial matched (exact): id: %s ser: %s",
283 qPrintable(it->m_deviceId), qPrintable(it->m_deviceSerial));
284 return &(it->m_config);
290 QStringList sourceSerialPieces = sourceSerial.split(
"-");
292 if (sourceSerialPieces.size() == 0) {
301 if (it->m_deviceId != sourceId)
305 else if (it->m_deviceSerial == sourceSerial)
311 QStringList serialPieces = it->m_deviceSerial.split(
"-");
313 if (serialPieces.size() == 0)
317 else if (sourceSerialPieces[0] == serialPieces[0])
332 qDebug(
"Preset::findBestDeviceConfigSoapy: no match");
337 qDebug(
"Preset::findBestSourceConfig: first of kind matched: id: %s ser: %s seq: %d",
338 qPrintable(itFirstOfKind->m_deviceId), qPrintable(itFirstOfKind->m_deviceSerial), itFirstOfKind->m_deviceSequence);
339 return &(itFirstOfKind->m_config);
344 qDebug(
"Preset::findBestDeviceConfigSoapy: serial matched (exact): id: %s ser: %s seq: %d",
345 qPrintable(it->m_deviceId), qPrintable(it->m_deviceSerial), it->m_deviceSequence);
346 return &(it->m_config);
const QByteArray * findBestDeviceConfig(const QString &deviceId, const QString &deviceSerial, int deviceSequence) const
quint64 m_centerFrequency
void addOrUpdateDeviceConfig(const QString &deviceId, const QString &deviceSerial, int deviceSequence, const QByteArray &config)
void writeBlob(quint32 id, const QByteArray &value)
QByteArray m_spectrumConfig
bool readString(quint32 id, QString *result, const QString &def=QString::null) const
bool readBool(quint32 id, bool *result, bool def=false) const
DeviceeConfigs m_deviceConfigs
bool readS32(quint32 id, qint32 *result, qint32 def=0) const
bool readBlob(quint32 id, QByteArray *result, const QByteArray &def=QByteArray()) const
QByteArray serialize() const
const QByteArray * findBestDeviceConfigSoapy(const QString &sourceId, const QString &deviceSerial) const
void writeS32(quint32 id, qint32 value)
quint32 getVersion() const
bool readU64(quint32 id, quint64 *result, quint64 def=0) const
void writeBool(quint32 id, bool value)
bool deserialize(const QByteArray &data)
bool m_dcOffsetCorrection
void writeString(quint32 id, const QString &value)
const QByteArray & final()
bool m_iqImbalanceCorrection
ChannelConfigs m_channelConfigs
void writeU64(quint32 id, quint64 value)