mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-17 23:28:50 -05:00
Renamed Channel Analyzer NG to Channel Analyzer externally (no classes renaming)
This commit is contained in:
parent
abb335d588
commit
766e6aac1c
@ -30,8 +30,8 @@ MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelAnalyzerOld, Mess
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelizer, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgReportChannelSampleRateChanged, Message)
|
||||
|
||||
const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzerng";
|
||||
const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzerNG";
|
||||
const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzer";
|
||||
const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzer";
|
||||
|
||||
ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
|
@ -417,7 +417,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
m_channelMarker.setBandwidth(m_rate);
|
||||
m_channelMarker.setSidebands(ChannelMarker::usb);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("Channel Analyzer NG");
|
||||
m_channelMarker.setTitle("Channel Analyzer");
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
setTitleColor(m_channelMarker.getColor());
|
||||
|
@ -23,7 +23,7 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Channel Analyzer NG</string>
|
||||
<string>Channel Analyzer</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="settingsContainer" native="true">
|
||||
<property name="geometry">
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include "chanalyzerng.h"
|
||||
|
||||
const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = {
|
||||
QString("Channel Analyzer NG"),
|
||||
QString("3.14.7"),
|
||||
QString("Channel Analyzer"),
|
||||
QString("4.0.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
@ -45,7 +45,7 @@ void ChannelAnalyzerNGSettings::resetToDefaults()
|
||||
m_pllPskOrder = 1;
|
||||
m_inputType = InputSignal;
|
||||
m_rgbColor = QColor(128, 128, 128).rgb();
|
||||
m_title = "Channel Analyzer NG";
|
||||
m_title = "Channel Analyzer";
|
||||
}
|
||||
|
||||
QByteArray ChannelAnalyzerNGSettings::serialize() const
|
||||
|
@ -191,9 +191,12 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA
|
||||
|
||||
for(int i = 0; i < channelRegistrations->count(); i++)
|
||||
{
|
||||
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
//if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
if (compareRxChannelURIs((*channelRegistrations)[i].m_channelIdURI, channelConfig.m_channelIdURI))
|
||||
{
|
||||
qDebug("DeviceUISet::loadRxChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||
qDebug("DeviceUISet::loadRxChannelSettings: creating new channel [%s] from config [%s]",
|
||||
qPrintable((*channelRegistrations)[i].m_channelIdURI),
|
||||
qPrintable(channelConfig.m_channelIdURI));
|
||||
BasebandSampleSink *rxChannel =
|
||||
(*channelRegistrations)[i].m_plugin->createRxChannelBS(m_deviceSourceAPI);
|
||||
PluginInstanceGUI *rxChannelGUI =
|
||||
@ -270,9 +273,11 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
|
||||
|
||||
for(int i = 0; i < channelRegistrations->count(); i++)
|
||||
{
|
||||
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
if ((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
{
|
||||
qDebug("DeviceUISet::loadTxChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||
qDebug("DeviceUISet::loadTxChannelSettings: creating new channel [%s] from config [%s]",
|
||||
qPrintable((*channelRegistrations)[i].m_channelIdURI),
|
||||
qPrintable(channelConfig.m_channelIdURI));
|
||||
BasebandSampleSource *txChannel =
|
||||
(*channelRegistrations)[i].m_plugin->createTxChannelBS(m_deviceSinkAPI);
|
||||
PluginInstanceGUI *txChannelGUI =
|
||||
@ -347,4 +352,11 @@ bool DeviceUISet::ChannelInstanceRegistration::operator<(const ChannelInstanceRe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool DeviceUISet::compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI)
|
||||
{
|
||||
if ((xChannelURI == "sdrangel.channel.chanalyzerng") || (xChannelURI == "sdrangel.channel.chanalyzer")) { // renamed ChanalyzerNG to Chanalyzer in 4.0.0
|
||||
return registerdChannelURI == "sdrangel.channel.chanalyzer";
|
||||
} else {
|
||||
return registerdChannelURI == xChannelURI;
|
||||
}
|
||||
}
|
||||
|
@ -97,6 +97,8 @@ private:
|
||||
|
||||
void renameRxChannelInstances();
|
||||
void renameTxChannelInstances();
|
||||
/** Use this function to support possible older identifiers in presets */
|
||||
bool compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI);
|
||||
};
|
||||
|
||||
|
||||
|
@ -152,18 +152,19 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
|
||||
|
||||
qDebug("DeviceSet::loadChannelSettings: %d channel(s) in preset", preset->getChannelCount());
|
||||
|
||||
for(int i = 0; i < preset->getChannelCount(); i++)
|
||||
for (int i = 0; i < preset->getChannelCount(); i++)
|
||||
{
|
||||
const Preset::ChannelConfig& channelConfig = preset->getChannelConfig(i);
|
||||
ChannelInstanceRegistration reg;
|
||||
|
||||
// if we have one instance available already, use it
|
||||
|
||||
for(int i = 0; i < openChannels.count(); i++)
|
||||
for (int i = 0; i < openChannels.count(); i++)
|
||||
{
|
||||
qDebug("DeviceSet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channelIdURI));
|
||||
|
||||
if(openChannels[i].m_channelName == channelConfig.m_channelIdURI)
|
||||
//if(openChannels[i].m_channelName == channelConfig.m_channelIdURI)
|
||||
if (compareRxChannelURIs(openChannels[i].m_channelName, channelConfig.m_channelIdURI))
|
||||
{
|
||||
qDebug("DeviceSet::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName));
|
||||
reg = openChannels.takeAt(i);
|
||||
@ -174,13 +175,16 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
|
||||
|
||||
// if we haven't one already, create one
|
||||
|
||||
if(reg.m_channelSinkAPI == 0)
|
||||
if (reg.m_channelSinkAPI == 0)
|
||||
{
|
||||
for(int i = 0; i < channelRegistrations->count(); i++)
|
||||
for (int i = 0; i < channelRegistrations->count(); i++)
|
||||
{
|
||||
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
//if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
if (compareRxChannelURIs((*channelRegistrations)[i].m_channelIdURI, channelConfig.m_channelIdURI))
|
||||
{
|
||||
qDebug("DeviceSet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||
qDebug("DeviceSet::loadChannelSettings: creating new channel [%s] from config [%s]",
|
||||
qPrintable((*channelRegistrations)[i].m_channelIdURI),
|
||||
qPrintable(channelConfig.m_channelIdURI));
|
||||
ChannelSinkAPI *rxChannel = (*channelRegistrations)[i].m_plugin->createRxChannelCS(m_deviceSourceAPI);
|
||||
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannel);
|
||||
m_rxChannelInstanceRegistrations.append(reg);
|
||||
@ -189,7 +193,7 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
|
||||
}
|
||||
}
|
||||
|
||||
if(reg.m_channelSinkAPI != 0)
|
||||
if (reg.m_channelSinkAPI != 0)
|
||||
{
|
||||
qDebug("DeviceSet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||
reg.m_channelSinkAPI->deserialize(channelConfig.m_config);
|
||||
@ -197,7 +201,7 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
|
||||
}
|
||||
|
||||
// everything, that is still "available" is not needed anymore
|
||||
for(int i = 0; i < openChannels.count(); i++)
|
||||
for (int i = 0; i < openChannels.count(); i++)
|
||||
{
|
||||
qDebug("DeviceSet::loadChannelSettings: destroying spare channel [%s]", qPrintable(openChannels[i].m_channelName));
|
||||
openChannels[i].m_channelSinkAPI->destroy();
|
||||
@ -368,3 +372,11 @@ bool DeviceSet::ChannelInstanceRegistration::operator<(const ChannelInstanceRegi
|
||||
}
|
||||
}
|
||||
|
||||
bool DeviceSet::compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI)
|
||||
{
|
||||
if ((xChannelURI == "sdrangel.channel.chanalyzerng") || (xChannelURI == "sdrangel.channel.chanalyzer")) { // renamed ChanalyzerNG to Chanalyzer in 4.0.0
|
||||
return registerdChannelURI == "sdrangel.channel.chanalyzer";
|
||||
} else {
|
||||
return registerdChannelURI == xChannelURI;
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,8 @@ private:
|
||||
|
||||
void renameRxChannelInstances();
|
||||
void renameTxChannelInstances();
|
||||
/** Use this function to support possible older identifiers in presets */
|
||||
bool compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI);
|
||||
};
|
||||
|
||||
#endif /* SDRSRV_DEVICE_DEVICESET_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user