1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-18 07:35:47 -05:00

Renamed Channel Analyzer NG to Channel Analyzer externally (no classes renaming)

This commit is contained in:
f4exb 2018-05-30 11:49:54 +02:00
parent abb335d588
commit 766e6aac1c
9 changed files with 49 additions and 21 deletions

View File

@ -30,8 +30,8 @@ MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelAnalyzerOld, Mess
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgReportChannelSampleRateChanged, Message) MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgReportChannelSampleRateChanged, Message)
const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzerng"; const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzer";
const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzerNG"; const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzer";
ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) : ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
ChannelSinkAPI(m_channelIdURI), ChannelSinkAPI(m_channelIdURI),

View File

@ -417,7 +417,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de
m_channelMarker.setBandwidth(m_rate); m_channelMarker.setBandwidth(m_rate);
m_channelMarker.setSidebands(ChannelMarker::usb); m_channelMarker.setSidebands(ChannelMarker::usb);
m_channelMarker.setCenterFrequency(0); m_channelMarker.setCenterFrequency(0);
m_channelMarker.setTitle("Channel Analyzer NG"); m_channelMarker.setTitle("Channel Analyzer");
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());

View File

@ -23,7 +23,7 @@
</font> </font>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Channel Analyzer NG</string> <string>Channel Analyzer</string>
</property> </property>
<widget class="QWidget" name="settingsContainer" native="true"> <widget class="QWidget" name="settingsContainer" native="true">
<property name="geometry"> <property name="geometry">

View File

@ -22,8 +22,8 @@
#include "chanalyzerng.h" #include "chanalyzerng.h"
const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = { const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = {
QString("Channel Analyzer NG"), QString("Channel Analyzer"),
QString("3.14.7"), QString("4.0.0"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -45,7 +45,7 @@ void ChannelAnalyzerNGSettings::resetToDefaults()
m_pllPskOrder = 1; m_pllPskOrder = 1;
m_inputType = InputSignal; m_inputType = InputSignal;
m_rgbColor = QColor(128, 128, 128).rgb(); m_rgbColor = QColor(128, 128, 128).rgb();
m_title = "Channel Analyzer NG"; m_title = "Channel Analyzer";
} }
QByteArray ChannelAnalyzerNGSettings::serialize() const QByteArray ChannelAnalyzerNGSettings::serialize() const

View File

@ -191,9 +191,12 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA
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("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 = BasebandSampleSink *rxChannel =
(*channelRegistrations)[i].m_plugin->createRxChannelBS(m_deviceSourceAPI); (*channelRegistrations)[i].m_plugin->createRxChannelBS(m_deviceSourceAPI);
PluginInstanceGUI *rxChannelGUI = PluginInstanceGUI *rxChannelGUI =
@ -272,7 +275,9 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
{ {
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 = BasebandSampleSource *txChannel =
(*channelRegistrations)[i].m_plugin->createTxChannelBS(m_deviceSinkAPI); (*channelRegistrations)[i].m_plugin->createTxChannelBS(m_deviceSinkAPI);
PluginInstanceGUI *txChannelGUI = 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;
}
}

View File

@ -97,6 +97,8 @@ private:
void renameRxChannelInstances(); void renameRxChannelInstances();
void renameTxChannelInstances(); void renameTxChannelInstances();
/** Use this function to support possible older identifiers in presets */
bool compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI);
}; };

View File

@ -163,7 +163,8 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
{ {
qDebug("DeviceSet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channelIdURI)); 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)); qDebug("DeviceSet::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName));
reg = openChannels.takeAt(i); reg = openChannels.takeAt(i);
@ -178,9 +179,12 @@ void DeviceSet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI
{ {
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); ChannelSinkAPI *rxChannel = (*channelRegistrations)[i].m_plugin->createRxChannelCS(m_deviceSourceAPI);
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannel); reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannel);
m_rxChannelInstanceRegistrations.append(reg); m_rxChannelInstanceRegistrations.append(reg);
@ -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;
}
}

View File

@ -92,6 +92,8 @@ private:
void renameRxChannelInstances(); void renameRxChannelInstances();
void renameTxChannelInstances(); 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_ */ #endif /* SDRSRV_DEVICE_DEVICESET_H_ */