mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 15:51:47 -05:00
Compare commits
16 Commits
6b2573d955
...
5d0fa7fa67
Author | SHA1 | Date | |
---|---|---|---|
|
5d0fa7fa67 | ||
|
704eb403d1 | ||
|
b85419c56a | ||
|
585d806ef8 | ||
|
1b37a4f504 | ||
|
7b4e751ba1 | ||
|
aca4a53513 | ||
|
75d40c8b68 | ||
|
d553834adf | ||
|
2b26f15463 | ||
|
2219fcd809 | ||
|
290023183c | ||
|
beaf2932ba | ||
|
f6b3b22e4f | ||
|
d2066495a9 | ||
|
9fa1974ba3 |
@ -46,7 +46,6 @@ BeamSteeringCWMod::BeamSteeringCWMod(DeviceAPI *deviceAPI) :
|
||||
m_thread(nullptr),
|
||||
m_basebandSource(nullptr),
|
||||
m_running(false),
|
||||
m_guiMessageQueue(nullptr),
|
||||
m_frequencyOffset(0),
|
||||
m_basebandSampleRate(48000)
|
||||
{
|
||||
@ -62,7 +61,7 @@ BeamSteeringCWMod::BeamSteeringCWMod(DeviceAPI *deviceAPI) :
|
||||
this,
|
||||
&BeamSteeringCWMod::networkManagerFinished
|
||||
);
|
||||
startSources();
|
||||
BeamSteeringCWMod::startSources();
|
||||
}
|
||||
|
||||
BeamSteeringCWMod::~BeamSteeringCWMod()
|
||||
@ -77,7 +76,7 @@ BeamSteeringCWMod::~BeamSteeringCWMod()
|
||||
|
||||
m_deviceAPI->removeChannelSinkAPI(this);
|
||||
m_deviceAPI->removeMIMOChannel(this);
|
||||
stopSources();
|
||||
BeamSteeringCWMod::stopSources();
|
||||
}
|
||||
|
||||
void BeamSteeringCWMod::setDeviceAPI(DeviceAPI *deviceAPI)
|
||||
@ -194,7 +193,7 @@ void BeamSteeringCWMod::applySettings(const BeamSteeringCWModSettings& settings,
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(this, "settings", pipes);
|
||||
|
||||
if (pipes.size() > 0) {
|
||||
if (!pipes.empty()) {
|
||||
sendChannelSettings(pipes, reverseAPIKeys, settings, force);
|
||||
}
|
||||
|
||||
@ -205,7 +204,7 @@ void BeamSteeringCWMod::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != 0)
|
||||
while ((message = m_inputMessageQueue.pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -218,14 +217,14 @@ bool BeamSteeringCWMod::handleMessage(const Message& cmd)
|
||||
{
|
||||
if (MsgConfigureBeamSteeringCWMod::match(cmd))
|
||||
{
|
||||
MsgConfigureBeamSteeringCWMod& cfg = (MsgConfigureBeamSteeringCWMod&) cmd;
|
||||
auto& cfg = (const MsgConfigureBeamSteeringCWMod&) cmd;
|
||||
qDebug() << "BeamSteeringCWMod::handleMessage: MsgConfigureBeamSteeringCWMod";
|
||||
applySettings(cfg.getSettings(), cfg.getForce());
|
||||
return true;
|
||||
}
|
||||
else if (DSPMIMOSignalNotification::match(cmd))
|
||||
{
|
||||
DSPMIMOSignalNotification& notif = (DSPMIMOSignalNotification&) cmd;
|
||||
auto& notif = (const DSPMIMOSignalNotification&) cmd;
|
||||
|
||||
qDebug() << "BeamSteeringCWMod::handleMessage: DSPMIMOSignalNotification:"
|
||||
<< " basebandSampleRate: " << notif.getSampleRate()
|
||||
@ -301,7 +300,7 @@ void BeamSteeringCWMod::validateFilterChainHash(BeamSteeringCWModSettings& setti
|
||||
void BeamSteeringCWMod::calculateFrequencyOffset()
|
||||
{
|
||||
double shiftFactor = HBFilterChainConverter::getShiftFactor(m_settings.m_log2Interp, m_settings.m_filterChainHash);
|
||||
m_frequencyOffset = m_basebandSampleRate * shiftFactor;
|
||||
m_frequencyOffset = (int64_t) (m_basebandSampleRate * shiftFactor);
|
||||
}
|
||||
|
||||
int BeamSteeringCWMod::webapiSettingsGet(
|
||||
@ -380,13 +379,13 @@ void BeamSteeringCWMod::webapiUpdateChannelSettings(
|
||||
settings.m_reverseAPIAddress = *response.getBeamSteeringCwModSettings()->getReverseApiAddress();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIPort")) {
|
||||
settings.m_reverseAPIPort = response.getBeamSteeringCwModSettings()->getReverseApiPort();
|
||||
settings.m_reverseAPIPort = (uint16_t) response.getBeamSteeringCwModSettings()->getReverseApiPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getBeamSteeringCwModSettings()->getReverseApiDeviceIndex();
|
||||
settings.m_reverseAPIDeviceIndex = (uint16_t) response.getBeamSteeringCwModSettings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
settings.m_reverseAPIChannelIndex = response.getBeamSteeringCwModSettings()->getReverseApiChannelIndex();
|
||||
settings.m_reverseAPIChannelIndex = (uint16_t) response.getBeamSteeringCwModSettings()->getReverseApiChannelIndex();
|
||||
}
|
||||
if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) {
|
||||
settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getBeamSteeringCwModSettings()->getChannelMarker());
|
||||
@ -429,7 +428,7 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetti
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
response.getBeamSteeringCwModSettings()->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
@ -443,16 +442,16 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetti
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
response.getBeamSteeringCwModSettings()->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BeamSteeringCWMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force)
|
||||
void BeamSteeringCWMod::webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
|
||||
@ -463,8 +462,8 @@ void BeamSteeringCWMod::webapiReverseSendSettings(QList<QString>& channelSetting
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QBuffer *buffer = new QBuffer();
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
auto *buffer = new QBuffer();
|
||||
buffer->open(QBuffer::ReadWrite);
|
||||
buffer->write(swgChannelSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
|
||||
@ -477,9 +476,9 @@ void BeamSteeringCWMod::webapiReverseSendSettings(QList<QString>& channelSetting
|
||||
|
||||
void BeamSteeringCWMod::sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const BeamSteeringCWModSettings& settings,
|
||||
bool force)
|
||||
bool force) const
|
||||
{
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
@ -487,7 +486,7 @@ void BeamSteeringCWMod::sendChannelSettings(
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
|
||||
this,
|
||||
@ -501,11 +500,11 @@ void BeamSteeringCWMod::sendChannelSettings(
|
||||
}
|
||||
|
||||
void BeamSteeringCWMod::webapiFormatChannelSettings(
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const BeamSteeringCWModSettings& settings,
|
||||
bool force
|
||||
)
|
||||
) const
|
||||
{
|
||||
swgChannelSettings->setDirection(2); // MIMO sink
|
||||
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
|
||||
@ -534,20 +533,20 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(
|
||||
|
||||
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
swgBeamSteeringCWSettings->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
|
||||
if (settings.m_rollupState && (channelSettingsKeys.contains("rollupState") || force))
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
swgBeamSteeringCWSettings->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
|
||||
void BeamSteeringCWMod::networkManagerFinished(QNetworkReply *reply)
|
||||
void BeamSteeringCWMod::networkManagerFinished(QNetworkReply *reply) const
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
|
@ -86,67 +86,64 @@ public:
|
||||
qint64 m_centerFrequency;
|
||||
};
|
||||
|
||||
BeamSteeringCWMod(DeviceAPI *deviceAPI);
|
||||
virtual ~BeamSteeringCWMod();
|
||||
virtual void destroy() { delete this; }
|
||||
virtual void setDeviceAPI(DeviceAPI *deviceAPI);
|
||||
virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
|
||||
explicit BeamSteeringCWMod(DeviceAPI *deviceAPI);
|
||||
~BeamSteeringCWMod() final;
|
||||
void destroy() final { delete this; }
|
||||
void setDeviceAPI(DeviceAPI *deviceAPI) final;
|
||||
DeviceAPI *getDeviceAPI() final { return m_deviceAPI; }
|
||||
|
||||
virtual void startSinks() {}
|
||||
virtual void stopSinks() {}
|
||||
virtual void startSources(); //!< thread start()
|
||||
virtual void stopSources(); //!< thread exit() and wait()
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex);
|
||||
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex);
|
||||
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
|
||||
virtual QString getMIMOName() { return objectName(); }
|
||||
void startSinks() final { /* Not used for MIMO */ }
|
||||
void stopSinks() final { /* Not used for MIMO */ }
|
||||
void startSources( /* Not used for MIMO */ ) final; //!< thread start()
|
||||
void stopSources( /* Not used for MIMO */ ) final; //!< thread exit() and wait()
|
||||
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex) final;
|
||||
void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex) final;
|
||||
void pushMessage(Message *msg) final { m_inputMessageQueue.push(msg); }
|
||||
QString getMIMOName() final { return objectName(); }
|
||||
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual QString getIdentifier() const { return objectName(); }
|
||||
virtual void getTitle(QString& title) { title = "BeamSteeringCWMod"; }
|
||||
virtual qint64 getCenterFrequency() const { return m_frequencyOffset; }
|
||||
virtual void setCenterFrequency(qint64) {}
|
||||
void getIdentifier(QString& id) final { id = objectName(); }
|
||||
QString getIdentifier() const final { return objectName(); }
|
||||
void getTitle(QString& title) final { title = "BeamSteeringCWMod"; }
|
||||
qint64 getCenterFrequency() const final { return m_frequencyOffset; }
|
||||
void setCenterFrequency(qint64) final { /* Not used for MIMO */ }
|
||||
uint32_t getBasebandSampleRate() const { return m_basebandSampleRate; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
|
||||
virtual int getNbSinkStreams() const { return 0; }
|
||||
virtual int getNbSourceStreams() const { return 2; }
|
||||
virtual int getStreamIndex() const { return -1; }
|
||||
int getNbSinkStreams() const final { return 0; }
|
||||
int getNbSourceStreams() const final { return 2; }
|
||||
int getStreamIndex() const final { return -1; }
|
||||
|
||||
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||
qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const final
|
||||
{
|
||||
(void) streamIndex;
|
||||
(void) sinkElseSource;
|
||||
return m_frequencyOffset;
|
||||
}
|
||||
|
||||
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||
int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage);
|
||||
int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage) final;
|
||||
|
||||
static void webapiFormatChannelSettings(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
const BeamSteeringCWModSettings& settings);
|
||||
|
||||
static void webapiUpdateChannelSettings(
|
||||
BeamSteeringCWModSettings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
BeamSteeringCWModSettings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
static const char* const m_channelIdURI;
|
||||
static const char* const m_channelId;
|
||||
@ -161,36 +158,36 @@ private:
|
||||
BasebandSampleSink* m_spectrumSink;
|
||||
BasebandSampleSink* m_scopeSink;
|
||||
BeamSteeringCWModSettings m_settings;
|
||||
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
int64_t m_frequencyOffset;
|
||||
uint32_t m_basebandSampleRate;
|
||||
int m_count0, m_count1;
|
||||
int m_count0;
|
||||
int m_count1;
|
||||
|
||||
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
|
||||
bool handleMessage(const Message& cmd) final; //!< Processing of a message. Returns true if message has actually been processed
|
||||
void applySettings(const BeamSteeringCWModSettings& settings, bool force = false);
|
||||
static void validateFilterChainHash(BeamSteeringCWModSettings& settings);
|
||||
void calculateFrequencyOffset();
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force);
|
||||
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force);
|
||||
void sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const BeamSteeringCWModSettings& settings,
|
||||
bool force
|
||||
);
|
||||
) const;
|
||||
void webapiFormatChannelSettings(
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const BeamSteeringCWModSettings& settings,
|
||||
bool force
|
||||
);
|
||||
) const;
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
void networkManagerFinished(QNetworkReply *reply) const;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BEAMSTEERINGCWSOURCE_H
|
||||
|
@ -30,15 +30,10 @@
|
||||
|
||||
BeamSteeringCWModGUI* BeamSteeringCWModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *mimoChannel)
|
||||
{
|
||||
BeamSteeringCWModGUI* gui = new BeamSteeringCWModGUI(pluginAPI, deviceUISet, mimoChannel);
|
||||
auto* gui = new BeamSteeringCWModGUI(pluginAPI, deviceUISet, mimoChannel);
|
||||
return gui;
|
||||
}
|
||||
|
||||
void BeamSteeringCWModGUI::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void BeamSteeringCWModGUI::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
@ -67,7 +62,7 @@ bool BeamSteeringCWModGUI::handleMessage(const Message& message)
|
||||
{
|
||||
if (BeamSteeringCWMod::MsgBasebandNotification::match(message))
|
||||
{
|
||||
BeamSteeringCWMod::MsgBasebandNotification& notif = (BeamSteeringCWMod::MsgBasebandNotification&) message;
|
||||
auto& notif = (const BeamSteeringCWMod::MsgBasebandNotification&) message;
|
||||
m_basebandSampleRate = notif.getSampleRate();
|
||||
m_centerFrequency = notif.getCenterFrequency();
|
||||
displayRateAndShift();
|
||||
@ -76,7 +71,7 @@ bool BeamSteeringCWModGUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (BeamSteeringCWMod::MsgConfigureBeamSteeringCWMod::match(message))
|
||||
{
|
||||
const BeamSteeringCWMod::MsgConfigureBeamSteeringCWMod& cfg = (BeamSteeringCWMod::MsgConfigureBeamSteeringCWMod&) message;
|
||||
auto& cfg = (const BeamSteeringCWMod::MsgConfigureBeamSteeringCWMod&) message;
|
||||
m_settings = cfg.getSettings();
|
||||
blockApplySettings(true);
|
||||
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
|
||||
@ -109,7 +104,7 @@ BeamSteeringCWModGUI::BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||
|
||||
m_bsCWSource = (BeamSteeringCWMod*) mimoChannel;
|
||||
m_bsCWSource->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_bsCWSource->setMessageQueueToGUI(BeamSteeringCWModGUI::getInputMessageQueue());
|
||||
m_basebandSampleRate = m_bsCWSource->getBasebandSampleRate();
|
||||
|
||||
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
@ -128,7 +123,7 @@ BeamSteeringCWModGUI::BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
|
||||
m_deviceUISet->addChannelMarker(&m_channelMarker);
|
||||
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
connect(BeamSteeringCWModGUI::getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
|
||||
displaySettings();
|
||||
makeUIConnections();
|
||||
@ -183,13 +178,13 @@ void BeamSteeringCWModGUI::displaySettings()
|
||||
|
||||
void BeamSteeringCWModGUI::displayRateAndShift()
|
||||
{
|
||||
int shift = m_shiftFrequencyFactor * m_basebandSampleRate;
|
||||
auto shift = (int) (m_shiftFrequencyFactor * m_basebandSampleRate);
|
||||
double channelSampleRate = ((double) m_basebandSampleRate) / (1<<m_settings.m_log2Interp);
|
||||
QLocale loc;
|
||||
ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
|
||||
ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
|
||||
m_channelMarker.setCenterFrequency(shift);
|
||||
m_channelMarker.setBandwidth(channelSampleRate);
|
||||
m_channelMarker.setBandwidth((int) channelSampleRate);
|
||||
}
|
||||
|
||||
void BeamSteeringCWModGUI::leaveEvent(QEvent*)
|
||||
@ -206,7 +201,7 @@ void BeamSteeringCWModGUI::handleSourceMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = getInputMessageQueue()->pop()) != 0)
|
||||
while ((message = getInputMessageQueue()->pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -215,7 +210,7 @@ void BeamSteeringCWModGUI::handleSourceMessages()
|
||||
}
|
||||
}
|
||||
|
||||
void BeamSteeringCWModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void BeamSteeringCWModGUI::onWidgetRolled(const QWidget* widget, bool rollDown)
|
||||
{
|
||||
(void) widget;
|
||||
(void) rollDown;
|
||||
@ -226,7 +221,7 @@ void BeamSteeringCWModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void BeamSteeringCWModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
@ -316,7 +311,7 @@ void BeamSteeringCWModGUI::tick()
|
||||
}
|
||||
}
|
||||
|
||||
void BeamSteeringCWModGUI::makeUIConnections()
|
||||
void BeamSteeringCWModGUI::makeUIConnections() const
|
||||
{
|
||||
QObject::connect(ui->channelOutput, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &BeamSteeringCWModGUI::on_channelOutput_currentIndexChanged);
|
||||
QObject::connect(ui->interpolationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &BeamSteeringCWModGUI::on_interpolationFactor_currentIndexChanged);
|
||||
@ -326,5 +321,5 @@ void BeamSteeringCWModGUI::makeUIConnections()
|
||||
|
||||
void BeamSteeringCWModGUI::updateAbsoluteCenterFrequency()
|
||||
{
|
||||
setStatusFrequency(m_centerFrequency + m_shiftFrequencyFactor * m_basebandSampleRate);
|
||||
setStatusFrequency(m_centerFrequency + (qint64) (m_shiftFrequencyFactor * m_basebandSampleRate));
|
||||
}
|
||||
|
@ -47,22 +47,21 @@ class BeamSteeringCWModGUI : public ChannelGUI {
|
||||
public:
|
||||
static BeamSteeringCWModGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *mimoChannel);
|
||||
|
||||
virtual void destroy();
|
||||
virtual void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
||||
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
||||
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
||||
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
||||
virtual QString getTitle() const { return m_settings.m_title; };
|
||||
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
||||
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
||||
virtual bool getHidden() const { return m_settings.m_hidden; }
|
||||
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
||||
virtual int getStreamIndex() const { return -1; }
|
||||
virtual void setStreamIndex(int streamIndex) { (void) streamIndex; }
|
||||
void resetToDefaults() final;
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
MessageQueue *getInputMessageQueue() final { return &m_inputMessageQueue; }
|
||||
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
|
||||
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
|
||||
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
|
||||
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
|
||||
QString getTitle() const final { return m_settings.m_title; };
|
||||
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
|
||||
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
|
||||
bool getHidden() const final { return m_settings.m_hidden; }
|
||||
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
|
||||
int getStreamIndex() const final { return -1; }
|
||||
void setStreamIndex(int streamIndex) final { (void) streamIndex; }
|
||||
|
||||
private:
|
||||
Ui::BeamSteeringCWModGUI* ui;
|
||||
@ -82,18 +81,18 @@ private:
|
||||
uint32_t m_tickCount;
|
||||
|
||||
explicit BeamSteeringCWModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *mimoChannel, QWidget* parent = nullptr);
|
||||
virtual ~BeamSteeringCWModGUI();
|
||||
~BeamSteeringCWModGUI() final;
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void applySettings(bool force = false);
|
||||
void displaySettings();
|
||||
void displayRateAndShift();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void makeUIConnections() const;
|
||||
void updateAbsoluteCenterFrequency();
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(EnterEventType*);
|
||||
void leaveEvent(QEvent*) final;
|
||||
void enterEvent(EnterEventType*) final;
|
||||
|
||||
void applyInterpolation();
|
||||
void applyPosition();
|
||||
@ -104,7 +103,7 @@ private slots:
|
||||
void on_interpolationFactor_currentIndexChanged(int index);
|
||||
void on_position_valueChanged(int value);
|
||||
void on_steeringDegrees_valueChanged(int value);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onWidgetRolled(const QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void tick();
|
||||
};
|
||||
|
@ -48,7 +48,6 @@ DOA2::DOA2(DeviceAPI *deviceAPI) :
|
||||
m_thread(nullptr),
|
||||
m_basebandSink(nullptr),
|
||||
m_running(false),
|
||||
m_guiMessageQueue(nullptr),
|
||||
m_frequencyOffset(0),
|
||||
m_deviceSampleRate(48000),
|
||||
m_deviceCenterFrequency(435000000)
|
||||
@ -65,7 +64,7 @@ DOA2::DOA2(DeviceAPI *deviceAPI) :
|
||||
this,
|
||||
&DOA2::networkManagerFinished
|
||||
);
|
||||
startSinks();
|
||||
DOA2::startSinks();
|
||||
}
|
||||
|
||||
DOA2::~DOA2()
|
||||
@ -80,7 +79,7 @@ DOA2::~DOA2()
|
||||
|
||||
m_deviceAPI->removeChannelSinkAPI(this);
|
||||
m_deviceAPI->removeMIMOChannel(this);
|
||||
stopSinks();
|
||||
DOA2::stopSinks();
|
||||
}
|
||||
|
||||
void DOA2::setDeviceAPI(DeviceAPI *deviceAPI)
|
||||
@ -203,7 +202,7 @@ void DOA2::applySettings(const DOA2Settings& settings, bool force)
|
||||
reverseAPIKeys.append("squelchdB");
|
||||
|
||||
if (m_running) {
|
||||
m_basebandSink->setMagThreshold(CalcDb::powerFromdB(settings.m_squelchdB));
|
||||
m_basebandSink->setMagThreshold((float) CalcDb::powerFromdB(settings.m_squelchdB));
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +216,7 @@ void DOA2::applySettings(const DOA2Settings& settings, bool force)
|
||||
}
|
||||
|
||||
if (m_running && ((m_settings.m_log2Decim != settings.m_log2Decim)
|
||||
|| (m_settings.m_filterChainHash != settings.m_filterChainHash) || force))
|
||||
|| (m_settings.m_filterChainHash != settings.m_filterChainHash) || force))
|
||||
{
|
||||
DOA2Baseband::MsgConfigureChannelizer *msg = DOA2Baseband::MsgConfigureChannelizer::create(
|
||||
settings.m_log2Decim, settings.m_filterChainHash);
|
||||
@ -238,7 +237,7 @@ void DOA2::applySettings(const DOA2Settings& settings, bool force)
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(this, "settings", pipes);
|
||||
|
||||
if (pipes.size() > 0) {
|
||||
if (!pipes.empty()) {
|
||||
sendChannelSettings(pipes, reverseAPIKeys, settings, force);
|
||||
}
|
||||
|
||||
@ -249,7 +248,7 @@ void DOA2::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != 0)
|
||||
while ((message = m_inputMessageQueue.pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -262,14 +261,14 @@ bool DOA2::handleMessage(const Message& cmd)
|
||||
{
|
||||
if (MsgConfigureDOA2::match(cmd))
|
||||
{
|
||||
MsgConfigureDOA2& cfg = (MsgConfigureDOA2&) cmd;
|
||||
auto& cfg = (const MsgConfigureDOA2&) cmd;
|
||||
qDebug() << "DOA2::handleMessage: MsgConfigureDOA2";
|
||||
applySettings(cfg.getSettings(), cfg.getForce());
|
||||
return true;
|
||||
}
|
||||
else if (DSPMIMOSignalNotification::match(cmd))
|
||||
{
|
||||
DSPMIMOSignalNotification& notif = (DSPMIMOSignalNotification&) cmd;
|
||||
auto& notif = (const DSPMIMOSignalNotification&) cmd;
|
||||
|
||||
qDebug() << "DOA2::handleMessage: DSPMIMOSignalNotification:"
|
||||
<< " inputSampleRate: " << notif.getSampleRate()
|
||||
@ -347,7 +346,7 @@ void DOA2::validateFilterChainHash(DOA2Settings& settings)
|
||||
void DOA2::calculateFrequencyOffset()
|
||||
{
|
||||
double shiftFactor = HBFilterChainConverter::getShiftFactor(m_settings.m_log2Decim, m_settings.m_filterChainHash);
|
||||
m_frequencyOffset = m_deviceSampleRate * shiftFactor;
|
||||
m_frequencyOffset = (int64_t) (m_deviceSampleRate * shiftFactor);
|
||||
}
|
||||
|
||||
void DOA2::applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash)
|
||||
@ -360,12 +359,12 @@ void DOA2::applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash)
|
||||
m_basebandSink->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
|
||||
float DOA2::getPhi() const
|
||||
double DOA2::getPhi() const
|
||||
{
|
||||
return m_basebandSink ? m_basebandSink->getPhi() : 0.0f;
|
||||
return m_basebandSink ? m_basebandSink->getPhi() : 0.0;
|
||||
}
|
||||
|
||||
float DOA2::getPositiveDOA() const
|
||||
double DOA2::getPositiveDOA() const
|
||||
{
|
||||
return std::acos(getPhi()/M_PI)*(180/M_PI);
|
||||
}
|
||||
@ -469,13 +468,13 @@ void DOA2::webapiUpdateChannelSettings(
|
||||
settings.m_reverseAPIAddress = *response.getDoa2Settings()->getReverseApiAddress();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIPort")) {
|
||||
settings.m_reverseAPIPort = response.getDoa2Settings()->getReverseApiPort();
|
||||
settings.m_reverseAPIPort = (uint16_t) response.getDoa2Settings()->getReverseApiPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getDoa2Settings()->getReverseApiDeviceIndex();
|
||||
settings.m_reverseAPIDeviceIndex = (uint16_t) response.getDoa2Settings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
settings.m_reverseAPIChannelIndex = response.getDoa2Settings()->getReverseApiChannelIndex();
|
||||
settings.m_reverseAPIChannelIndex = (uint16_t) response.getDoa2Settings()->getReverseApiChannelIndex();
|
||||
}
|
||||
if (settings.m_scopeGUI && channelSettingsKeys.contains("scopeConfig")) {
|
||||
settings.m_scopeGUI->updateFrom(channelSettingsKeys, response.getDoa2Settings()->getScopeConfig());
|
||||
@ -525,7 +524,7 @@ void DOA2::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
|
||||
auto *swgGLScope = new SWGSDRangel::SWGGLScope();
|
||||
settings.m_scopeGUI->formatTo(swgGLScope);
|
||||
response.getDoa2Settings()->setScopeConfig(swgGLScope);
|
||||
}
|
||||
@ -539,7 +538,7 @@ void DOA2::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
response.getDoa2Settings()->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
@ -553,39 +552,39 @@ void DOA2::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
response.getDoa2Settings()->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
void DOA2::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) const
|
||||
{
|
||||
float phi = normalizeAngle(getPhi() * (180/M_PI), 180.0f);
|
||||
response.getDoa2Report()->setPhi(phi);
|
||||
double phi = normalizeAngle(getPhi() * (180.0/M_PI), 180.0);
|
||||
response.getDoa2Report()->setPhi((qint32) phi);
|
||||
|
||||
float hwl = 1.5e8 / (m_deviceCenterFrequency + m_frequencyOffset);
|
||||
float cosTheta = (getPhi()/M_PI) * ((hwl * 1000.0) / m_settings.m_basebandDistance);
|
||||
float blindAngle = (m_settings.m_basebandDistance > hwl * 1000.0) ?
|
||||
double hwl = 1.5e8 / (double) (m_deviceCenterFrequency + m_frequencyOffset);
|
||||
double cosTheta = (getPhi()/M_PI) * ((hwl * 1000.0) / m_settings.m_basebandDistance);
|
||||
double blindAngle = (m_settings.m_basebandDistance > hwl * 1000.0) ?
|
||||
std::acos((hwl * 1000.0) / m_settings.m_basebandDistance) * (180/M_PI) :
|
||||
0;
|
||||
response.getDoa2Report()->setBlindAngle((int) blindAngle);
|
||||
float doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
|
||||
double doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180.0/M_PI);
|
||||
qDebug("DOA2::webapiFormatChannelReport: phi: %f cosT: %f DOAngle: %f", getPhi(), cosTheta, doaAngle);
|
||||
float posAngle = normalizeAngle(m_settings.m_antennaAz - doaAngle, 360.0f); // DOA angles are trigonometric but displayed angles are clockwise
|
||||
float negAngle = normalizeAngle(m_settings.m_antennaAz + doaAngle, 360.0f);
|
||||
response.getDoa2Report()->setPosAz(posAngle);
|
||||
response.getDoa2Report()->setNegAz(negAngle);
|
||||
double posAngle = normalizeAngle(m_settings.m_antennaAz - doaAngle, 360.0); // DOA angles are trigonometric but displayed angles are clockwise
|
||||
double negAngle = normalizeAngle(m_settings.m_antennaAz + doaAngle, 360.0);
|
||||
response.getDoa2Report()->setPosAz((qint32) posAngle);
|
||||
response.getDoa2Report()->setNegAz((qint32) negAngle);
|
||||
|
||||
response.getDoa2Report()->setFftSize(m_fftSize);
|
||||
int channelSampleRate = m_deviceSampleRate / (1<<m_settings.m_log2Decim);
|
||||
response.getDoa2Report()->setChannelSampleRate(channelSampleRate);
|
||||
}
|
||||
|
||||
void DOA2::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DOA2Settings& settings, bool force)
|
||||
void DOA2::webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const DOA2Settings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
|
||||
@ -596,8 +595,8 @@ void DOA2::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QBuffer *buffer = new QBuffer();
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
auto *buffer = new QBuffer();
|
||||
buffer->open(QBuffer::ReadWrite);
|
||||
buffer->write(swgChannelSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
|
||||
@ -610,9 +609,9 @@ void DOA2::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const
|
||||
|
||||
void DOA2::sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const DOA2Settings& settings,
|
||||
bool force)
|
||||
bool force) const
|
||||
{
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
@ -620,7 +619,7 @@ void DOA2::sendChannelSettings(
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
|
||||
this,
|
||||
@ -634,11 +633,11 @@ void DOA2::sendChannelSettings(
|
||||
}
|
||||
|
||||
void DOA2::webapiFormatChannelSettings(
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const DOA2Settings& settings,
|
||||
bool force
|
||||
)
|
||||
) const
|
||||
{
|
||||
swgChannelSettings->setDirection(2); // MIMO sink
|
||||
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
|
||||
@ -677,29 +676,26 @@ void DOA2::webapiFormatChannelSettings(
|
||||
swgDOA2Settings->setFftAveragingValue(DOA2Settings::getAveragingValue(settings.m_fftAveragingIndex));
|
||||
}
|
||||
|
||||
if (settings.m_scopeGUI)
|
||||
{
|
||||
if (channelSettingsKeys.contains("scopeConfig") || force) {
|
||||
settings.m_scopeGUI->formatTo(swgDOA2Settings->getScopeConfig());
|
||||
}
|
||||
if ((settings.m_scopeGUI) && (channelSettingsKeys.contains("scopeConfig") || force)) {
|
||||
settings.m_scopeGUI->formatTo(swgDOA2Settings->getScopeConfig());
|
||||
}
|
||||
|
||||
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
swgDOA2Settings->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
|
||||
if (settings.m_rollupState && (channelSettingsKeys.contains("rollupState") || force))
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
swgDOA2Settings->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2::networkManagerFinished(QNetworkReply *reply)
|
||||
void DOA2::networkManagerFinished(QNetworkReply *reply) const
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
@ -720,7 +716,7 @@ void DOA2::networkManagerFinished(QNetworkReply *reply)
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
float DOA2::normalizeAngle(float angle, float max)
|
||||
double DOA2::normalizeAngle(double angle, double max)
|
||||
{
|
||||
if (angle < 0) { return max + angle; }
|
||||
if (angle > max) { return angle - max; }
|
||||
|
@ -86,76 +86,73 @@ public:
|
||||
qint64 m_centerFrequency;
|
||||
};
|
||||
|
||||
DOA2(DeviceAPI *deviceAPI);
|
||||
virtual ~DOA2();
|
||||
virtual void destroy() { delete this; }
|
||||
virtual void setDeviceAPI(DeviceAPI *deviceAPI);
|
||||
virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
|
||||
explicit DOA2(DeviceAPI *deviceAPI);
|
||||
~DOA2() final;
|
||||
void destroy() final { delete this; }
|
||||
void setDeviceAPI(DeviceAPI *deviceAPI) final;
|
||||
DeviceAPI *getDeviceAPI() final { return m_deviceAPI; }
|
||||
|
||||
virtual void startSinks(); //!< thread start()
|
||||
virtual void stopSinks(); //!< thread exit() and wait()
|
||||
virtual void startSources() {}
|
||||
virtual void stopSources() {}
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex);
|
||||
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex);
|
||||
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
|
||||
virtual QString getMIMOName() { return objectName(); }
|
||||
void startSinks() final; //!< thread start()
|
||||
void stopSinks() final; //!< thread exit() and wait()
|
||||
void startSources() final { /* Not for MIMO */ }
|
||||
void stopSources() final { /* Not for MIMO */ }
|
||||
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex) final;
|
||||
void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex) final;
|
||||
void pushMessage(Message *msg) final { m_inputMessageQueue.push(msg); }
|
||||
QString getMIMOName() final { return objectName(); }
|
||||
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual QString getIdentifier() const { return objectName(); }
|
||||
virtual void getTitle(QString& title) { title = "DOA 2 sources"; }
|
||||
virtual qint64 getCenterFrequency() const { return m_frequencyOffset; }
|
||||
virtual void setCenterFrequency(qint64) {}
|
||||
void getIdentifier(QString& id) final { id = objectName(); }
|
||||
QString getIdentifier() const final { return objectName(); }
|
||||
void getTitle(QString& title) final { title = "DOA 2 sources"; }
|
||||
qint64 getCenterFrequency() const final { return m_frequencyOffset; }
|
||||
void setCenterFrequency(qint64) final { /* Not for MIMO */ }
|
||||
uint32_t getDeviceSampleRate() const { return m_deviceSampleRate; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
|
||||
virtual int getNbSinkStreams() const { return 2; }
|
||||
virtual int getNbSourceStreams() const { return 0; }
|
||||
virtual int getStreamIndex() const { return -1; }
|
||||
int getNbSinkStreams() const final { return 2; }
|
||||
int getNbSourceStreams() const final { return 0; }
|
||||
int getStreamIndex() const final { return -1; }
|
||||
|
||||
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||
qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const final
|
||||
{
|
||||
(void) streamIndex;
|
||||
(void) sinkElseSource;
|
||||
return m_frequencyOffset;
|
||||
}
|
||||
|
||||
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||
|
||||
ScopeVis *getScopeVis() { return &m_scopeSink; }
|
||||
void applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash);
|
||||
float getPhi() const;
|
||||
float getPositiveDOA() const;
|
||||
double getPhi() const;
|
||||
double getPositiveDOA() const;
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage);
|
||||
int webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage);
|
||||
int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage) final;
|
||||
|
||||
static void webapiFormatChannelSettings(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
const DOA2Settings& settings);
|
||||
|
||||
static void webapiUpdateChannelSettings(
|
||||
DOA2Settings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
DOA2Settings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
static const char* const m_channelIdURI;
|
||||
static const char* const m_channelId;
|
||||
@ -169,7 +166,6 @@ private:
|
||||
QMutex m_mutex;
|
||||
bool m_running;
|
||||
DOA2Settings m_settings;
|
||||
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
@ -177,31 +173,32 @@ private:
|
||||
int64_t m_frequencyOffset;
|
||||
uint32_t m_deviceSampleRate;
|
||||
qint64 m_deviceCenterFrequency;
|
||||
int m_count0, m_count1;
|
||||
int m_count0;
|
||||
int m_count1;
|
||||
|
||||
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
|
||||
bool handleMessage(const Message& cmd) final; //!< Processing of a message. Returns true if message has actually been processed
|
||||
void applySettings(const DOA2Settings& settings, bool force = false);
|
||||
static void validateFilterChainHash(DOA2Settings& settings);
|
||||
void calculateFrequencyOffset();
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DOA2Settings& settings, bool force);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) const;
|
||||
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const DOA2Settings& settings, bool force);
|
||||
void sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const DOA2Settings& settings,
|
||||
bool force
|
||||
);
|
||||
) const;
|
||||
void webapiFormatChannelSettings(
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const DOA2Settings& settings,
|
||||
bool force
|
||||
);
|
||||
static float normalizeAngle(float angle, float max);
|
||||
) const;
|
||||
static double normalizeAngle(double angle, double max);
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
void networkManagerFinished(QNetworkReply *reply) const;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_DOA2_H
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
private:
|
||||
DOA2Settings::CorrelationType m_correlationType;
|
||||
|
||||
MsgConfigureCorrelation(DOA2Settings::CorrelationType correlationType) :
|
||||
explicit MsgConfigureCorrelation(DOA2Settings::CorrelationType correlationType) :
|
||||
Message(),
|
||||
m_correlationType(correlationType)
|
||||
{}
|
||||
@ -103,8 +103,8 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
DOA2Baseband(int fftSize);
|
||||
~DOA2Baseband();
|
||||
explicit DOA2Baseband(int fftSize);
|
||||
~DOA2Baseband() final;
|
||||
void reset();
|
||||
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
||||
@ -114,7 +114,7 @@ public:
|
||||
|
||||
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int streamIndex);
|
||||
void setBasebandSampleRate(unsigned int sampleRate);
|
||||
float getPhi() const { return m_phi; }
|
||||
double getPhi() const { return m_phi; }
|
||||
void setMagThreshold(float threshold) { m_magThreshold = threshold * SDR_RX_SCALED * SDR_RX_SCALED; }
|
||||
void setFFTAveraging(int nbFFT);
|
||||
|
||||
@ -128,9 +128,9 @@ private:
|
||||
DOA2Settings::CorrelationType m_correlationType;
|
||||
int m_fftSize;
|
||||
int m_samplesCount; //!< Number of samples processed by DOA
|
||||
float m_magSum; //!< Squared magnitudes accumulator
|
||||
float m_wphSum; //!< Phase difference accumulator (averaging weighted by squared magnitude)
|
||||
float m_phi; //!< Resulting calculated phase difference
|
||||
double m_magSum; //!< Squared magnitudes accumulator
|
||||
double m_wphSum; //!< Phase difference accumulator (averaging weighted by squared magnitude)
|
||||
double m_phi; //!< Resulting calculated phase difference
|
||||
double m_magThreshold; //!< Squared magnitude scaled threshold
|
||||
int m_fftAvg; //!< Average over a certain number of FFTs
|
||||
int m_fftAvgCount; //!< FFT averaging counter
|
||||
|
@ -33,15 +33,10 @@
|
||||
|
||||
DOA2GUI* DOA2GUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *channelMIMO)
|
||||
{
|
||||
DOA2GUI* gui = new DOA2GUI(pluginAPI, deviceUISet, channelMIMO);
|
||||
auto* gui = new DOA2GUI(pluginAPI, deviceUISet, channelMIMO);
|
||||
return gui;
|
||||
}
|
||||
|
||||
void DOA2GUI::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void DOA2GUI::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
@ -78,7 +73,7 @@ bool DOA2GUI::handleMessage(const Message& message)
|
||||
{
|
||||
if (DOA2::MsgBasebandNotification::match(message))
|
||||
{
|
||||
DOA2::MsgBasebandNotification& notif = (DOA2::MsgBasebandNotification&) message;
|
||||
auto& notif = (const DOA2::MsgBasebandNotification&) message;
|
||||
m_sampleRate = notif.getSampleRate();
|
||||
m_centerFrequency = notif.getCenterFrequency();
|
||||
displayRateAndShift();
|
||||
@ -88,7 +83,7 @@ bool DOA2GUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (DOA2::MsgConfigureDOA2::match(message))
|
||||
{
|
||||
const DOA2::MsgConfigureDOA2& notif = (const DOA2::MsgConfigureDOA2&) message;
|
||||
auto& notif = (const DOA2::MsgConfigureDOA2&) message;
|
||||
m_settings = notif.getSettings();
|
||||
ui->scopeGUI->updateSettings();
|
||||
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
|
||||
@ -122,7 +117,7 @@ DOA2GUI::DOA2GUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *ch
|
||||
m_doa2 = (DOA2*) channelMIMO;
|
||||
m_scopeVis = m_doa2->getScopeVis();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
m_doa2->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_doa2->setMessageQueueToGUI(DOA2GUI::getInputMessageQueue());
|
||||
m_sampleRate = m_doa2->getDeviceSampleRate();
|
||||
|
||||
ui->glScope->setTraceModulo(DOA2::m_fftSize);
|
||||
@ -150,7 +145,7 @@ DOA2GUI::DOA2GUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *ch
|
||||
ui->scopeGUI->traceLengthChange();
|
||||
ui->compass->setBlindAngleBorder(true);
|
||||
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
connect(DOA2GUI::getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
|
||||
displaySettings();
|
||||
makeUIConnections();
|
||||
@ -221,20 +216,20 @@ void DOA2GUI::displaySettings()
|
||||
|
||||
void DOA2GUI::displayRateAndShift()
|
||||
{
|
||||
int shift = m_shiftFrequencyFactor * m_sampleRate;
|
||||
auto shift = (int) (m_shiftFrequencyFactor * m_sampleRate);
|
||||
double channelSampleRate = ((double) m_sampleRate) / (1<<m_settings.m_log2Decim);
|
||||
QLocale loc;
|
||||
ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
|
||||
ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
|
||||
m_channelMarker.setCenterFrequency(shift);
|
||||
m_channelMarker.setBandwidth(channelSampleRate);
|
||||
m_scopeVis->setLiveRate(channelSampleRate);
|
||||
m_channelMarker.setBandwidth((int) channelSampleRate);
|
||||
m_scopeVis->setLiveRate((int) channelSampleRate);
|
||||
}
|
||||
|
||||
void DOA2GUI::setFFTAveragingTooltip()
|
||||
{
|
||||
float channelSampleRate = ((float) m_sampleRate) / (1<<m_settings.m_log2Decim);
|
||||
float averagingTime = (DOA2::m_fftSize * DOA2Settings::getAveragingValue(m_settings.m_fftAveragingIndex)) /
|
||||
float channelSampleRate = ((float) m_sampleRate) / ((float) (1<<m_settings.m_log2Decim));
|
||||
float averagingTime = ((float) DOA2::m_fftSize * (float) DOA2Settings::getAveragingValue(m_settings.m_fftAveragingIndex)) /
|
||||
channelSampleRate;
|
||||
QString s;
|
||||
setNumberStr(averagingTime, 2, s);
|
||||
@ -274,7 +269,7 @@ void DOA2GUI::handleSourceMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = getInputMessageQueue()->pop()) != 0)
|
||||
while ((message = getInputMessageQueue()->pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -283,7 +278,7 @@ void DOA2GUI::handleSourceMessages()
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2GUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void DOA2GUI::onWidgetRolled(const QWidget* widget, bool rollDown)
|
||||
{
|
||||
(void) widget;
|
||||
(void) rollDown;
|
||||
@ -294,7 +289,7 @@ void DOA2GUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void DOA2GUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
@ -434,7 +429,7 @@ void DOA2GUI::tick()
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2GUI::makeUIConnections()
|
||||
void DOA2GUI::makeUIConnections() const
|
||||
{
|
||||
QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DOA2GUI::on_decimationFactor_currentIndexChanged);
|
||||
QObject::connect(ui->position, &QSlider::valueChanged, this, &DOA2GUI::on_position_valueChanged);
|
||||
@ -449,9 +444,9 @@ void DOA2GUI::makeUIConnections()
|
||||
|
||||
void DOA2GUI::updateAbsoluteCenterFrequency()
|
||||
{
|
||||
qint64 cf = m_centerFrequency + m_shiftFrequencyFactor * m_sampleRate;
|
||||
auto cf = (qint64) ((double) m_centerFrequency + m_shiftFrequencyFactor * m_sampleRate);
|
||||
setStatusFrequency(cf);
|
||||
m_hwl = 1.5e+8 / cf;
|
||||
m_hwl = 1.5e+8 / (double) cf;
|
||||
ui->halfWLText->setText(tr("%1").arg(m_hwl*1000, 5, 'f', 0));
|
||||
updateScopeFScale();
|
||||
}
|
||||
@ -470,14 +465,14 @@ void DOA2GUI::updateScopeFScale()
|
||||
|
||||
void DOA2GUI::updateDOA()
|
||||
{
|
||||
float cosTheta = (m_doa2->getPhi()/M_PI) * ((m_hwl * 1000.0) / m_settings.m_basebandDistance);
|
||||
float blindAngle = (m_settings.m_basebandDistance > m_hwl * 1000.0) ?
|
||||
double cosTheta = (m_doa2->getPhi()/M_PI) * ((m_hwl * 1000.0) / m_settings.m_basebandDistance);
|
||||
double blindAngle = (m_settings.m_basebandDistance > m_hwl * 1000.0) ?
|
||||
std::acos((m_hwl * 1000.0) / m_settings.m_basebandDistance) * (180/M_PI) :
|
||||
0;
|
||||
ui->compass->setBlindAngle(blindAngle);
|
||||
float doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
|
||||
float posAngle = ui->antAz->value() - doaAngle; // DOA angles are trigonometric but displayed angles are clockwise
|
||||
float negAngle = ui->antAz->value() + doaAngle;
|
||||
double doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
|
||||
double posAngle = ui->antAz->value() - doaAngle; // DOA angles are trigonometric but displayed angles are clockwise
|
||||
double negAngle = ui->antAz->value() + doaAngle;
|
||||
ui->compass->setAzPos(posAngle);
|
||||
ui->compass->setAzNeg(negAngle);
|
||||
ui->posText->setText(tr("%1").arg(ui->compass->getAzPos(), 3, 'f', 0, QLatin1Char('0')));
|
||||
|
@ -46,22 +46,21 @@ class DOA2GUI : public ChannelGUI {
|
||||
public:
|
||||
static DOA2GUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *mimoChannel);
|
||||
|
||||
virtual void destroy();
|
||||
virtual void resetToDefaults();
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue* getInputMessageQueue();
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
||||
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
||||
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
||||
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
||||
virtual QString getTitle() const { return m_settings.m_title; };
|
||||
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
||||
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
||||
virtual bool getHidden() const { return m_settings.m_hidden; }
|
||||
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
||||
virtual int getStreamIndex() const { return -1; }
|
||||
virtual void setStreamIndex(int streamIndex) { (void) streamIndex; }
|
||||
void resetToDefaults() final;
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
MessageQueue* getInputMessageQueue() final;
|
||||
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
|
||||
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
|
||||
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
|
||||
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
|
||||
QString getTitle() const final { return m_settings.m_title; };
|
||||
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
|
||||
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
|
||||
bool getHidden() const final { return m_settings.m_hidden; }
|
||||
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
|
||||
int getStreamIndex() const final { return -1; }
|
||||
void setStreamIndex(int streamIndex) final { (void) streamIndex; }
|
||||
|
||||
private:
|
||||
Ui::DOA2GUI* ui;
|
||||
@ -82,7 +81,7 @@ private:
|
||||
double m_hwl; //!< Half wavelength at center frequency
|
||||
|
||||
explicit DOA2GUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *rxChannel, QWidget* parent = nullptr);
|
||||
virtual ~DOA2GUI();
|
||||
~DOA2GUI() final;
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void applySettings(bool force = false);
|
||||
@ -93,13 +92,13 @@ private:
|
||||
void setFFTAveragingTooltip();
|
||||
static void setNumberStr(float v, int decimalPlaces, QString& s);
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void makeUIConnections() const;
|
||||
void updateAbsoluteCenterFrequency();
|
||||
void updateScopeFScale();
|
||||
void updateDOA();
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(EnterEventType*);
|
||||
void leaveEvent(QEvent*) final;
|
||||
void enterEvent(EnterEventType*) final;
|
||||
|
||||
private slots:
|
||||
void handleSourceMessages();
|
||||
@ -112,7 +111,7 @@ private slots:
|
||||
void on_squelch_valueChanged(int value);
|
||||
void on_fftAveraging_currentIndexChanged(int index);
|
||||
void on_centerPosition_clicked();
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onWidgetRolled(const QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void tick();
|
||||
};
|
||||
|
@ -83,7 +83,7 @@ Interferometer::Interferometer(DeviceAPI *deviceAPI) :
|
||||
&Interferometer::updateDeviceSetList
|
||||
);
|
||||
updateDeviceSetList();
|
||||
startSinks();
|
||||
Interferometer::startSinks();
|
||||
}
|
||||
|
||||
Interferometer::~Interferometer()
|
||||
@ -98,7 +98,7 @@ Interferometer::~Interferometer()
|
||||
|
||||
m_deviceAPI->removeChannelSinkAPI(this);
|
||||
m_deviceAPI->removeMIMOChannel(this);
|
||||
stopSinks();
|
||||
Interferometer::stopSinks();
|
||||
}
|
||||
|
||||
void Interferometer::setDeviceAPI(DeviceAPI *deviceAPI)
|
||||
@ -229,7 +229,7 @@ void Interferometer::applySettings(const InterferometerSettings& settings, const
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(this, "settings", pipes);
|
||||
|
||||
if (pipes.size() > 0) {
|
||||
if (!pipes.empty()) {
|
||||
sendChannelSettings(pipes, settingsKeys, settings, force);
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ void Interferometer::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != 0)
|
||||
while ((message = m_inputMessageQueue.pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -267,14 +267,14 @@ bool Interferometer::handleMessage(const Message& cmd)
|
||||
{
|
||||
if (MsgConfigureInterferometer::match(cmd))
|
||||
{
|
||||
MsgConfigureInterferometer& cfg = (MsgConfigureInterferometer&) cmd;
|
||||
auto& cfg = (const MsgConfigureInterferometer&) cmd;
|
||||
qDebug() << "Interferometer::handleMessage: MsgConfigureInterferometer";
|
||||
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce());
|
||||
return true;
|
||||
}
|
||||
else if (DSPMIMOSignalNotification::match(cmd))
|
||||
{
|
||||
DSPMIMOSignalNotification& notif = (DSPMIMOSignalNotification&) cmd;
|
||||
auto& notif = (const DSPMIMOSignalNotification&) cmd;
|
||||
|
||||
qDebug() << "Interferometer::handleMessage: DSPMIMOSignalNotification:"
|
||||
<< " inputSampleRate: " << notif.getSampleRate()
|
||||
@ -355,7 +355,7 @@ void Interferometer::validateFilterChainHash(InterferometerSettings& settings)
|
||||
void Interferometer::calculateFrequencyOffset(uint32_t log2Decim, uint32_t filterChainHash)
|
||||
{
|
||||
double shiftFactor = HBFilterChainConverter::getShiftFactor(log2Decim, filterChainHash);
|
||||
m_frequencyOffset = m_deviceSampleRate * shiftFactor;
|
||||
m_frequencyOffset = (int64_t) (m_deviceSampleRate * shiftFactor);
|
||||
}
|
||||
|
||||
void Interferometer::applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash)
|
||||
@ -383,7 +383,7 @@ void Interferometer::updateDeviceSetList()
|
||||
|
||||
if (deviceSourceEngine)
|
||||
{
|
||||
DeviceSampleSource *deviceSource = deviceSourceEngine->getSource();
|
||||
const DeviceSampleSource *deviceSource = deviceSourceEngine->getSource();
|
||||
|
||||
if (deviceSource->getDeviceDescription() == "LocalInput") {
|
||||
m_localInputDeviceIndexes.append(deviceSetIndex);
|
||||
@ -401,7 +401,7 @@ void Interferometer::updateDeviceSetList()
|
||||
InterferometerSettings settings = m_settings;
|
||||
int newIndexInList;
|
||||
|
||||
if (m_localInputDeviceIndexes.size() != 0) // there are some local input devices
|
||||
if (!m_localInputDeviceIndexes.empty()) // there are some local input devices
|
||||
{
|
||||
if (m_settings.m_localDeviceIndex < 0) { // not set before
|
||||
newIndexInList = 0; // set to first device in list
|
||||
@ -574,13 +574,13 @@ void Interferometer::webapiUpdateChannelSettings(
|
||||
settings.m_reverseAPIAddress = *response.getInterferometerSettings()->getReverseApiAddress();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIPort")) {
|
||||
settings.m_reverseAPIPort = response.getInterferometerSettings()->getReverseApiPort();
|
||||
settings.m_reverseAPIPort = (uint16_t) response.getInterferometerSettings()->getReverseApiPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getInterferometerSettings()->getReverseApiDeviceIndex();
|
||||
settings.m_reverseAPIDeviceIndex = (uint16_t) response.getInterferometerSettings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
settings.m_reverseAPIChannelIndex = response.getInterferometerSettings()->getReverseApiChannelIndex();
|
||||
settings.m_reverseAPIChannelIndex = (uint16_t) response.getInterferometerSettings()->getReverseApiChannelIndex();
|
||||
}
|
||||
if (settings.m_spectrumGUI && channelSettingsKeys.contains("spectrumConfig")) {
|
||||
settings.m_spectrumGUI->updateFrom(channelSettingsKeys, response.getInterferometerSettings()->getSpectrumConfig());
|
||||
@ -632,7 +632,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
|
||||
auto *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
|
||||
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
|
||||
response.getInterferometerSettings()->setSpectrumConfig(swgGLSpectrum);
|
||||
}
|
||||
@ -646,7 +646,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
|
||||
auto *swgGLScope = new SWGSDRangel::SWGGLScope();
|
||||
settings.m_scopeGUI->formatTo(swgGLScope);
|
||||
response.getInterferometerSettings()->setScopeConfig(swgGLScope);
|
||||
}
|
||||
@ -660,7 +660,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
response.getInterferometerSettings()->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
@ -674,7 +674,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
response.getInterferometerSettings()->setRollupState(swgRollupState);
|
||||
}
|
||||
@ -683,7 +683,7 @@ void Interferometer::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
|
||||
|
||||
void Interferometer::webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
|
||||
@ -694,8 +694,8 @@ void Interferometer::webapiReverseSendSettings(const QList<QString>& channelSett
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QBuffer *buffer = new QBuffer();
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
auto *buffer = new QBuffer();
|
||||
buffer->open(QBuffer::ReadWrite);
|
||||
buffer->write(swgChannelSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
|
||||
@ -710,7 +710,7 @@ void Interferometer::sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const InterferometerSettings& settings,
|
||||
bool force)
|
||||
bool force) const
|
||||
{
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
@ -718,7 +718,7 @@ void Interferometer::sendChannelSettings(
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
|
||||
this,
|
||||
@ -736,7 +736,7 @@ void Interferometer::webapiFormatChannelSettings(
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const InterferometerSettings& settings,
|
||||
bool force
|
||||
)
|
||||
) const
|
||||
{
|
||||
swgChannelSettings->setDirection(2); // MIMO sink
|
||||
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
|
||||
@ -774,34 +774,34 @@ void Interferometer::webapiFormatChannelSettings(
|
||||
|
||||
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrumConfig") || force))
|
||||
{
|
||||
SWGSDRangel::SWGGLSpectrum *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
|
||||
auto *swgGLSpectrum = new SWGSDRangel::SWGGLSpectrum();
|
||||
settings.m_spectrumGUI->formatTo(swgGLSpectrum);
|
||||
swgInterferometerSettings->setSpectrumConfig(swgGLSpectrum);
|
||||
}
|
||||
|
||||
if (settings.m_scopeGUI && (channelSettingsKeys.contains("scopeConfig") || force))
|
||||
{
|
||||
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
|
||||
auto *swgGLScope = new SWGSDRangel::SWGGLScope();
|
||||
settings.m_scopeGUI->formatTo(swgGLScope);
|
||||
swgInterferometerSettings->setScopeConfig(swgGLScope);
|
||||
}
|
||||
|
||||
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
swgInterferometerSettings->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
|
||||
if (settings.m_rollupState && (channelSettingsKeys.contains("rollupState") || force))
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
swgInterferometerSettings->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
|
||||
void Interferometer::networkManagerFinished(QNetworkReply *reply)
|
||||
void Interferometer::networkManagerFinished(QNetworkReply *reply) const
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
|
@ -108,72 +108,69 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
Interferometer(DeviceAPI *deviceAPI);
|
||||
virtual ~Interferometer();
|
||||
virtual void destroy() { delete this; }
|
||||
virtual void setDeviceAPI(DeviceAPI *deviceAPI);
|
||||
virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
|
||||
explicit Interferometer(DeviceAPI *deviceAPI);
|
||||
~Interferometer() final;
|
||||
void destroy() final { delete this; }
|
||||
void setDeviceAPI(DeviceAPI *deviceAPI) final;
|
||||
DeviceAPI *getDeviceAPI() final { return m_deviceAPI; }
|
||||
|
||||
virtual void startSinks(); //!< thread start()
|
||||
virtual void stopSinks(); //!< thread exit() and wait()
|
||||
virtual void startSources() {}
|
||||
virtual void stopSources() {}
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex);
|
||||
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex);
|
||||
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
|
||||
virtual QString getMIMOName() { return objectName(); }
|
||||
void startSinks() final; //!< thread start()
|
||||
void stopSinks() final; //!< thread exit() and wait()
|
||||
void startSources() final { /* not for MIMMO*/ }
|
||||
void stopSources() final { /* not for MIMMO*/ }
|
||||
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex) final;
|
||||
void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex) final;
|
||||
void pushMessage(Message *msg) final { m_inputMessageQueue.push(msg); }
|
||||
QString getMIMOName() final { return objectName(); }
|
||||
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual QString getIdentifier() const { return objectName(); }
|
||||
virtual void getTitle(QString& title) { title = "Interferometer"; }
|
||||
virtual qint64 getCenterFrequency() const { return m_frequencyOffset; }
|
||||
virtual void setCenterFrequency(qint64) {}
|
||||
void getIdentifier(QString& id) final { id = objectName(); }
|
||||
QString getIdentifier() const final { return objectName(); }
|
||||
void getTitle(QString& title) final { title = "Interferometer"; }
|
||||
qint64 getCenterFrequency() const final { return m_frequencyOffset; }
|
||||
void setCenterFrequency(qint64) final { /* not for MIMMO*/ }
|
||||
uint32_t getDeviceSampleRate() const { return m_deviceSampleRate; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
|
||||
virtual int getNbSinkStreams() const { return 2; }
|
||||
virtual int getNbSourceStreams() const { return 0; }
|
||||
virtual int getStreamIndex() const { return -1; }
|
||||
int getNbSinkStreams() const final { return 2; }
|
||||
int getNbSourceStreams() const final { return 0; }
|
||||
int getStreamIndex() const final { return -1; }
|
||||
|
||||
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||
qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const final
|
||||
{
|
||||
(void) streamIndex;
|
||||
(void) sinkElseSource;
|
||||
return m_frequencyOffset;
|
||||
}
|
||||
|
||||
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
ScopeVis *getScopeVis() { return &m_scopeSink; }
|
||||
void applyChannelSettings(uint32_t log2Decim, uint32_t filterChainHash);
|
||||
const QList<int>& getDeviceSetList() { return m_localInputDeviceIndexes; }
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage) final;
|
||||
|
||||
virtual int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage);
|
||||
int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage) final;
|
||||
|
||||
static void webapiFormatChannelSettings(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
const InterferometerSettings& settings);
|
||||
|
||||
static void webapiUpdateChannelSettings(
|
||||
InterferometerSettings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
InterferometerSettings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
static const char* const m_channelIdURI;
|
||||
static const char* const m_channelId;
|
||||
@ -196,11 +193,12 @@ private:
|
||||
uint64_t m_centerFrequency;
|
||||
int64_t m_frequencyOffset;
|
||||
uint32_t m_deviceSampleRate;
|
||||
int m_count0, m_count1;
|
||||
int m_count0;
|
||||
int m_count1;
|
||||
|
||||
QList<int> m_localInputDeviceIndexes;
|
||||
|
||||
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
|
||||
bool handleMessage(const Message& cmd) final; //!< Processing of a message. Returns true if message has actually been processed
|
||||
void applySettings(const InterferometerSettings& settings, const QList<QString>& settingsKeys, bool force = false);
|
||||
static void validateFilterChainHash(InterferometerSettings& settings);
|
||||
void calculateFrequencyOffset(uint32_t log2Decim, uint32_t filterChainHash);
|
||||
@ -213,17 +211,17 @@ private:
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const InterferometerSettings& settings,
|
||||
bool force
|
||||
);
|
||||
) const;
|
||||
void webapiFormatChannelSettings(
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const InterferometerSettings& settings,
|
||||
bool force
|
||||
);
|
||||
) const;
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
void networkManagerFinished(QNetworkReply *reply) const;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_INTERFEROMETER_H
|
||||
|
@ -32,15 +32,10 @@
|
||||
|
||||
InterferometerGUI* InterferometerGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *channelMIMO)
|
||||
{
|
||||
InterferometerGUI* gui = new InterferometerGUI(pluginAPI, deviceUISet, channelMIMO);
|
||||
auto* gui = new InterferometerGUI(pluginAPI, deviceUISet, channelMIMO);
|
||||
return gui;
|
||||
}
|
||||
|
||||
void InterferometerGUI::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void InterferometerGUI::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
@ -77,7 +72,7 @@ bool InterferometerGUI::handleMessage(const Message& message)
|
||||
{
|
||||
if (Interferometer::MsgBasebandNotification::match(message))
|
||||
{
|
||||
Interferometer::MsgBasebandNotification& notif = (Interferometer::MsgBasebandNotification&) message;
|
||||
auto& notif = (const Interferometer::MsgBasebandNotification&) message;
|
||||
m_sampleRate = notif.getSampleRate();
|
||||
m_centerFrequency = notif.getCenterFrequency();
|
||||
displayRateAndShift();
|
||||
@ -86,7 +81,7 @@ bool InterferometerGUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (Interferometer::MsgConfigureInterferometer::match(message))
|
||||
{
|
||||
const Interferometer::MsgConfigureInterferometer& cfg = (const Interferometer::MsgConfigureInterferometer&) message;
|
||||
auto& cfg = (const Interferometer::MsgConfigureInterferometer&) message;
|
||||
|
||||
if (cfg.getForce()) {
|
||||
m_settings = cfg.getSettings();
|
||||
@ -102,7 +97,8 @@ bool InterferometerGUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (Interferometer::MsgReportDevices::match(message))
|
||||
{
|
||||
Interferometer::MsgReportDevices& report = (Interferometer::MsgReportDevices&) message;
|
||||
auto& msg = const_cast<Message&>(message);
|
||||
auto& report = (Interferometer::MsgReportDevices&) msg;
|
||||
updateDeviceSetList(report.getDeviceSetIndexes());
|
||||
return true;
|
||||
}
|
||||
@ -135,7 +131,7 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
|
||||
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
|
||||
m_scopeVis = m_interferometer->getScopeVis();
|
||||
m_scopeVis->setGLScope(ui->glScope);
|
||||
m_interferometer->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_interferometer->setMessageQueueToGUI(InterferometerGUI::getInputMessageQueue());
|
||||
m_sampleRate = m_interferometer->getDeviceSampleRate();
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum);
|
||||
@ -175,7 +171,7 @@ InterferometerGUI::InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI
|
||||
m_scopeVis->setTraceChunkSize(Interferometer::m_fftSize); // Set scope trace length unit to FFT size
|
||||
ui->scopeGUI->traceLengthChange();
|
||||
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
connect(InterferometerGUI::getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
|
||||
updateDeviceSetList(m_interferometer->getDeviceSetList());
|
||||
displaySettings();
|
||||
@ -243,15 +239,15 @@ void InterferometerGUI::displaySettings()
|
||||
|
||||
void InterferometerGUI::displayRateAndShift()
|
||||
{
|
||||
int shift = m_shiftFrequencyFactor * m_sampleRate;
|
||||
auto shift = (int) (m_shiftFrequencyFactor * m_sampleRate);
|
||||
double channelSampleRate = ((double) m_sampleRate) / (1<<m_settings.m_log2Decim);
|
||||
QLocale loc;
|
||||
ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
|
||||
ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
|
||||
m_channelMarker.setCenterFrequency(shift);
|
||||
m_channelMarker.setBandwidth(channelSampleRate);
|
||||
ui->glSpectrum->setSampleRate(channelSampleRate);
|
||||
m_scopeVis->setLiveRate(channelSampleRate);
|
||||
m_channelMarker.setBandwidth((int) channelSampleRate);
|
||||
ui->glSpectrum->setSampleRate((int) channelSampleRate);
|
||||
m_scopeVis->setLiveRate((int) channelSampleRate);
|
||||
}
|
||||
|
||||
void InterferometerGUI::leaveEvent(QEvent*)
|
||||
@ -268,7 +264,7 @@ void InterferometerGUI::handleSourceMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = getInputMessageQueue()->pop()) != 0)
|
||||
while ((message = getInputMessageQueue()->pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -277,7 +273,7 @@ void InterferometerGUI::handleSourceMessages()
|
||||
}
|
||||
}
|
||||
|
||||
void InterferometerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void InterferometerGUI::onWidgetRolled(const QWidget* widget, bool rollDown)
|
||||
{
|
||||
(void) widget;
|
||||
(void) rollDown;
|
||||
@ -288,7 +284,7 @@ void InterferometerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void InterferometerGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
@ -330,7 +326,7 @@ void InterferometerGUI::onMenuDialogCalled(const QPoint &p)
|
||||
|
||||
void InterferometerGUI::updateDeviceSetList(const QList<int>& deviceSetIndexes)
|
||||
{
|
||||
QList<int>::const_iterator it = deviceSetIndexes.begin();
|
||||
auto it = deviceSetIndexes.begin();
|
||||
|
||||
ui->localDevice->blockSignals(true);
|
||||
|
||||
@ -343,7 +339,7 @@ void InterferometerGUI::updateDeviceSetList(const QList<int>& deviceSetIndexes)
|
||||
ui->localDevice->blockSignals(false);
|
||||
}
|
||||
|
||||
int InterferometerGUI::getLocalDeviceIndexInCombo(int localDeviceIndex)
|
||||
int InterferometerGUI::getLocalDeviceIndexInCombo(int localDeviceIndex) const
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
@ -457,7 +453,7 @@ void InterferometerGUI::tick()
|
||||
}
|
||||
}
|
||||
|
||||
void InterferometerGUI::makeUIConnections()
|
||||
void InterferometerGUI::makeUIConnections() const
|
||||
{
|
||||
QObject::connect(ui->decimationFactor, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &InterferometerGUI::on_decimationFactor_currentIndexChanged);
|
||||
QObject::connect(ui->position, &QSlider::valueChanged, this, &InterferometerGUI::on_position_valueChanged);
|
||||
@ -472,5 +468,5 @@ void InterferometerGUI::makeUIConnections()
|
||||
|
||||
void InterferometerGUI::updateAbsoluteCenterFrequency()
|
||||
{
|
||||
setStatusFrequency(m_centerFrequency + m_shiftFrequencyFactor * m_sampleRate);
|
||||
setStatusFrequency((qint64) ((double) m_centerFrequency + m_shiftFrequencyFactor * m_sampleRate));
|
||||
}
|
||||
|
@ -46,22 +46,21 @@ class InterferometerGUI : public ChannelGUI {
|
||||
public:
|
||||
static InterferometerGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *mimoChannel);
|
||||
|
||||
virtual void destroy();
|
||||
virtual void resetToDefaults();
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue* getInputMessageQueue();
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
||||
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
||||
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
||||
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
||||
virtual QString getTitle() const { return m_settings.m_title; };
|
||||
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
||||
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
||||
virtual bool getHidden() const { return m_settings.m_hidden; }
|
||||
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
||||
virtual int getStreamIndex() const { return -1; }
|
||||
virtual void setStreamIndex(int streamIndex) { (void) streamIndex; }
|
||||
void resetToDefaults() final;
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
MessageQueue* getInputMessageQueue() final;
|
||||
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
|
||||
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
|
||||
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
|
||||
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
|
||||
QString getTitle() const final { return m_settings.m_title; };
|
||||
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
|
||||
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
|
||||
bool getHidden() const final { return m_settings.m_hidden; }
|
||||
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
|
||||
int getStreamIndex() const final { return -1; }
|
||||
void setStreamIndex(int streamIndex) final { (void) streamIndex; }
|
||||
|
||||
private:
|
||||
Ui::InterferometerGUI* ui;
|
||||
@ -83,7 +82,7 @@ private:
|
||||
uint32_t m_tickCount;
|
||||
|
||||
explicit InterferometerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *rxChannel, QWidget* parent = nullptr);
|
||||
virtual ~InterferometerGUI();
|
||||
~InterferometerGUI() final;
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void applySettings(bool force = false);
|
||||
@ -92,13 +91,13 @@ private:
|
||||
void displaySettings();
|
||||
void displayRateAndShift();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void makeUIConnections() const;
|
||||
void updateAbsoluteCenterFrequency();
|
||||
void updateDeviceSetList(const QList<int>& deviceSetIndexes);
|
||||
int getLocalDeviceIndexInCombo(int localDeviceIndex);
|
||||
int getLocalDeviceIndexInCombo(int localDeviceIndex) const;
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(EnterEventType*);
|
||||
void leaveEvent(QEvent*) final;
|
||||
void enterEvent(EnterEventType*) final;
|
||||
|
||||
private slots:
|
||||
void handleSourceMessages();
|
||||
@ -111,7 +110,7 @@ private slots:
|
||||
void on_correlationType_currentIndexChanged(int index);
|
||||
void on_localDevice_currentIndexChanged(int index);
|
||||
void on_localDevicePlay_toggled(bool checked);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onWidgetRolled(const QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void tick();
|
||||
};
|
||||
|
@ -474,7 +474,7 @@ void ChannelAnalyzerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ChannelAnalyzerGUI::onMenuDialogCalled(const QPoint& p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -138,11 +138,6 @@ public:
|
||||
m_basebandSink->resetMagLevels();
|
||||
}
|
||||
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
static const char * const m_channelIdURI;
|
||||
|
@ -200,7 +200,7 @@ void ChannelPowerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ChannelPowerGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_basebandSink->getMagSqLevels(avg, peak, nbSamples); }
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}
|
||||
|
@ -3904,7 +3904,7 @@ void ADSBDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ADSBDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -163,10 +163,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -667,7 +667,7 @@ void AISDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void AISDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -394,7 +394,7 @@ void AMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void AMDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -556,7 +556,7 @@ void APTDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void APTDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -207,7 +207,7 @@ void ATVDemodGUI::handleSourceMessages()
|
||||
|
||||
void ATVDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -332,7 +332,7 @@ void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void BFMDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -349,7 +349,7 @@ void ChirpChatDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ChirpChatDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -392,10 +392,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
int getAudioSampleRate() const { return m_basebandSink->getAudioSampleRate(); }
|
||||
|
@ -451,7 +451,7 @@ void DABDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void DABDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -169,7 +169,7 @@ void DATVDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void DATVDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -163,10 +163,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -493,7 +493,7 @@ void DSCDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void DSCDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -297,7 +297,7 @@ void DSDDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void DSDDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -137,10 +137,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -373,7 +373,7 @@ void EndOfTrainDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void EndOfTrainDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -201,7 +201,7 @@ void FreeDVDemodGUI::on_spanLog2_valueChanged(int value)
|
||||
|
||||
void FreeDVDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
}
|
||||
|
||||
void setDeviceCenterFrequency(qint64 centerFrequency, int index);
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
uint32_t getChannelSampleRate() const { return m_running ? m_basebandSink->getChannelSampleRate() : 0; }
|
||||
double getMagSq() const { return m_running ? m_basebandSink->getMagSq() : 0.0; }
|
||||
|
||||
|
@ -542,7 +542,7 @@ void FT8DemodGUI::on_settings_clicked()
|
||||
|
||||
void FT8DemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -179,10 +179,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -946,7 +946,7 @@ void ILSDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ILSDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -349,7 +349,7 @@ void M17DemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void M17DemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -183,10 +183,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -450,7 +450,7 @@ void NavtexDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void NavtexDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -135,7 +135,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override { ChannelAPI::setMessageQueueToGUI(queue); }
|
||||
int getAudioSampleRate() const { return m_running ? m_basebandSink->getAudioSampleRate() : 0; }
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
@ -318,7 +318,7 @@ void NFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void NFMDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -134,10 +134,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -372,7 +372,7 @@ void PacketDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void PacketDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -190,10 +190,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -424,7 +424,7 @@ void PagerDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void PagerDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -501,7 +501,7 @@ void RadiosondeDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void RadiosondeDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -177,10 +177,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -358,7 +358,7 @@ void RttyDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void RttyDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
return m_settings.m_inputFrequencyOffset;
|
||||
}
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
uint32_t getAudioSampleRate() const { return m_running ? m_basebandSink->getAudioSampleRate() : 0; }
|
||||
uint32_t getChannelSampleRate() const { return m_running ? m_basebandSink->getChannelSampleRate() : 0; }
|
||||
double getMagSq() const { return m_running ? m_basebandSink->getMagSq() : 0.0; }
|
||||
|
@ -299,7 +299,7 @@ void SSBDemodGUI::on_filterIndex_valueChanged(int value)
|
||||
|
||||
void SSBDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -238,7 +238,7 @@ void VORDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void VORDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}
|
||||
|
@ -1111,7 +1111,7 @@ void VORDemodMCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void VORDemodMCGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -180,7 +180,7 @@ void WFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void WFMDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
void getLocalDevices(std::vector<uint32_t>& indexes);
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
|
@ -363,7 +363,7 @@ void FileSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void FileSinkGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -355,7 +355,7 @@ public:
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ void FreqScannerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void FreqScannerGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -264,7 +264,7 @@ void FreqTrackerGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void FreqTrackerGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -143,11 +143,6 @@ public:
|
||||
m_basebandSink->resetMagLevels();
|
||||
}
|
||||
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
static const char * const m_channelIdURI;
|
||||
|
@ -483,7 +483,7 @@ void HeatMapGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void HeatMapGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -333,7 +333,7 @@ void LocalSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void LocalSinkGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -540,7 +540,7 @@ void NoiseFigureGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void NoiseFigureGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -442,10 +442,6 @@ public:
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
|
||||
m_basebandSink->getMagSqLevels(avg, peak, nbSamples);
|
||||
}
|
||||
/* void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}*/
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
|
@ -1940,7 +1940,7 @@ void RadioAstronomyGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void RadioAstronomyGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -282,7 +282,7 @@ void RadioClockGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void RadioClockGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -233,7 +233,7 @@ void RemoteSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void RemoteSinkGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -164,7 +164,7 @@ public:
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
int getBasebandSampleRate() const { return m_basebandSampleRate; }
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void RemoteTCPSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void RemoteTCPSinkGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
void getLocalDevices(std::vector<uint32_t>& indexes);
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
SpectrumVis *getSpectrumVis() { return &m_spectrumVis; }
|
||||
|
@ -357,7 +357,7 @@ void SigMFFileSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void SigMFFileSinkGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -615,7 +615,7 @@ void UDPSinkGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void UDPSinkGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
return m_settings.m_inputFrequencyOffset;
|
||||
}
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
uint32_t getAudioSampleRate() const { return m_running ? m_basebandSink->getAudioSampleRate() : 0; }
|
||||
uint32_t getChannelSampleRate() const { return m_running ? m_basebandSink->getChannelSampleRate() : 0; }
|
||||
double getMagSq() const { return m_running ? m_basebandSink->getMagSq() : 0.0; }
|
||||
|
@ -59,6 +59,7 @@ void WDSPRxBaseband::reset()
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
m_sink.applyAudioSampleRate(DSPEngine::instance()->getAudioDeviceManager()->getOutputSampleRate());
|
||||
mutexLocker.unlock();
|
||||
m_sampleFifo.reset();
|
||||
m_channelSampleRate = 0;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
WDSPRxGUI* WDSPRxGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
|
||||
{
|
||||
WDSPRxGUI* gui = new WDSPRxGUI(pluginAPI, deviceUISet, rxChannel);
|
||||
auto* gui = new WDSPRxGUI(pluginAPI, deviceUISet, rxChannel);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ bool WDSPRxGUI::handleMessage(const Message& message)
|
||||
if (WDSPRx::MsgConfigureWDSPRx::match(message))
|
||||
{
|
||||
qDebug("WDSPRxGUI::handleMessage: WDSPRx::MsgConfigureWDSPRx");
|
||||
const WDSPRx::MsgConfigureWDSPRx& cfg = (WDSPRx::MsgConfigureWDSPRx&) message;
|
||||
auto& cfg = (const WDSPRx::MsgConfigureWDSPRx&) message;
|
||||
m_settings = cfg.getSettings();
|
||||
blockApplySettings(true);
|
||||
ui->spectrumGUI->updateSettings();
|
||||
@ -118,7 +118,7 @@ bool WDSPRxGUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (DSPSignalNotification::match(message))
|
||||
{
|
||||
const DSPSignalNotification& notif = (const DSPSignalNotification&) message;
|
||||
auto& notif = (const DSPSignalNotification&) message;
|
||||
m_deviceCenterFrequency = notif.getCenterFrequency();
|
||||
m_basebandSampleRate = notif.getSampleRate();
|
||||
qDebug("WDSPRxGUI::handleMessage: DSPSignalNotification: centerFrequency: %lld sampleRate: %d",
|
||||
@ -138,7 +138,7 @@ void WDSPRxGUI::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = getInputMessageQueue()->pop()) != 0)
|
||||
while ((message = getInputMessageQueue()->pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -183,7 +183,7 @@ void WDSPRxGUI::on_dsb_toggled(bool dsb)
|
||||
|
||||
void WDSPRxGUI::on_deltaFrequency_changed(qint64 value)
|
||||
{
|
||||
m_channelMarker.setCenterFrequency(value);
|
||||
m_channelMarker.setCenterFrequency((int) value);
|
||||
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
updateAbsoluteCenterFrequency();
|
||||
applySettings();
|
||||
@ -205,7 +205,7 @@ void WDSPRxGUI::on_lowCut_valueChanged(int value)
|
||||
void WDSPRxGUI::on_volume_valueChanged(int value)
|
||||
{
|
||||
ui->volumeText->setText(QString("%1").arg(value));
|
||||
m_settings.m_volume = CalcDb::powerFromdB(value);
|
||||
m_settings.m_volume = (Real) CalcDb::powerFromdB(value);
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ void WDSPRxGUI::on_rit_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_rit = checked;
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_rit = m_settings.m_rit;
|
||||
m_channelMarker.setShift(checked ? m_settings.m_ritFrequency: 0);
|
||||
m_channelMarker.setShift(checked ? (int) m_settings.m_ritFrequency: 0);
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -406,7 +406,7 @@ void WDSPRxGUI::on_profileIndex_valueChanged(int value)
|
||||
|
||||
void WDSPRxGUI::on_demod_currentIndexChanged(int index)
|
||||
{
|
||||
WDSPRxProfile::WDSPRxDemod demod = (WDSPRxProfile::WDSPRxDemod) index;
|
||||
auto demod = (WDSPRxProfile::WDSPRxDemod) index;
|
||||
|
||||
if ((m_settings.m_demod != WDSPRxProfile::DemodSSB) && (demod == WDSPRxProfile::DemodSSB)) {
|
||||
m_settings.m_dsb = false;
|
||||
@ -434,7 +434,7 @@ void WDSPRxGUI::on_demod_currentIndexChanged(int index)
|
||||
|
||||
void WDSPRxGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
@ -480,7 +480,7 @@ void WDSPRxGUI::onMenuDialogCalled(const QPoint &p)
|
||||
resetContextMenuType();
|
||||
}
|
||||
|
||||
void WDSPRxGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void WDSPRxGUI::onWidgetRolled(const QWidget* widget, bool rollDown)
|
||||
{
|
||||
(void) widget;
|
||||
(void) rollDown;
|
||||
@ -524,7 +524,7 @@ WDSPRxGUI::WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_wdspRx = (WDSPRx*) rxChannel;
|
||||
m_spectrumVis = m_wdspRx->getSpectrumVis();
|
||||
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
|
||||
m_wdspRx->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_wdspRx->setMessageQueueToGUI(WDSPRxGUI::getInputMessageQueue());
|
||||
|
||||
m_audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
|
||||
connect(m_audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect(const QPoint &)));
|
||||
@ -588,7 +588,7 @@ WDSPRxGUI::WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_deviceUISet->addChannelMarker(&m_channelMarker);
|
||||
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
|
||||
connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
|
||||
connect(WDSPRxGUI::getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
|
||||
|
||||
|
||||
m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On);
|
||||
@ -654,7 +654,7 @@ uint32_t WDSPRxGUI::getValidAudioSampleRate() const
|
||||
return sr;
|
||||
}
|
||||
|
||||
unsigned int WDSPRxGUI::spanLog2Max()
|
||||
unsigned int WDSPRxGUI::spanLog2Max() const
|
||||
{
|
||||
unsigned int spanLog2 = 0;
|
||||
for (; getValidAudioSampleRate() / (1<<spanLog2) >= 1000; spanLog2++);
|
||||
@ -668,7 +668,6 @@ void WDSPRxGUI::applyBandwidths(unsigned int spanLog2, bool force)
|
||||
unsigned int limit = s2max < 1 ? 0 : s2max - 1;
|
||||
ui->spanLog2->setMaximum(limit);
|
||||
bool dsb = ui->dsb->isChecked();
|
||||
//int spanLog2 = ui->spanLog2->value();
|
||||
m_spectrumRate = getValidAudioSampleRate() / (1<<spanLog2);
|
||||
int bw = ui->BW->value();
|
||||
int lw = ui->lowCut->value();
|
||||
@ -764,8 +763,8 @@ void WDSPRxGUI::applyBandwidths(unsigned int spanLog2, bool force)
|
||||
m_settings.m_dsb = dsb;
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_dsb = dsb;
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_spanLog2 = spanLog2;
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff = bw * 100;
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff = lw * 100;
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff = (Real) (bw * 100);
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff = (Real) (lw * 100);
|
||||
|
||||
applySettings(force);
|
||||
|
||||
@ -785,11 +784,11 @@ void WDSPRxGUI::displaySettings()
|
||||
{
|
||||
m_channelMarker.blockSignals(true);
|
||||
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
|
||||
m_channelMarker.setBandwidth(m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff * 2);
|
||||
m_channelMarker.setBandwidth((int) (m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff * 2));
|
||||
m_channelMarker.setTitle(m_settings.m_title);
|
||||
m_channelMarker.setLowCutoff(m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff);
|
||||
m_channelMarker.setLowCutoff((int) m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff);
|
||||
int shift = m_settings.m_profiles[m_settings.m_profileIndex].m_rit ?
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_ritFrequency :
|
||||
(int) m_settings.m_profiles[m_settings.m_profileIndex].m_ritFrequency :
|
||||
0;
|
||||
m_channelMarker.setShift(shift);
|
||||
|
||||
@ -880,7 +879,7 @@ void WDSPRxGUI::displaySettings()
|
||||
ui->dsb->setChecked(m_settings.m_dsb);
|
||||
ui->spanLog2->setValue(1 + ui->spanLog2->maximum() - m_settings.m_profiles[m_settings.m_profileIndex].m_spanLog2);
|
||||
|
||||
ui->BW->setValue(m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff / 100.0);
|
||||
ui->BW->setValue((int) (m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff / 100.0));
|
||||
s = QString::number(m_settings.m_profiles[m_settings.m_profileIndex].m_highCutoff/1000.0, 'f', 1);
|
||||
|
||||
if (m_settings.m_dsb) {
|
||||
@ -899,10 +898,10 @@ void WDSPRxGUI::displaySettings()
|
||||
|
||||
// The only one of the four signals triggering applyBandwidths will trigger it once only with all other values
|
||||
// set correctly and therefore validate the settings and apply them to dependent widgets
|
||||
ui->lowCut->setValue(m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff / 100.0);
|
||||
ui->lowCut->setValue((int) (m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff / 100.0));
|
||||
ui->lowCutText->setText(tr("%1k").arg(m_settings.m_profiles[m_settings.m_profileIndex].m_lowCutoff / 1000.0));
|
||||
|
||||
int volume = CalcDb::dbPower(m_settings.m_volume);
|
||||
auto volume = (int) CalcDb::dbPower(m_settings.m_volume);
|
||||
ui->volume->setValue(volume);
|
||||
ui->volumeText->setText(QString("%1").arg(volume));
|
||||
|
||||
@ -1199,15 +1198,11 @@ void WDSPRxGUI::amSetup(int iValueChanged)
|
||||
|
||||
auto valueChanged = (WDSPRxAMDialog::ValueChanged) iValueChanged;
|
||||
|
||||
switch (valueChanged)
|
||||
if (valueChanged == WDSPRxAMDialog::ChangedFadeLevel)
|
||||
{
|
||||
case WDSPRxAMDialog::ChangedFadeLevel:
|
||||
m_settings.m_amFadeLevel = m_amDialog->getFadeLevel();
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_amFadeLevel = m_settings.m_amFadeLevel;
|
||||
applySettings();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1369,21 +1364,18 @@ void WDSPRxGUI::panSetup(int iValueChanged)
|
||||
|
||||
auto valueChanged = (WDSPRxPanDialog::ValueChanged) iValueChanged;
|
||||
|
||||
switch (valueChanged)
|
||||
if (valueChanged == WDSPRxPanDialog::ChangedPan)
|
||||
{
|
||||
case WDSPRxPanDialog::ChangedPan:
|
||||
m_settings.m_audioPan = m_panDialog->getPan();
|
||||
m_settings.m_profiles[m_settings.m_profileIndex].m_audioPan = m_settings.m_audioPan;
|
||||
applySettings();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WDSPRxGUI::tick()
|
||||
{
|
||||
double powDbAvg, powDbPeak;
|
||||
double powDbAvg;
|
||||
double powDbPeak;
|
||||
int nbMagsqSamples;
|
||||
m_wdspRx->getMagSqLevels(powDbAvg, powDbPeak, nbMagsqSamples); // powers directly in dB
|
||||
|
||||
@ -1416,7 +1408,7 @@ void WDSPRxGUI::tick()
|
||||
m_tickCount++;
|
||||
}
|
||||
|
||||
void WDSPRxGUI::makeUIConnections()
|
||||
void WDSPRxGUI::makeUIConnections() const
|
||||
{
|
||||
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &WDSPRxGUI::on_deltaFrequency_changed);
|
||||
QObject::connect(ui->audioBinaural, &QToolButton::toggled, this, &WDSPRxGUI::on_audioBinaural_toggled);
|
||||
|
@ -58,21 +58,21 @@ public:
|
||||
static WDSPRxGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
||||
virtual void destroy();
|
||||
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
||||
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
||||
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
||||
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
||||
virtual QString getTitle() const { return m_settings.m_title; };
|
||||
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
||||
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
||||
virtual bool getHidden() const { return m_settings.m_hidden; }
|
||||
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
||||
virtual int getStreamIndex() const { return m_settings.m_streamIndex; }
|
||||
virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; }
|
||||
void resetToDefaults() final;
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
MessageQueue *getInputMessageQueue() final { return &m_inputMessageQueue; }
|
||||
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
|
||||
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
|
||||
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
|
||||
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
|
||||
QString getTitle() const final { return m_settings.m_title; };
|
||||
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
|
||||
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
|
||||
bool getHidden() const final { return m_settings.m_hidden; }
|
||||
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
|
||||
int getStreamIndex() const final { return m_settings.m_streamIndex; }
|
||||
void setStreamIndex(int streamIndex) final { m_settings.m_streamIndex = streamIndex; }
|
||||
|
||||
public slots:
|
||||
void channelMarkerChangedByCursor();
|
||||
@ -122,21 +122,21 @@ private:
|
||||
QIcon m_iconDSBUSB;
|
||||
QIcon m_iconDSBLSB;
|
||||
|
||||
explicit WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet* deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
||||
virtual ~WDSPRxGUI();
|
||||
explicit WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet* deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = nullptr);
|
||||
~WDSPRxGUI() final;
|
||||
|
||||
bool blockApplySettings(bool block);
|
||||
void applySettings(bool force = false);
|
||||
void applyBandwidths(unsigned int spanLog2, bool force = false);
|
||||
unsigned int spanLog2Max();
|
||||
unsigned int spanLog2Max() const;
|
||||
void displaySettings();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void makeUIConnections() const;
|
||||
void updateAbsoluteCenterFrequency();
|
||||
uint32_t getValidAudioSampleRate() const;
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(EnterEventType*);
|
||||
void leaveEvent(QEvent*) final;
|
||||
void enterEvent(EnterEventType*) final;
|
||||
|
||||
private slots:
|
||||
void on_deltaFrequency_changed(qint64 value);
|
||||
@ -164,7 +164,7 @@ private slots:
|
||||
void on_rit_toggled(bool checked);
|
||||
void on_ritFrequency_valueChanged(int value);
|
||||
void on_dbOrS_toggled(bool checked);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onWidgetRolled(const QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void handleInputMessages();
|
||||
void audioSelect(const QPoint& p);
|
||||
|
@ -219,7 +219,7 @@ public:
|
||||
|
||||
double getMagSq() const;
|
||||
void getMagSqLevels(double& avg, double& peak, int& nbSamples) const;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
static const char* const m_channelIdURI;
|
||||
|
@ -369,7 +369,7 @@ void FileSourceGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void FileSourceGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -237,7 +237,7 @@ void LocalSourceGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void LocalSourceGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -331,7 +331,7 @@ void IEEE_802_15_4_ModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void IEEE_802_15_4_ModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -353,7 +353,7 @@ void AISModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void AISModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -55,19 +55,9 @@ const char* const AMMod::m_channelId ="AMMod";
|
||||
|
||||
AMMod::AMMod(DeviceAPI *deviceAPI) :
|
||||
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_fileSize(0),
|
||||
m_recordLength(0),
|
||||
m_sampleRate(48000)
|
||||
m_deviceAPI(deviceAPI)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
m_thread = new QThread(this);
|
||||
m_basebandSource = new AMModBaseband();
|
||||
m_basebandSource->setInputFileStream(&m_ifstream);
|
||||
m_basebandSource->setChannel(this);
|
||||
m_basebandSource->moveToThread(m_thread);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
|
||||
m_deviceAPI->addChannelSource(this);
|
||||
@ -93,8 +83,8 @@ AMMod::~AMMod()
|
||||
delete m_networkManager;
|
||||
m_deviceAPI->removeChannelSourceAPI(this);
|
||||
m_deviceAPI->removeChannelSource(this);
|
||||
delete m_basebandSource;
|
||||
delete m_thread;
|
||||
|
||||
AMMod::stop();
|
||||
}
|
||||
|
||||
void AMMod::setDeviceAPI(DeviceAPI *deviceAPI)
|
||||
@ -116,21 +106,61 @@ uint32_t AMMod::getNumberOfDeviceStreams() const
|
||||
|
||||
void AMMod::start()
|
||||
{
|
||||
if (m_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug("AMMod::start");
|
||||
m_thread = new QThread(this);
|
||||
m_basebandSource = new AMModBaseband();
|
||||
m_basebandSource->setInputFileStream(&m_ifstream);
|
||||
m_basebandSource->setChannel(this);
|
||||
m_basebandSource->reset();
|
||||
m_basebandSource->setCWKeyer(&m_cwKeyer);
|
||||
m_basebandSource->moveToThread(m_thread);
|
||||
|
||||
QObject::connect(
|
||||
m_thread,
|
||||
&QThread::finished,
|
||||
m_basebandSource,
|
||||
&QObject::deleteLater
|
||||
);
|
||||
QObject::connect(
|
||||
m_thread,
|
||||
&QThread::finished,
|
||||
m_thread,
|
||||
&QThread::deleteLater
|
||||
);
|
||||
|
||||
m_thread->start();
|
||||
|
||||
AMModBaseband::MsgConfigureAMModBaseband *msg = AMModBaseband::MsgConfigureAMModBaseband::create(m_settings, true);
|
||||
m_basebandSource->getInputMessageQueue()->push(msg);
|
||||
|
||||
if (m_levelMeter) {
|
||||
connect(m_basebandSource, SIGNAL(levelChanged(qreal, qreal, int)), m_levelMeter, SLOT(levelChanged(qreal, qreal, int)));
|
||||
}
|
||||
|
||||
m_running = true;
|
||||
}
|
||||
|
||||
void AMMod::stop()
|
||||
{
|
||||
if (!m_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug("AMMod::stop");
|
||||
m_running = false;
|
||||
m_thread->exit();
|
||||
m_thread->wait();
|
||||
}
|
||||
|
||||
void AMMod::pull(SampleVector::iterator& begin, unsigned int nbSamples)
|
||||
{
|
||||
m_basebandSource->pull(begin, nbSamples);
|
||||
if (m_running) {
|
||||
m_basebandSource->pull(begin, nbSamples);
|
||||
}
|
||||
}
|
||||
|
||||
void AMMod::setCenterFrequency(qint64 frequency)
|
||||
@ -150,7 +180,7 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
{
|
||||
if (MsgConfigureAMMod::match(cmd))
|
||||
{
|
||||
MsgConfigureAMMod& cfg = (MsgConfigureAMMod&) cmd;
|
||||
auto& cfg = (const MsgConfigureAMMod&) cmd;
|
||||
qDebug() << "AMMod::handleMessage: MsgConfigureAMMod";
|
||||
|
||||
applySettings(cfg.getSettings(), cfg.getForce());
|
||||
@ -159,7 +189,7 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (MsgConfigureFileSourceName::match(cmd))
|
||||
{
|
||||
MsgConfigureFileSourceName& conf = (MsgConfigureFileSourceName&) cmd;
|
||||
auto& conf = (const MsgConfigureFileSourceName&) cmd;
|
||||
m_fileName = conf.getFileName();
|
||||
qDebug() << "AMMod::handleMessage: MsgConfigureFileSourceName";
|
||||
openFileStream();
|
||||
@ -167,7 +197,7 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (MsgConfigureFileSourceSeek::match(cmd))
|
||||
{
|
||||
MsgConfigureFileSourceSeek& conf = (MsgConfigureFileSourceSeek&) cmd;
|
||||
auto& conf = (const MsgConfigureFileSourceSeek&) cmd;
|
||||
int seekPercentage = conf.getPercentage();
|
||||
qDebug() << "AMMod::handleMessage: MsgConfigureFileSourceSeek";
|
||||
seekFileStream(seekPercentage);
|
||||
@ -176,13 +206,13 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (MsgConfigureFileSourceStreamTiming::match(cmd))
|
||||
{
|
||||
std::size_t samplesCount;
|
||||
std::size_t samplesCount;
|
||||
|
||||
if (m_ifstream.eof()) {
|
||||
samplesCount = m_fileSize / sizeof(Real);
|
||||
} else {
|
||||
samplesCount = m_ifstream.tellg() / sizeof(Real);
|
||||
}
|
||||
if (m_ifstream.eof()) {
|
||||
samplesCount = m_fileSize / sizeof(Real);
|
||||
} else {
|
||||
samplesCount = m_ifstream.tellg() / sizeof(Real);
|
||||
}
|
||||
|
||||
MsgReportFileSourceStreamTiming *report;
|
||||
report = MsgReportFileSourceStreamTiming::create(samplesCount);
|
||||
@ -192,7 +222,7 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (CWKeyer::MsgConfigureCWKeyer::match(cmd))
|
||||
{
|
||||
const CWKeyer::MsgConfigureCWKeyer& cfg = (CWKeyer::MsgConfigureCWKeyer&) cmd;
|
||||
auto& cfg = (const CWKeyer::MsgConfigureCWKeyer&) cmd;
|
||||
qDebug() << "AMMod::handleMessage: MsgConfigureCWKeyer";
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
@ -203,11 +233,13 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (DSPSignalNotification::match(cmd))
|
||||
{
|
||||
// Forward to the source
|
||||
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
|
||||
DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy
|
||||
qDebug() << "AMMod::handleMessage: DSPSignalNotification";
|
||||
m_basebandSource->getInputMessageQueue()->push(rep);
|
||||
// Forward to the source
|
||||
auto& notif = (const DSPSignalNotification&) cmd;
|
||||
|
||||
if (m_running) {
|
||||
m_basebandSource->getInputMessageQueue()->push(new DSPSignalNotification(notif));
|
||||
}
|
||||
// Forward to GUI if any
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(new DSPSignalNotification(notif));
|
||||
@ -239,7 +271,7 @@ void AMMod::openFileStream()
|
||||
m_ifstream.seekg(0,std::ios_base::beg);
|
||||
|
||||
m_sampleRate = 48000; // fixed rate
|
||||
m_recordLength = m_fileSize / (sizeof(Real) * m_sampleRate);
|
||||
m_recordLength = (quint32) (m_fileSize / (sizeof(Real) * m_sampleRate));
|
||||
|
||||
qDebug() << "AMMod::openFileStream: " << m_fileName.toStdString().c_str()
|
||||
<< " fileSize: " << m_fileSize << "bytes"
|
||||
@ -338,8 +370,11 @@ void AMMod::applySettings(const AMModSettings& settings, bool force)
|
||||
reverseAPIKeys.append("streamIndex");
|
||||
}
|
||||
|
||||
AMModBaseband::MsgConfigureAMModBaseband *msg = AMModBaseband::MsgConfigureAMModBaseband::create(settings, force);
|
||||
m_basebandSource->getInputMessageQueue()->push(msg);
|
||||
if (m_running)
|
||||
{
|
||||
AMModBaseband::MsgConfigureAMModBaseband *msg = AMModBaseband::MsgConfigureAMModBaseband::create(settings, force);
|
||||
m_basebandSource->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
|
||||
if (settings.m_useReverseAPI)
|
||||
{
|
||||
@ -354,7 +389,7 @@ void AMMod::applySettings(const AMModSettings& settings, bool force)
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(this, "settings", pipes);
|
||||
|
||||
if (pipes.size() > 0) {
|
||||
if (!pipes.empty()) {
|
||||
sendChannelSettings(pipes, reverseAPIKeys, settings, force);
|
||||
}
|
||||
|
||||
@ -383,12 +418,12 @@ bool AMMod::deserialize(const QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
void AMMod::sendSampleRateToDemodAnalyzer()
|
||||
void AMMod::sendSampleRateToDemodAnalyzer() const
|
||||
{
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (pipes.size() > 0)
|
||||
if (!pipes.empty())
|
||||
{
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
@ -412,7 +447,7 @@ int AMMod::webapiSettingsGet(
|
||||
webapiFormatChannelSettings(response, m_settings);
|
||||
|
||||
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = response.getAmModSettings()->getCwKeyer();
|
||||
const CWKeyerSettings& cwKeyerSettings = m_basebandSource->getCWKeyer().getSettings();
|
||||
const CWKeyerSettings& cwKeyerSettings = getCWKeyer()->getSettings();
|
||||
CWKeyer::webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
|
||||
|
||||
return 200;
|
||||
@ -440,11 +475,11 @@ int AMMod::webapiSettingsPutPatch(
|
||||
if (channelSettingsKeys.contains("cwKeyer"))
|
||||
{
|
||||
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = response.getAmModSettings()->getCwKeyer();
|
||||
CWKeyerSettings cwKeyerSettings = m_basebandSource->getCWKeyer().getSettings();
|
||||
CWKeyerSettings cwKeyerSettings = getCWKeyer()->getSettings();
|
||||
CWKeyer::webapiSettingsPutPatch(channelSettingsKeys, cwKeyerSettings, apiCwKeyerSettings);
|
||||
|
||||
CWKeyer::MsgConfigureCWKeyer *msgCwKeyer = CWKeyer::MsgConfigureCWKeyer::create(cwKeyerSettings, force);
|
||||
m_basebandSource->getCWKeyer().getInputMessageQueue()->push(msgCwKeyer);
|
||||
getCWKeyer()->getInputMessageQueue()->push(msgCwKeyer);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
@ -515,13 +550,13 @@ void AMMod::webapiUpdateChannelSettings(
|
||||
settings.m_reverseAPIAddress = *response.getAmModSettings()->getReverseApiAddress();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIPort")) {
|
||||
settings.m_reverseAPIPort = response.getAmModSettings()->getReverseApiPort();
|
||||
settings.m_reverseAPIPort = (uint16_t) response.getAmModSettings()->getReverseApiPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
settings.m_reverseAPIDeviceIndex = response.getAmModSettings()->getReverseApiDeviceIndex();
|
||||
settings.m_reverseAPIDeviceIndex = (uint16_t) response.getAmModSettings()->getReverseApiDeviceIndex();
|
||||
}
|
||||
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
settings.m_reverseAPIChannelIndex = response.getAmModSettings()->getReverseApiChannelIndex();
|
||||
settings.m_reverseAPIChannelIndex = (uint16_t) response.getAmModSettings()->getReverseApiChannelIndex();
|
||||
}
|
||||
if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) {
|
||||
settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getAmModSettings()->getChannelMarker());
|
||||
@ -591,7 +626,7 @@ void AMMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respons
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
response.getAmModSettings()->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
@ -605,23 +640,27 @@ void AMMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respons
|
||||
}
|
||||
else
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
response.getAmModSettings()->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AMMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
void AMMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) const
|
||||
{
|
||||
response.getAmModReport()->setChannelPowerDb(CalcDb::dbPower(getMagSq()));
|
||||
response.getAmModReport()->setAudioSampleRate(m_basebandSource->getAudioSampleRate());
|
||||
response.getAmModReport()->setChannelSampleRate(m_basebandSource->getChannelSampleRate());
|
||||
response.getAmModReport()->setChannelPowerDb((float) CalcDb::dbPower(getMagSq()));
|
||||
|
||||
if (m_running)
|
||||
{
|
||||
response.getAmModReport()->setAudioSampleRate(m_basebandSource->getAudioSampleRate());
|
||||
response.getAmModReport()->setChannelSampleRate(m_basebandSource->getChannelSampleRate());
|
||||
}
|
||||
}
|
||||
|
||||
void AMMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const AMModSettings& settings, bool force)
|
||||
void AMMod::webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const AMModSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
|
||||
@ -632,8 +671,8 @@ void AMMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QBuffer *buffer = new QBuffer();
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
auto *buffer = new QBuffer();
|
||||
buffer->open(QBuffer::ReadWrite);
|
||||
buffer->write(swgChannelSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
|
||||
@ -646,7 +685,7 @@ void AMMod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const
|
||||
|
||||
void AMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
swgChannelSettings->setDirection(1); // single source (Tx)
|
||||
swgChannelSettings->setChannelType(new QString("AMMod"));
|
||||
swgChannelSettings->setAmModSettings(new SWGSDRangel::SWGAMModSettings());
|
||||
@ -654,7 +693,7 @@ void AMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
|
||||
|
||||
swgAMModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
|
||||
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgAMModSettings->getCwKeyer();
|
||||
m_basebandSource->getCWKeyer().webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
|
||||
CWKeyer::webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
|
||||
|
||||
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
|
||||
.arg(m_settings.m_reverseAPIAddress)
|
||||
@ -664,8 +703,8 @@ void AMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
|
||||
m_networkRequest.setUrl(QUrl(channelSettingsURL));
|
||||
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QBuffer *buffer = new QBuffer();
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
auto *buffer = new QBuffer();
|
||||
buffer->open(QBuffer::ReadWrite);
|
||||
buffer->write(swgChannelSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
|
||||
@ -678,7 +717,7 @@ void AMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings)
|
||||
|
||||
void AMMod::sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const AMModSettings& settings,
|
||||
bool force)
|
||||
{
|
||||
@ -688,7 +727,7 @@ void AMMod::sendChannelSettings(
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
auto *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
|
||||
this,
|
||||
@ -702,7 +741,7 @@ void AMMod::sendChannelSettings(
|
||||
}
|
||||
|
||||
void AMMod::webapiFormatChannelSettings(
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const AMModSettings& settings,
|
||||
bool force
|
||||
@ -756,28 +795,28 @@ void AMMod::webapiFormatChannelSettings(
|
||||
|
||||
if (force)
|
||||
{
|
||||
const CWKeyerSettings& cwKeyerSettings = m_basebandSource->getCWKeyer().getSettings();
|
||||
const CWKeyerSettings& cwKeyerSettings = getCWKeyer()->getSettings();
|
||||
swgAMModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
|
||||
SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgAMModSettings->getCwKeyer();
|
||||
m_basebandSource->getCWKeyer().webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
|
||||
CWKeyer::webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
|
||||
}
|
||||
|
||||
if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force))
|
||||
{
|
||||
SWGSDRangel::SWGChannelMarker *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
auto *swgChannelMarker = new SWGSDRangel::SWGChannelMarker();
|
||||
settings.m_channelMarker->formatTo(swgChannelMarker);
|
||||
swgAMModSettings->setChannelMarker(swgChannelMarker);
|
||||
}
|
||||
|
||||
if (settings.m_rollupState && (channelSettingsKeys.contains("rollupState") || force))
|
||||
{
|
||||
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
auto *swgRollupState = new SWGSDRangel::SWGRollupState();
|
||||
settings.m_rollupState->formatTo(swgRollupState);
|
||||
swgAMModSettings->setRollupState(swgRollupState);
|
||||
}
|
||||
}
|
||||
|
||||
void AMMod::networkManagerFinished(QNetworkReply *reply)
|
||||
void AMMod::networkManagerFinished(QNetworkReply *reply) const
|
||||
{
|
||||
QNetworkReply::NetworkError replyError = reply->error();
|
||||
|
||||
@ -800,25 +839,32 @@ void AMMod::networkManagerFinished(QNetworkReply *reply)
|
||||
|
||||
double AMMod::getMagSq() const
|
||||
{
|
||||
return m_basebandSource->getMagSq();
|
||||
if (m_running) {
|
||||
return m_basebandSource->getMagSq();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CWKeyer *AMMod::getCWKeyer()
|
||||
{
|
||||
return &m_basebandSource->getCWKeyer();
|
||||
}
|
||||
|
||||
void AMMod::setLevelMeter(QObject *levelMeter)
|
||||
{
|
||||
connect(m_basebandSource, SIGNAL(levelChanged(qreal, qreal, int)), levelMeter, SLOT(levelChanged(qreal, qreal, int)));
|
||||
return &m_cwKeyer;
|
||||
}
|
||||
|
||||
int AMMod::getAudioSampleRate() const
|
||||
{
|
||||
return m_basebandSource->getAudioSampleRate();
|
||||
if (m_running) {
|
||||
return m_basebandSource->getAudioSampleRate();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AMMod::getFeedbackAudioSampleRate() const
|
||||
{
|
||||
return m_basebandSource->getFeedbackAudioSampleRate();
|
||||
if (m_running) {
|
||||
return m_basebandSource->getFeedbackAudioSampleRate();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#include "dsp/basebandsamplesource.h"
|
||||
#include "dsp/cwkeyer.h"
|
||||
#include "channel/channelapi.h"
|
||||
#include "util/message.h"
|
||||
|
||||
@ -235,7 +236,7 @@ public:
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
double getMagSq() const;
|
||||
CWKeyer *getCWKeyer();
|
||||
void setLevelMeter(QObject *levelMeter);
|
||||
void setLevelMeter(QObject *levelMeter) { m_levelMeter = levelMeter; }
|
||||
int getAudioSampleRate() const;
|
||||
int getFeedbackAudioSampleRate() const;
|
||||
|
||||
@ -250,6 +251,7 @@ private:
|
||||
|
||||
DeviceAPI* m_deviceAPI;
|
||||
QThread *m_thread;
|
||||
bool m_running = false;
|
||||
AMModBaseband* m_basebandSource;
|
||||
AMModSettings m_settings;
|
||||
|
||||
@ -258,36 +260,38 @@ private:
|
||||
|
||||
std::ifstream m_ifstream;
|
||||
QString m_fileName;
|
||||
quint64 m_fileSize; //!< raw file size (bytes)
|
||||
quint32 m_recordLength; //!< record length in seconds computed from file size
|
||||
int m_sampleRate;
|
||||
quint64 m_fileSize = 0; //!< raw file size (bytes)
|
||||
quint32 m_recordLength = 0; //!< record length in seconds computed from file size
|
||||
int m_sampleRate = 48000;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
CWKeyer m_cwKeyer;
|
||||
QObject *m_levelMeter = nullptr;
|
||||
|
||||
virtual bool handleMessage(const Message& cmd);
|
||||
void applySettings(const AMModSettings& settings, bool force = false);
|
||||
void sendSampleRateToDemodAnalyzer();
|
||||
void sendSampleRateToDemodAnalyzer() const;
|
||||
void openFileStream();
|
||||
void seekFileStream(int seekPercentage);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const AMModSettings& settings, bool force);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) const;
|
||||
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const AMModSettings& settings, bool force);
|
||||
void webapiReverseSendCWSettings(const CWKeyerSettings& settings);
|
||||
void sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
const AMModSettings& settings,
|
||||
bool force
|
||||
);
|
||||
void webapiFormatChannelSettings(
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const QList<QString>& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const AMModSettings& settings,
|
||||
bool force
|
||||
);
|
||||
|
||||
private slots:
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
void networkManagerFinished(QNetworkReply *reply) const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "dsp/upchannelizer.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/cwkeyer.h"
|
||||
|
||||
#include "ammodbaseband.h"
|
||||
|
||||
@ -171,8 +172,8 @@ bool AMModBaseband::handleMessage(const Message& cmd)
|
||||
qDebug() << "AMModBaseband::handleMessage: MsgConfigureCWKeyer";
|
||||
const CWKeyer::MsgConfigureCWKeyer& cfg = (CWKeyer::MsgConfigureCWKeyer&) cmd;
|
||||
CWKeyer::MsgConfigureCWKeyer *notif = new CWKeyer::MsgConfigureCWKeyer(cfg);
|
||||
CWKeyer& cwKeyer = m_source.getCWKeyer();
|
||||
cwKeyer.getInputMessageQueue()->push(notif);
|
||||
CWKeyer *cwKeyer = m_source.getCWKeyer();
|
||||
cwKeyer->getInputMessageQueue()->push(notif);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
void reset();
|
||||
void pull(const SampleVector::iterator& begin, unsigned int nbSamples);
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
||||
CWKeyer& getCWKeyer() { return m_source.getCWKeyer(); }
|
||||
void setCWKeyer(CWKeyer *cwKeyer) { m_source.setCWKeyer(cwKeyer); }
|
||||
double getMagSq() const { return m_source.getMagSq(); }
|
||||
int getAudioSampleRate() const { return m_source.getAudioSampleRate(); }
|
||||
int getFeedbackAudioSampleRate() const { return m_source.getFeedbackAudioSampleRate(); }
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
AMModGUI* AMModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
|
||||
{
|
||||
AMModGUI* gui = new AMModGUI(pluginAPI, deviceUISet, channelTx);
|
||||
auto* gui = new AMModGUI(pluginAPI, deviceUISet, channelTx);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -82,21 +82,23 @@ bool AMModGUI::handleMessage(const Message& message)
|
||||
{
|
||||
if (AMMod::MsgReportFileSourceStreamData::match(message))
|
||||
{
|
||||
m_recordSampleRate = ((AMMod::MsgReportFileSourceStreamData&)message).getSampleRate();
|
||||
m_recordLength = ((AMMod::MsgReportFileSourceStreamData&)message).getRecordLength();
|
||||
auto& cmd = (const AMMod::MsgReportFileSourceStreamData&) message;
|
||||
m_recordSampleRate = cmd.getSampleRate();
|
||||
m_recordLength = cmd.getRecordLength();
|
||||
m_samplesCount = 0;
|
||||
updateWithStreamData();
|
||||
return true;
|
||||
}
|
||||
else if (AMMod::MsgReportFileSourceStreamTiming::match(message))
|
||||
{
|
||||
m_samplesCount = ((AMMod::MsgReportFileSourceStreamTiming&)message).getSamplesCount();
|
||||
auto& cmd = (const AMMod::MsgReportFileSourceStreamTiming&) message;
|
||||
m_samplesCount = (int) cmd.getSamplesCount();
|
||||
updateWithStreamTime();
|
||||
return true;
|
||||
}
|
||||
else if (AMMod::MsgConfigureAMMod::match(message))
|
||||
{
|
||||
const AMMod::MsgConfigureAMMod& cfg = (AMMod::MsgConfigureAMMod&) message;
|
||||
auto& cfg = (const AMMod::MsgConfigureAMMod&) message;
|
||||
m_settings = cfg.getSettings();
|
||||
blockApplySettings(true);
|
||||
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
|
||||
@ -106,14 +108,14 @@ bool AMModGUI::handleMessage(const Message& message)
|
||||
}
|
||||
else if (CWKeyer::MsgConfigureCWKeyer::match(message))
|
||||
{
|
||||
const CWKeyer::MsgConfigureCWKeyer& cfg = (CWKeyer::MsgConfigureCWKeyer&) message;
|
||||
auto& cfg = (const CWKeyer::MsgConfigureCWKeyer&) message;
|
||||
ui->cwKeyerGUI->setSettings(cfg.getSettings());
|
||||
ui->cwKeyerGUI->displaySettings();
|
||||
return true;
|
||||
}
|
||||
else if (DSPSignalNotification::match(message))
|
||||
{
|
||||
const DSPSignalNotification& notif = (const DSPSignalNotification&) message;
|
||||
auto& notif = (const DSPSignalNotification&) message;
|
||||
m_deviceCenterFrequency = notif.getCenterFrequency();
|
||||
m_basebandSampleRate = notif.getSampleRate();
|
||||
ui->deltaFrequency->setValueRange(false, 7, -m_basebandSampleRate/2, m_basebandSampleRate/2);
|
||||
@ -138,7 +140,7 @@ void AMModGUI::handleSourceMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = getInputMessageQueue()->pop()) != 0)
|
||||
while ((message = getInputMessageQueue()->pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
@ -149,7 +151,7 @@ void AMModGUI::handleSourceMessages()
|
||||
|
||||
void AMModGUI::on_deltaFrequency_changed(qint64 value)
|
||||
{
|
||||
m_channelMarker.setCenterFrequency(value);
|
||||
m_channelMarker.setCenterFrequency((int) value);
|
||||
m_settings.m_inputFrequencyOffset = value;
|
||||
updateAbsoluteCenterFrequency();
|
||||
applySettings();
|
||||
@ -158,7 +160,7 @@ void AMModGUI::on_deltaFrequency_changed(qint64 value)
|
||||
void AMModGUI::on_rfBW_valueChanged(int value)
|
||||
{
|
||||
ui->rfBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
|
||||
m_settings.m_rfBandwidth = value * 100.0;
|
||||
m_settings.m_rfBandwidth = (float) value * 100.0f;
|
||||
m_channelMarker.setBandwidth(value * 100);
|
||||
applySettings();
|
||||
}
|
||||
@ -166,21 +168,21 @@ void AMModGUI::on_rfBW_valueChanged(int value)
|
||||
void AMModGUI::on_modPercent_valueChanged(int value)
|
||||
{
|
||||
ui->modPercentText->setText(QString("%1").arg(value));
|
||||
m_settings.m_modFactor = value / 100.0;
|
||||
m_settings.m_modFactor = (float) value / 100.0f;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void AMModGUI::on_volume_valueChanged(int value)
|
||||
{
|
||||
ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
|
||||
m_settings.m_volumeFactor = value / 10.0;
|
||||
m_settings.m_volumeFactor = (float) value / 10.0f;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void AMModGUI::on_toneFrequency_valueChanged(int value)
|
||||
{
|
||||
ui->toneFrequencyText->setText(QString("%1k").arg(value / 100.0, 0, 'f', 2));
|
||||
m_settings.m_toneFrequency = value * 10.0;
|
||||
m_settings.m_toneFrequency = (float) value * 10.0f;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -244,7 +246,7 @@ void AMModGUI::on_feedbackEnable_toggled(bool checked)
|
||||
void AMModGUI::on_feedbackVolume_valueChanged(int value)
|
||||
{
|
||||
ui->feedbackVolumeText->setText(QString("%1").arg(value / 100.0, 0, 'f', 2));
|
||||
m_settings.m_feedbackVolumeFactor = value / 100.0;
|
||||
m_settings.m_feedbackVolumeFactor = (float) value / 100.0f;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
@ -265,7 +267,7 @@ void AMModGUI::on_showFileDialog_clicked(bool checked)
|
||||
{
|
||||
(void) checked;
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open raw audio file"), ".", tr("Raw audio Files (*.raw)"), 0, QFileDialog::DontUseNativeDialog);
|
||||
tr("Open raw audio file"), ".", tr("Raw audio Files (*.raw)"), nullptr, QFileDialog::DontUseNativeDialog);
|
||||
|
||||
if (fileName != "")
|
||||
{
|
||||
@ -283,7 +285,7 @@ void AMModGUI::configureFileName()
|
||||
m_amMod->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void AMModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
void AMModGUI::onWidgetRolled(const QWidget* widget, bool rollDown)
|
||||
{
|
||||
(void) widget;
|
||||
(void) rollDown;
|
||||
@ -294,7 +296,7 @@ void AMModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void AMModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
@ -367,15 +369,15 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
|
||||
|
||||
m_amMod = (AMMod*) channelTx;
|
||||
m_amMod->setMessageQueueToGUI(getInputMessageQueue());
|
||||
m_amMod->setMessageQueueToGUI(AMModGUI::getInputMessageQueue());
|
||||
|
||||
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
|
||||
CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
|
||||
connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect(const QPoint &)));
|
||||
m_audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
|
||||
connect(m_audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect(const QPoint &)));
|
||||
|
||||
CRightClickEnabler *feedbackRightClickEnabler = new CRightClickEnabler(ui->feedbackEnable);
|
||||
connect(feedbackRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioFeedbackSelect(const QPoint &)));
|
||||
m_feedbackRightClickEnabler = new CRightClickEnabler(ui->feedbackEnable);
|
||||
connect(m_feedbackRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioFeedbackSelect(const QPoint &)));
|
||||
|
||||
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
|
||||
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@ -406,7 +408,7 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl
|
||||
|
||||
ui->cwKeyerGUI->setCWKeyer(m_amMod->getCWKeyer());
|
||||
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
connect(AMModGUI::getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
m_amMod->setLevelMeter(ui->volumeMeter);
|
||||
|
||||
displaySettings();
|
||||
@ -419,6 +421,8 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl
|
||||
AMModGUI::~AMModGUI()
|
||||
{
|
||||
delete ui;
|
||||
delete m_audioMuteRightClickEnabler;
|
||||
delete m_feedbackRightClickEnabler;
|
||||
}
|
||||
|
||||
void AMModGUI::blockApplySettings(bool block)
|
||||
@ -439,9 +443,9 @@ void AMModGUI::applySettings(bool force)
|
||||
void AMModGUI::displaySettings()
|
||||
{
|
||||
m_channelMarker.blockSignals(true);
|
||||
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
|
||||
m_channelMarker.setCenterFrequency((int) m_settings.m_inputFrequencyOffset);
|
||||
m_channelMarker.setTitle(m_settings.m_title);
|
||||
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
|
||||
m_channelMarker.setBandwidth((int) m_settings.m_rfBandwidth);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
|
||||
|
||||
@ -453,17 +457,17 @@ void AMModGUI::displaySettings()
|
||||
|
||||
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
||||
|
||||
ui->rfBW->setValue(roundf(m_settings.m_rfBandwidth / 100.0));
|
||||
ui->rfBW->setValue((int) roundf(m_settings.m_rfBandwidth / 100.f));
|
||||
ui->rfBWText->setText(QString("%1 kHz").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1));
|
||||
|
||||
int modPercent = roundf(m_settings.m_modFactor * 100.0);
|
||||
auto modPercent = (int) roundf(m_settings.m_modFactor * 100.0f);
|
||||
ui->modPercent->setValue(modPercent);
|
||||
ui->modPercentText->setText(QString("%1").arg(modPercent));
|
||||
|
||||
ui->toneFrequency->setValue(roundf(m_settings.m_toneFrequency / 10.0));
|
||||
ui->toneFrequency->setValue((int) roundf(m_settings.m_toneFrequency / 10.0f));
|
||||
ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
|
||||
|
||||
ui->volume->setValue(roundf(m_settings.m_volumeFactor * 10.0));
|
||||
ui->volume->setValue((int) roundf(m_settings.m_volumeFactor * 10.0f));
|
||||
ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
|
||||
|
||||
ui->channelMute->setChecked(m_settings.m_channelMute);
|
||||
@ -480,7 +484,7 @@ void AMModGUI::displaySettings()
|
||||
ui->morseKeyer->setChecked(m_settings.m_modAFInput == AMModSettings::AMModInputAF::AMModInputCWTone);
|
||||
|
||||
ui->feedbackEnable->setChecked(m_settings.m_feedbackAudioEnable);
|
||||
ui->feedbackVolume->setValue(roundf(m_settings.m_feedbackVolumeFactor * 100.0));
|
||||
ui->feedbackVolume->setValue((int) roundf(m_settings.m_feedbackVolumeFactor * 100.0f));
|
||||
ui->feedbackVolumeText->setText(QString("%1").arg(m_settings.m_feedbackVolumeFactor, 0, 'f', 2));
|
||||
|
||||
updateIndexLabel();
|
||||
@ -605,7 +609,7 @@ void AMModGUI::updateWithStreamTime()
|
||||
}
|
||||
}
|
||||
|
||||
void AMModGUI::makeUIConnections()
|
||||
void AMModGUI::makeUIConnections() const
|
||||
{
|
||||
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &AMModGUI::on_deltaFrequency_changed);
|
||||
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &AMModGUI::on_rfBW_valueChanged);
|
||||
|
@ -33,6 +33,7 @@ class DeviceUISet;
|
||||
|
||||
class AMMod;
|
||||
class BasebandSampleSource;
|
||||
class CRightClickEnabler;
|
||||
|
||||
namespace Ui {
|
||||
class AMModGUI;
|
||||
@ -45,21 +46,21 @@ public:
|
||||
static AMModGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx);
|
||||
virtual void destroy();
|
||||
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
||||
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
||||
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
||||
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
||||
virtual QString getTitle() const { return m_settings.m_title; };
|
||||
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
||||
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
||||
virtual bool getHidden() const { return m_settings.m_hidden; }
|
||||
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
||||
virtual int getStreamIndex() const { return m_settings.m_streamIndex; }
|
||||
virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; }
|
||||
void resetToDefaults() final;
|
||||
QByteArray serialize() const final;
|
||||
bool deserialize(const QByteArray& data) final;
|
||||
MessageQueue *getInputMessageQueue() final { return &m_inputMessageQueue; }
|
||||
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
|
||||
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
|
||||
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
|
||||
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
|
||||
QString getTitle() const final { return m_settings.m_title; };
|
||||
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
|
||||
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
|
||||
bool getHidden() const final { return m_settings.m_hidden; }
|
||||
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
|
||||
int getStreamIndex() const final { return m_settings.m_streamIndex; }
|
||||
void setStreamIndex(int streamIndex) final { m_settings.m_streamIndex = streamIndex; }
|
||||
|
||||
public slots:
|
||||
void channelMarkerChangedByCursor();
|
||||
@ -75,6 +76,9 @@ private:
|
||||
int m_basebandSampleRate;
|
||||
bool m_doApplySettings;
|
||||
|
||||
CRightClickEnabler *m_audioMuteRightClickEnabler;
|
||||
CRightClickEnabler *m_feedbackRightClickEnabler;
|
||||
|
||||
AMMod* m_amMod;
|
||||
MovingAverageUtil<double, double, 20> m_channelPowerDbAvg;
|
||||
|
||||
@ -88,8 +92,8 @@ private:
|
||||
bool m_enableNavTime;
|
||||
MessageQueue m_inputMessageQueue;
|
||||
|
||||
explicit AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget* parent = 0);
|
||||
virtual ~AMModGUI();
|
||||
explicit AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget* parent = nullptr);
|
||||
~AMModGUI() final;
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void applySettings(bool force = false);
|
||||
@ -97,11 +101,11 @@ private:
|
||||
void updateWithStreamData();
|
||||
void updateWithStreamTime();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void makeUIConnections() const;
|
||||
void updateAbsoluteCenterFrequency();
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(EnterEventType*);
|
||||
void leaveEvent(QEvent*) final;
|
||||
void enterEvent(EnterEventType*) final;
|
||||
|
||||
private slots:
|
||||
void handleSourceMessages();
|
||||
@ -124,7 +128,7 @@ private slots:
|
||||
void on_feedbackEnable_toggled(bool checked);
|
||||
void on_feedbackVolume_valueChanged(int value);
|
||||
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onWidgetRolled(const QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
|
||||
void configureFileName();
|
||||
|
@ -41,7 +41,7 @@ const PluginDescriptor AMModPlugin::m_pluginDescriptor = {
|
||||
|
||||
AMModPlugin::AMModPlugin(QObject* parent) :
|
||||
QObject(parent),
|
||||
m_pluginAPI(0)
|
||||
m_pluginAPI(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ void AMModPlugin::createTxChannel(DeviceAPI *deviceAPI, BasebandSampleSource **b
|
||||
{
|
||||
if (bs || cs)
|
||||
{
|
||||
AMMod *instance = new AMMod(deviceAPI);
|
||||
auto *instance = new AMMod(deviceAPI);
|
||||
|
||||
if (bs) {
|
||||
*bs = instance;
|
||||
|
@ -27,20 +27,20 @@
|
||||
class DeviceUISet;
|
||||
class BasebandSampleSource;
|
||||
|
||||
class AMModPlugin : public QObject, PluginInterface {
|
||||
class AMModPlugin : public QObject, public PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
Q_PLUGIN_METADATA(IID "sdrangel.channeltx.ammod")
|
||||
|
||||
public:
|
||||
explicit AMModPlugin(QObject* parent = 0);
|
||||
explicit AMModPlugin(QObject* parent = nullptr);
|
||||
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
const PluginDescriptor& getPluginDescriptor() const final;
|
||||
void initPlugin(PluginAPI* pluginAPI) final;
|
||||
|
||||
virtual void createTxChannel(DeviceAPI *deviceAPI, BasebandSampleSource **bs, ChannelAPI **cs) const;
|
||||
virtual ChannelGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const;
|
||||
virtual ChannelWebAPIAdapter* createChannelWebAPIAdapter() const;
|
||||
void createTxChannel(DeviceAPI *deviceAPI, BasebandSampleSource **bs, ChannelAPI **cs) const final;
|
||||
ChannelGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) const final;
|
||||
ChannelWebAPIAdapter* createChannelWebAPIAdapter() const final;
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "dsp/datafifo.h"
|
||||
#include "dsp/cwkeyer.h"
|
||||
#include "util/messagequeue.h"
|
||||
#include "maincore.h"
|
||||
|
||||
@ -27,15 +28,8 @@
|
||||
const int AMModSource::m_levelNbSamples = 480; // every 10ms
|
||||
|
||||
AMModSource::AMModSource() :
|
||||
m_channelSampleRate(48000),
|
||||
m_channelFrequencyOffset(0),
|
||||
m_audioSampleRate(48000),
|
||||
m_audioFifo(12000),
|
||||
m_feedbackAudioFifo(48000),
|
||||
m_levelCalcCount(0),
|
||||
m_peakLevel(0.0f),
|
||||
m_levelSum(0.0f),
|
||||
m_ifstream(nullptr)
|
||||
m_feedbackAudioFifo(48000)
|
||||
{
|
||||
m_audioFifo.setLabel("AMModSource.m_audioFifo");
|
||||
m_feedbackAudioFifo.setLabel("AMModSource.m_feedbackAudioFifo");
|
||||
@ -55,9 +49,7 @@ AMModSource::AMModSource() :
|
||||
applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true);
|
||||
}
|
||||
|
||||
AMModSource::~AMModSource()
|
||||
{
|
||||
}
|
||||
AMModSource::~AMModSource() = default;
|
||||
|
||||
void AMModSource::pull(SampleVector::iterator begin, unsigned int nbSamples)
|
||||
{
|
||||
@ -109,7 +101,7 @@ void AMModSource::pullOne(Sample& sample)
|
||||
sample.m_real = (FixReal) ci.real();
|
||||
sample.m_imag = (FixReal) ci.imag();
|
||||
|
||||
m_demodBuffer[m_demodBufferFill] = ci.real() + ci.imag();
|
||||
m_demodBuffer[m_demodBufferFill] = (qint16) (ci.real() + ci.imag());
|
||||
++m_demodBufferFill;
|
||||
|
||||
if (m_demodBufferFill >= m_demodBuffer.size())
|
||||
@ -117,13 +109,11 @@ void AMModSource::pullOne(Sample& sample)
|
||||
QList<ObjectPipe*> dataPipes;
|
||||
MainCore::instance()->getDataPipes().getDataPipes(m_channel, "demod", dataPipes);
|
||||
|
||||
if (dataPipes.size() > 0)
|
||||
if (!dataPipes.empty())
|
||||
{
|
||||
QList<ObjectPipe*>::iterator it = dataPipes.begin();
|
||||
|
||||
for (; it != dataPipes.end(); ++it)
|
||||
for (auto& dataPipe : dataPipes)
|
||||
{
|
||||
DataFifo *fifo = qobject_cast<DataFifo*>((*it)->m_element);
|
||||
DataFifo *fifo = qobject_cast<DataFifo*>(dataPipe->m_element);
|
||||
|
||||
if (fifo) {
|
||||
fifo->write((quint8*) &m_demodBuffer[0], m_demodBuffer.size() * sizeof(qint16), DataFifo::DataTypeI16);
|
||||
@ -137,7 +127,7 @@ void AMModSource::pullOne(Sample& sample)
|
||||
|
||||
void AMModSource::prefetch(unsigned int nbSamples)
|
||||
{
|
||||
unsigned int nbSamplesAudio = nbSamples * ((Real) m_audioSampleRate / (Real) m_channelSampleRate);
|
||||
auto nbSamplesAudio = (nbSamples * (unsigned int) ((Real) m_audioSampleRate / (Real) m_channelSampleRate));
|
||||
pullAudio(nbSamplesAudio);
|
||||
}
|
||||
|
||||
@ -161,7 +151,7 @@ void AMModSource::pullAudio(unsigned int nbSamples)
|
||||
|
||||
void AMModSource::modulateSample()
|
||||
{
|
||||
Real t;
|
||||
Real t = 0.0f;
|
||||
|
||||
pullAF(t);
|
||||
|
||||
@ -184,17 +174,12 @@ void AMModSource::pullAF(Real& sample)
|
||||
sample = m_toneNco.next();
|
||||
break;
|
||||
case AMModSettings::AMModInputFile:
|
||||
// sox f4exb_call.wav --encoding float --endian little f4exb_call.raw
|
||||
// ffplay -f f32le -ar 48k -ac 1 f4exb_call.raw
|
||||
if (m_ifstream && m_ifstream->is_open())
|
||||
{
|
||||
if (m_ifstream->eof())
|
||||
if ((m_ifstream->eof()) && (m_settings.m_playLoop))
|
||||
{
|
||||
if (m_settings.m_playLoop)
|
||||
{
|
||||
m_ifstream->clear();
|
||||
m_ifstream->seekg(0, std::ios::beg);
|
||||
}
|
||||
m_ifstream->clear();
|
||||
m_ifstream->seekg(0, std::ios::beg);
|
||||
}
|
||||
|
||||
if (m_ifstream->eof())
|
||||
@ -218,14 +203,18 @@ void AMModSource::pullAF(Real& sample)
|
||||
case AMModSettings::AMModInputCWTone:
|
||||
Real fadeFactor;
|
||||
|
||||
if (m_cwKeyer.getSample())
|
||||
if (!m_cwKeyer) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_cwKeyer->getSample())
|
||||
{
|
||||
m_cwKeyer.getCWSmoother().getFadeSample(true, fadeFactor);
|
||||
m_cwKeyer->getCWSmoother().getFadeSample(true, fadeFactor);
|
||||
sample = m_toneNco.next() * fadeFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_cwKeyer.getCWSmoother().getFadeSample(false, fadeFactor))
|
||||
if (m_cwKeyer->getCWSmoother().getFadeSample(false, fadeFactor))
|
||||
{
|
||||
sample = m_toneNco.next() * fadeFactor;
|
||||
}
|
||||
@ -236,7 +225,6 @@ void AMModSource::pullAF(Real& sample)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AMModSettings::AMModInputNone:
|
||||
default:
|
||||
sample = 0.0f;
|
||||
break;
|
||||
@ -266,10 +254,10 @@ void AMModSource::pushFeedback(Real sample)
|
||||
}
|
||||
}
|
||||
|
||||
void AMModSource::processOneSample(Complex& ci)
|
||||
void AMModSource::processOneSample(const Complex& ci)
|
||||
{
|
||||
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].l = ci.real();
|
||||
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].r = ci.imag();
|
||||
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].l = (qint16) ci.real();
|
||||
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].r = (qint16) ci.imag();
|
||||
++m_feedbackAudioBufferFill;
|
||||
|
||||
if (m_feedbackAudioBufferFill >= m_feedbackAudioBuffer.size())
|
||||
@ -287,7 +275,7 @@ void AMModSource::processOneSample(Complex& ci)
|
||||
}
|
||||
}
|
||||
|
||||
void AMModSource::calculateLevel(Real& sample)
|
||||
void AMModSource::calculateLevel(const Real& sample)
|
||||
{
|
||||
if (m_levelCalcCount < m_levelNbSamples)
|
||||
{
|
||||
@ -319,14 +307,18 @@ void AMModSource::applyAudioSampleRate(int sampleRate)
|
||||
m_interpolatorConsumed = false;
|
||||
m_interpolatorDistance = (Real) sampleRate / (Real) m_channelSampleRate;
|
||||
m_interpolator.create(48, sampleRate, m_settings.m_rfBandwidth / 2.2, 3.0);
|
||||
m_toneNco.setFreq(m_settings.m_toneFrequency, sampleRate);
|
||||
m_cwKeyer.setSampleRate(sampleRate);
|
||||
m_cwKeyer.reset();
|
||||
m_toneNco.setFreq(m_settings.m_toneFrequency, (float) sampleRate);
|
||||
|
||||
if (m_cwKeyer)
|
||||
{
|
||||
m_cwKeyer->setSampleRate(sampleRate);
|
||||
m_cwKeyer->reset();
|
||||
}
|
||||
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (pipes.size() > 0)
|
||||
if (!pipes.empty())
|
||||
{
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
@ -352,7 +344,7 @@ void AMModSource::applyFeedbackAudioSampleRate(int sampleRate)
|
||||
|
||||
m_feedbackInterpolatorDistanceRemain = 0;
|
||||
m_feedbackInterpolatorDistance = (Real) sampleRate / (Real) m_audioSampleRate;
|
||||
Real cutoff = std::min(sampleRate, m_audioSampleRate) / 2.2f;
|
||||
Real cutoff = ((float) std::min(sampleRate, m_audioSampleRate)) / 2.2f;
|
||||
m_feedbackInterpolator.create(48, sampleRate, cutoff, 3.0);
|
||||
m_feedbackAudioSampleRate = sampleRate;
|
||||
}
|
||||
@ -365,9 +357,8 @@ void AMModSource::applySettings(const AMModSettings& settings, bool force)
|
||||
applyAudioSampleRate(m_audioSampleRate);
|
||||
}
|
||||
|
||||
if ((settings.m_toneFrequency != m_settings.m_toneFrequency) || force)
|
||||
{
|
||||
m_toneNco.setFreq(settings.m_toneFrequency, m_audioSampleRate);
|
||||
if ((settings.m_toneFrequency != m_settings.m_toneFrequency) || force) {
|
||||
m_toneNco.setFreq(settings.m_toneFrequency, (float) m_audioSampleRate);
|
||||
}
|
||||
|
||||
if ((settings.m_modAFInput != m_settings.m_modAFInput) || force)
|
||||
@ -391,7 +382,7 @@ void AMModSource::applyChannelSettings(int channelSampleRate, int channelFrequen
|
||||
if ((channelFrequencyOffset != m_channelFrequencyOffset)
|
||||
|| (channelSampleRate != m_channelSampleRate) || force)
|
||||
{
|
||||
m_carrierNco.setFreq(channelFrequencyOffset, channelSampleRate);
|
||||
m_carrierNco.setFreq((float) channelFrequencyOffset, (float) channelSampleRate);
|
||||
}
|
||||
|
||||
if ((channelSampleRate != m_channelSampleRate) || force)
|
||||
@ -408,7 +399,6 @@ void AMModSource::applyChannelSettings(int channelSampleRate, int channelFrequen
|
||||
|
||||
void AMModSource::handleAudio()
|
||||
{
|
||||
QMutexLocker mlock(&m_mutex);
|
||||
unsigned int nbRead;
|
||||
|
||||
while ((nbRead = m_audioFifo.read(reinterpret_cast<quint8*>(&m_audioReadBuffer[m_audioReadBufferFill]), 4096)) != 0)
|
||||
|
@ -31,23 +31,23 @@
|
||||
#include "dsp/ncof.h"
|
||||
#include "dsp/interpolator.h"
|
||||
#include "util/movingaverage.h"
|
||||
#include "dsp/cwkeyer.h"
|
||||
#include "audio/audiofifo.h"
|
||||
|
||||
#include "ammodsettings.h"
|
||||
|
||||
class ChannelAPI;
|
||||
class CWKeyer;
|
||||
|
||||
class AMModSource : public QObject, public ChannelSampleSource
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AMModSource();
|
||||
virtual ~AMModSource();
|
||||
~AMModSource() final;
|
||||
|
||||
virtual void pull(SampleVector::iterator begin, unsigned int nbSamples);
|
||||
virtual void pullOne(Sample& sample);
|
||||
virtual void prefetch(unsigned int nbSamples);
|
||||
void pull(SampleVector::iterator begin, unsigned int nbSamples) final;
|
||||
void pullOne(Sample& sample) final;
|
||||
void prefetch(unsigned int nbSamples) final;
|
||||
|
||||
void setInputFileStream(std::ifstream *ifstream) { m_ifstream = ifstream; }
|
||||
AudioFifo *getAudioFifo() { return &m_audioFifo; }
|
||||
@ -57,7 +57,8 @@ public:
|
||||
void applyFeedbackAudioSampleRate(int sampleRate);
|
||||
int getAudioSampleRate() const { return m_audioSampleRate; }
|
||||
int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; }
|
||||
CWKeyer& getCWKeyer() { return m_cwKeyer; }
|
||||
void setCWKeyer(CWKeyer *cwKeyer) { m_cwKeyer = cwKeyer; }
|
||||
CWKeyer* getCWKeyer() { return m_cwKeyer; }
|
||||
double getMagSq() const { return m_magsq; }
|
||||
void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
|
||||
{
|
||||
@ -69,8 +70,8 @@ public:
|
||||
void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force = false);
|
||||
|
||||
private:
|
||||
int m_channelSampleRate;
|
||||
int m_channelFrequencyOffset;
|
||||
int m_channelSampleRate = 48000;
|
||||
int m_channelFrequencyOffset = 0;
|
||||
AMModSettings m_settings;
|
||||
ChannelAPI *m_channel;
|
||||
|
||||
@ -90,7 +91,7 @@ private:
|
||||
double m_magsq;
|
||||
MovingAverageUtil<double, double, 16> m_movingAverage;
|
||||
|
||||
int m_audioSampleRate;
|
||||
int m_audioSampleRate = 48000;
|
||||
AudioVector m_audioBuffer;
|
||||
unsigned int m_audioBufferFill;
|
||||
AudioVector m_audioReadBuffer;
|
||||
@ -105,24 +106,24 @@ private:
|
||||
int m_demodBufferFill;
|
||||
bool m_demodBufferEnabled;
|
||||
|
||||
quint32 m_levelCalcCount;
|
||||
quint32 m_levelCalcCount = 0;
|
||||
qreal m_rmsLevel;
|
||||
qreal m_peakLevelOut;
|
||||
Real m_peakLevel;
|
||||
Real m_levelSum;
|
||||
Real m_peakLevel = 0.0f;
|
||||
Real m_levelSum = 0.0f;
|
||||
|
||||
std::ifstream *m_ifstream;
|
||||
CWKeyer m_cwKeyer;
|
||||
std::ifstream *m_ifstream = nullptr;
|
||||
CWKeyer *m_cwKeyer = nullptr;
|
||||
|
||||
QRecursiveMutex m_mutex;
|
||||
|
||||
static const int m_levelNbSamples;
|
||||
|
||||
void processOneSample(Complex& ci);
|
||||
void processOneSample(const Complex& ci);
|
||||
void pullAF(Real& sample);
|
||||
void pullAudio(unsigned int nbSamples);
|
||||
void pushFeedback(Real sample);
|
||||
void calculateLevel(Real& sample);
|
||||
void calculateLevel(const Real& sample);
|
||||
void modulateSample();
|
||||
|
||||
private slots:
|
||||
|
@ -309,7 +309,7 @@ public:
|
||||
void setLevelMeter(QObject *levelMeter);
|
||||
int getEffectiveSampleRate() const;
|
||||
void getCameraNumbers(std::vector<int>& numbers);
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
|
||||
static const char* const m_channelIdURI;
|
||||
static const char* const m_channelId;
|
||||
|
@ -702,7 +702,7 @@ void ATVModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ATVModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -370,7 +370,7 @@ void ChirpChatModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void ChirpChatModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -262,7 +262,7 @@ public:
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
double getMagSq() const;
|
||||
int getEffectiveSampleRate() const;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override;
|
||||
void setMessageQueueToGUI(MessageQueue* queue) final;
|
||||
|
||||
static const char* const m_channelIdURI;
|
||||
static const char* const m_channelId;
|
||||
|
@ -497,7 +497,7 @@ void DATVModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void DATVModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -306,7 +306,7 @@ void FreeDVModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void FreeDVModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
@ -402,7 +402,7 @@ void M17ModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
|
||||
void M17ModGUI::onMenuDialogCalled(const QPoint &p)
|
||||
{
|
||||
if (m_contextMenuType == ContextMenuChannelSettings)
|
||||
if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user