diff --git a/doc/img/JogdialController_plugin.png b/doc/img/JogdialController_plugin.png new file mode 100644 index 000000000..078a74ebc Binary files /dev/null and b/doc/img/JogdialController_plugin.png differ diff --git a/doc/img/JogdialController_plugin.xcf b/doc/img/JogdialController_plugin.xcf new file mode 100644 index 000000000..955d2012f Binary files /dev/null and b/doc/img/JogdialController_plugin.xcf differ diff --git a/doc/img/ShuttlePROLayout.png b/doc/img/ShuttlePROLayout.png new file mode 100644 index 000000000..c4e81e315 Binary files /dev/null and b/doc/img/ShuttlePROLayout.png differ diff --git a/doc/img/ShuttleXpressLayout.png b/doc/img/ShuttleXpressLayout.png new file mode 100644 index 000000000..51d8b50b6 Binary files /dev/null and b/doc/img/ShuttleXpressLayout.png differ diff --git a/doc/img/USKeyboardLayout.png b/doc/img/USKeyboardLayout.png new file mode 100644 index 000000000..2fd9ee481 Binary files /dev/null and b/doc/img/USKeyboardLayout.png differ diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h index dfde34d64..773d1ac6d 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h @@ -100,6 +100,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "BeamSteeringCWMod"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} uint32_t getBasebandSampleRate() const { return m_basebandSampleRate; } virtual QByteArray serialize() const; diff --git a/plugins/channelmimo/interferometer/interferometer.h b/plugins/channelmimo/interferometer/interferometer.h index c6dbf3968..5959a4de2 100644 --- a/plugins/channelmimo/interferometer/interferometer.h +++ b/plugins/channelmimo/interferometer/interferometer.h @@ -101,6 +101,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "Interferometer"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} uint32_t getDeviceSampleRate() const { return m_deviceSampleRate; } virtual QByteArray serialize() const; diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index 342c91ae2..7a09237c5 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -152,6 +152,13 @@ bool ChannelAnalyzer::handleMessage(const Message& cmd) } } +void ChannelAnalyzer::setCenterFrequency(qint64 frequency) +{ + ChannelAnalyzerSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings); +} + void ChannelAnalyzer::applySettings(const ChannelAnalyzerSettings& settings, bool force) { qDebug() << "ChannelAnalyzer::applySettings:" diff --git a/plugins/channelrx/chanalyzer/chanalyzer.h b/plugins/channelrx/chanalyzer/chanalyzer.h index 80515a6a4..251eb2857 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.h +++ b/plugins/channelrx/chanalyzer/chanalyzer.h @@ -85,6 +85,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = objectName(); } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const { return QByteArray(); } virtual bool deserialize(const QByteArray& data) { (void) data; return false; } diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index 99f81573e..8210fbc4b 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -262,6 +262,19 @@ void ADSBDemod::applySettings(const ADSBDemodSettings& settings, bool force) m_settings = settings; } +void ADSBDemod::setCenterFrequency(qint64 frequency) +{ + ADSBDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureADSBDemod *msgToGUI = MsgConfigureADSBDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + QByteArray ADSBDemod::serialize() const { return m_settings.serialize(); diff --git a/plugins/channelrx/demodadsb/adsbdemod.h b/plugins/channelrx/demodadsb/adsbdemod.h index 80bd639d5..299589f80 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.h +++ b/plugins/channelrx/demodadsb/adsbdemod.h @@ -76,6 +76,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodais/aisdemod.cpp b/plugins/channelrx/demodais/aisdemod.cpp index 2c6552d1e..896b2f583 100644 --- a/plugins/channelrx/demodais/aisdemod.cpp +++ b/plugins/channelrx/demodais/aisdemod.cpp @@ -218,6 +218,19 @@ ScopeVis *AISDemod::getScopeSink() return m_basebandSink->getScopeSink(); } +void AISDemod::setCenterFrequency(qint64 frequency) +{ + AISDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAISDemod *msgToGUI = MsgConfigureAISDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void AISDemod::applySettings(const AISDemodSettings& settings, bool force) { qDebug() << "AISDemod::applySettings:" diff --git a/plugins/channelrx/demodais/aisdemod.h b/plugins/channelrx/demodais/aisdemod.h index 660ad8731..18517b3cc 100644 --- a/plugins/channelrx/demodais/aisdemod.h +++ b/plugins/channelrx/demodais/aisdemod.h @@ -104,7 +104,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index c3a10d7da..d6566b92f 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -151,6 +151,19 @@ bool AMDemod::handleMessage(const Message& cmd) } } +void AMDemod::setCenterFrequency(qint64 frequency) +{ + AMDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAMDemod *msgToGUI = MsgConfigureAMDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void AMDemod::applySettings(const AMDemodSettings& settings, bool force) { qDebug() << "AMDemod::applySettings:" diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index 10bddb460..23efaa7eb 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -74,6 +74,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index 1e4763521..c35179dd7 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -210,6 +210,19 @@ bool APTDemod::handleMessage(const Message& cmd) } } +void APTDemod::setCenterFrequency(qint64 frequency) +{ + APTDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAPTDemod *msgToGUI = MsgConfigureAPTDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void APTDemod::applySettings(const APTDemodSettings& settings, bool force) { qDebug() << "APTDemod::applySettings:" diff --git a/plugins/channelrx/demodapt/aptdemod.h b/plugins/channelrx/demodapt/aptdemod.h index 271cd6fe9..8a7890716 100644 --- a/plugins/channelrx/demodapt/aptdemod.h +++ b/plugins/channelrx/demodapt/aptdemod.h @@ -187,7 +187,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index fe718f7b0..a78f58bf8 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -129,6 +129,19 @@ bool ATVDemod::handleMessage(const Message& cmd) } } +void ATVDemod::setCenterFrequency(qint64 frequency) +{ + ATVDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (getMessageQueueToGUI()) + { + MsgConfigureATVDemod *msg = MsgConfigureATVDemod::create(settings, false); + getMessageQueueToGUI()->push(msg); + } +} + void ATVDemod::applySettings(const ATVDemodSettings& settings, bool force) { qDebug() << "ATVDemod::applySettings:" diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index 719c1a29b..ec31bcb5b 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -74,6 +74,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = objectName(); } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const { return QByteArray(); } virtual bool deserialize(const QByteArray& data) { (void) data; return false; } diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index abafc0a9d..74379536b 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -143,6 +143,19 @@ bool BFMDemod::handleMessage(const Message& cmd) } } +void BFMDemod::setCenterFrequency(qint64 frequency) +{ + BFMDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureBFMDemod *msgToGUI = MsgConfigureBFMDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void BFMDemod::applySettings(const BFMDemodSettings& settings, bool force) { qDebug() << "BFMDemod::applySettings: MsgConfigureBFMDemod:" diff --git a/plugins/channelrx/demodbfm/bfmdemod.h b/plugins/channelrx/demodbfm/bfmdemod.h index faf3c4e3d..b9933901c 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.h +++ b/plugins/channelrx/demodbfm/bfmdemod.h @@ -82,6 +82,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp index 7b93abe54..e9c4689ba 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp @@ -294,6 +294,19 @@ bool ChirpChatDemod::handleMessage(const Message& cmd) } } +void ChirpChatDemod::setCenterFrequency(qint64 frequency) +{ + ChirpChatDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureChirpChatDemod *msgToGUI = MsgConfigureChirpChatDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + QByteArray ChirpChatDemod::serialize() const { return m_settings.serialize(); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.h b/plugins/channelrx/demodchirpchat/chirpchatdemod.h index 587ce69e9..8f305e284 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.h +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.h @@ -211,7 +211,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demoddab/dabdemod.cpp b/plugins/channelrx/demoddab/dabdemod.cpp index 44bca107d..fafa96e82 100644 --- a/plugins/channelrx/demoddab/dabdemod.cpp +++ b/plugins/channelrx/demoddab/dabdemod.cpp @@ -272,6 +272,19 @@ bool DABDemod::handleMessage(const Message& cmd) } } +void DABDemod::setCenterFrequency(qint64 frequency) +{ + DABDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureDABDemod *msgToGUI = MsgConfigureDABDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void DABDemod::applySettings(const DABDemodSettings& settings, bool force) { qDebug() << "DABDemod::applySettings:" diff --git a/plugins/channelrx/demoddab/dabdemod.h b/plugins/channelrx/demoddab/dabdemod.h index 25fd8faaf..88179b9b3 100644 --- a/plugins/channelrx/demoddab/dabdemod.h +++ b/plugins/channelrx/demoddab/dabdemod.h @@ -324,7 +324,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index 8c5f0917b..ca78fe016 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -130,6 +130,19 @@ bool DATVDemod::handleMessage(const Message& cmd) } } +void DATVDemod::setCenterFrequency(qint64 frequency) +{ + DATVDemodSettings settings = m_settings; + settings.m_centerFrequency = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureDATVDemod *msgToGUI = MsgConfigureDATVDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void DATVDemod::applySettings(const DATVDemodSettings& settings, bool force) { QString debugMsg = tr("DATVDemod::applySettings: force: %1").arg(force); diff --git a/plugins/channelrx/demoddatv/datvdemod.h b/plugins/channelrx/demoddatv/datvdemod.h index 5dd5f937a..eeebe5b19 100644 --- a/plugins/channelrx/demoddatv/datvdemod.h +++ b/plugins/channelrx/demoddatv/datvdemod.h @@ -49,6 +49,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = objectName(); } virtual qint64 getCenterFrequency() const { return m_settings.m_centerFrequency; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const { return QByteArray(); } virtual bool deserialize(const QByteArray& data) { (void) data; return false; } diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 5b97618ba..945570561 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -150,6 +150,19 @@ bool DSDDemod::handleMessage(const Message& cmd) } } +void DSDDemod::setCenterFrequency(qint64 frequency) +{ + DSDDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureDSDDemod *msgToGUI = MsgConfigureDSDDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force) { qDebug() << "DSDDemod::applySettings: " diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index 1e6aa8527..692794a36 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -75,6 +75,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index 418d5afc2..5ff507573 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -144,6 +144,18 @@ bool FreeDVDemod::handleMessage(const Message& cmd) } } +void FreeDVDemod::setCenterFrequency(qint64 frequency) +{ + FreeDVDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureFreeDVDemod *msgToGUI = MsgConfigureFreeDVDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force) { diff --git a/plugins/channelrx/demodfreedv/freedvdemod.h b/plugins/channelrx/demodfreedv/freedvdemod.h index 64763cd22..26d966e75 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.h +++ b/plugins/channelrx/demodfreedv/freedvdemod.h @@ -88,6 +88,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 96b3eaf61..a59e3620b 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -147,6 +147,19 @@ bool NFMDemod::handleMessage(const Message& cmd) } } +void NFMDemod::setCenterFrequency(qint64 frequency) +{ + NFMDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureNFMDemod *msgToGUI = MsgConfigureNFMDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force) { qDebug() << "NFMDemod::applySettings:" diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index dad9dc389..333d3bfc3 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -74,6 +74,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodpacket/packetdemod.cpp b/plugins/channelrx/demodpacket/packetdemod.cpp index abe2164b9..1c5cf3da1 100644 --- a/plugins/channelrx/demodpacket/packetdemod.cpp +++ b/plugins/channelrx/demodpacket/packetdemod.cpp @@ -219,6 +219,19 @@ bool PacketDemod::handleMessage(const Message& cmd) } } +void PacketDemod::setCenterFrequency(qint64 frequency) +{ + PacketDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigurePacketDemod *msgToGUI = MsgConfigurePacketDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void PacketDemod::applySettings(const PacketDemodSettings& settings, bool force) { qDebug() << "PacketDemod::applySettings:" diff --git a/plugins/channelrx/demodpacket/packetdemod.h b/plugins/channelrx/demodpacket/packetdemod.h index 315069e02..609c974d8 100644 --- a/plugins/channelrx/demodpacket/packetdemod.h +++ b/plugins/channelrx/demodpacket/packetdemod.h @@ -78,7 +78,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodpager/pagerdemod.cpp b/plugins/channelrx/demodpager/pagerdemod.cpp index 90d40fe87..e1ca1fc28 100644 --- a/plugins/channelrx/demodpager/pagerdemod.cpp +++ b/plugins/channelrx/demodpager/pagerdemod.cpp @@ -189,6 +189,19 @@ ScopeVis *PagerDemod::getScopeSink() return m_basebandSink->getScopeSink(); } +void PagerDemod::setCenterFrequency(qint64 frequency) +{ + PagerDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigurePagerDemod *msgToGUI = MsgConfigurePagerDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void PagerDemod::applySettings(const PagerDemodSettings& settings, bool force) { qDebug() << "PagerDemod::applySettings:" diff --git a/plugins/channelrx/demodpager/pagerdemod.h b/plugins/channelrx/demodpager/pagerdemod.h index b63609b92..03a151ba8 100644 --- a/plugins/channelrx/demodpager/pagerdemod.h +++ b/plugins/channelrx/demodpager/pagerdemod.h @@ -119,7 +119,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index c9871ff30..76c879bef 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -146,6 +146,19 @@ bool SSBDemod::handleMessage(const Message& cmd) } } +void SSBDemod::setCenterFrequency(qint64 frequency) +{ + SSBDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureSSBDemod *msgToGUI = MsgConfigureSSBDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force) { qDebug() << "SSBDemod::applySettings:" diff --git a/plugins/channelrx/demodssb/ssbdemod.h b/plugins/channelrx/demodssb/ssbdemod.h index ccca81f81..e6a7acfde 100644 --- a/plugins/channelrx/demodssb/ssbdemod.h +++ b/plugins/channelrx/demodssb/ssbdemod.h @@ -77,6 +77,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodvor/vordemod.h b/plugins/channelrx/demodvor/vordemod.h index 2d80b1603..3cad889c0 100644 --- a/plugins/channelrx/demodvor/vordemod.h +++ b/plugins/channelrx/demodvor/vordemod.h @@ -76,6 +76,7 @@ public: virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return 0; } + virtual void setCenterFrequency(qint64) {} virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodvorsc/vordemodsc.cpp b/plugins/channelrx/demodvorsc/vordemodsc.cpp index 0b5856f57..c34add462 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.cpp +++ b/plugins/channelrx/demodvorsc/vordemodsc.cpp @@ -191,6 +191,19 @@ bool VORDemodSC::handleMessage(const Message& cmd) } } +void VORDemodSC::setCenterFrequency(qint64 frequency) +{ + VORDemodSCSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureVORDemod *msgToGUI = MsgConfigureVORDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force) { qDebug() << "VORDemodSC::applySettings:" diff --git a/plugins/channelrx/demodvorsc/vordemodsc.h b/plugins/channelrx/demodvorsc/vordemodsc.h index 59cc90eac..e8e5f77f4 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.h +++ b/plugins/channelrx/demodvorsc/vordemodsc.h @@ -75,7 +75,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index 3d644b043..0e8d1734a 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -148,6 +148,19 @@ bool WFMDemod::handleMessage(const Message& cmd) } } +void WFMDemod::setCenterFrequency(qint64 frequency) +{ + WFMDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureWFMDemod *msgToGUI = MsgConfigureWFMDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force) { qDebug() << "WFMDemod::applySettings:" diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index dc6bfc748..e4018e5e8 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -73,6 +73,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/filesink/filesink.h b/plugins/channelrx/filesink/filesink.h index 8a7a30e8a..7445c46ef 100644 --- a/plugins/channelrx/filesink/filesink.h +++ b/plugins/channelrx/filesink/filesink.h @@ -94,6 +94,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "File Sink"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/freqtracker/freqtracker.cpp b/plugins/channelrx/freqtracker/freqtracker.cpp index d9b77ba75..c9a2bbcaf 100644 --- a/plugins/channelrx/freqtracker/freqtracker.cpp +++ b/plugins/channelrx/freqtracker/freqtracker.cpp @@ -163,6 +163,19 @@ bool FreqTracker::handleMessage(const Message& cmd) } } +void FreqTracker::setCenterFrequency(qint64 frequency) +{ + FreqTrackerSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureFreqTracker *msgToGUI = MsgConfigureFreqTracker::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void FreqTracker::applySettings(const FreqTrackerSettings& settings, bool force) { if (!settings.m_tracking) diff --git a/plugins/channelrx/freqtracker/freqtracker.h b/plugins/channelrx/freqtracker/freqtracker.h index fdedbe0e7..2de58021e 100644 --- a/plugins/channelrx/freqtracker/freqtracker.h +++ b/plugins/channelrx/freqtracker/freqtracker.h @@ -73,6 +73,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/localsink/localsink.h b/plugins/channelrx/localsink/localsink.h index 64280241f..5bb82a138 100644 --- a/plugins/channelrx/localsink/localsink.h +++ b/plugins/channelrx/localsink/localsink.h @@ -95,6 +95,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "Local Sink"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/noisefigure/noisefigure.cpp b/plugins/channelrx/noisefigure/noisefigure.cpp index 646fbf065..4cdc8237b 100644 --- a/plugins/channelrx/noisefigure/noisefigure.cpp +++ b/plugins/channelrx/noisefigure/noisefigure.cpp @@ -99,6 +99,19 @@ uint32_t NoiseFigure::getNumberOfDeviceStreams() const return m_deviceAPI->getNbSourceStreams(); } +void NoiseFigure::setCenterFrequency(qint64 frequency) +{ + NoiseFigureSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureNoiseFigure *msgToGUI = MsgConfigureNoiseFigure::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void NoiseFigure::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) { (void) firstOfBurst; diff --git a/plugins/channelrx/noisefigure/noisefigure.h b/plugins/channelrx/noisefigure/noisefigure.h index f4c3e9d2d..485f6181b 100644 --- a/plugins/channelrx/noisefigure/noisefigure.h +++ b/plugins/channelrx/noisefigure/noisefigure.h @@ -183,7 +183,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/radioastronomy/radioastronomy.cpp b/plugins/channelrx/radioastronomy/radioastronomy.cpp index 5d42e9386..29573eda6 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomy.cpp @@ -155,6 +155,19 @@ void RadioAstronomy::stop() m_workerThread.wait(); } +void RadioAstronomy::setCenterFrequency(qint64 frequency) +{ + RadioAstronomySettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureRadioAstronomy *msgToGUI = MsgConfigureRadioAstronomy::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool RadioAstronomy::handleMessage(const Message& cmd) { if (MsgConfigureRadioAstronomy::match(cmd)) diff --git a/plugins/channelrx/radioastronomy/radioastronomy.h b/plugins/channelrx/radioastronomy/radioastronomy.h index 305cdc390..27fa1180c 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.h +++ b/plugins/channelrx/radioastronomy/radioastronomy.h @@ -321,7 +321,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/radioclock/radioclock.cpp b/plugins/channelrx/radioclock/radioclock.cpp index c8941c9f2..2d8b3b9c8 100644 --- a/plugins/channelrx/radioclock/radioclock.cpp +++ b/plugins/channelrx/radioclock/radioclock.cpp @@ -117,6 +117,19 @@ void RadioClock::stop() m_thread.wait(); } +void RadioClock::setCenterFrequency(qint64 frequency) +{ + RadioClockSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureRadioClock *msgToGUI = MsgConfigureRadioClock::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool RadioClock::handleMessage(const Message& cmd) { if (MsgConfigureRadioClock::match(cmd)) diff --git a/plugins/channelrx/radioclock/radioclock.h b/plugins/channelrx/radioclock/radioclock.h index 667a74f72..a75b1330d 100644 --- a/plugins/channelrx/radioclock/radioclock.h +++ b/plugins/channelrx/radioclock/radioclock.h @@ -123,7 +123,8 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual const QString& getURI() const { return getName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } - virtual qint64 getCenterFrequency() const { return 0; } + virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/remotesink/remotesink.h b/plugins/channelrx/remotesink/remotesink.h index 43bf9ad9a..b0c0e0716 100644 --- a/plugins/channelrx/remotesink/remotesink.h +++ b/plugins/channelrx/remotesink/remotesink.h @@ -75,6 +75,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "Remote Sink"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.h b/plugins/channelrx/sigmffilesink/sigmffilesink.h index 2329290ad..3417b0d06 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.h +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.h @@ -94,6 +94,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "SigMF File Sink"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channelrx/udpsink/udpsink.cpp b/plugins/channelrx/udpsink/udpsink.cpp index aeec2253c..e1dd3b262 100644 --- a/plugins/channelrx/udpsink/udpsink.cpp +++ b/plugins/channelrx/udpsink/udpsink.cpp @@ -134,6 +134,19 @@ bool UDPSink::handleMessage(const Message& cmd) } } +void UDPSink::setCenterFrequency(qint64 frequency) +{ + UDPSinkSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureUDPSink *msgToGUI = MsgConfigureUDPSink::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void UDPSink::applySettings(const UDPSinkSettings& settings, bool force) { qDebug() << "UDPSink::applySettings:" diff --git a/plugins/channelrx/udpsink/udpsink.h b/plugins/channelrx/udpsink/udpsink.h index bd1f7a35f..5a72d11dc 100644 --- a/plugins/channelrx/udpsink/udpsink.h +++ b/plugins/channelrx/udpsink/udpsink.h @@ -81,6 +81,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/filesource/filesource.h b/plugins/channeltx/filesource/filesource.h index 01d3ce7f3..b1dfc25a8 100644 --- a/plugins/channeltx/filesource/filesource.h +++ b/plugins/channeltx/filesource/filesource.h @@ -177,6 +177,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return 0; } + virtual void setCenterFrequency(qint64) {} virtual int getNbSinkStreams() const { return 0; } virtual int getNbSourceStreams() const { return 1; } diff --git a/plugins/channeltx/localsource/localsource.h b/plugins/channeltx/localsource/localsource.h index ccecbff73..3667890ba 100644 --- a/plugins/channeltx/localsource/localsource.h +++ b/plugins/channeltx/localsource/localsource.h @@ -92,6 +92,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = "Local Sink"; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp index deb9ff717..bf902a4be 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp @@ -149,6 +149,19 @@ bool IEEE_802_15_4_Mod::handleMessage(const Message& cmd) } } +void IEEE_802_15_4_Mod::setCenterFrequency(qint64 frequency) +{ + IEEE_802_15_4_ModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureIEEE_802_15_4_Mod *msgToGUI = MsgConfigureIEEE_802_15_4_Mod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void IEEE_802_15_4_Mod::applySettings(const IEEE_802_15_4_ModSettings& settings, bool force) { qDebug() << "IEEE_802_15_4_Mod::applySettings:" diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h index 07f207181..adbbc70b5 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h @@ -101,6 +101,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modais/aismod.cpp b/plugins/channeltx/modais/aismod.cpp index ff011c748..d4fb60ecd 100644 --- a/plugins/channeltx/modais/aismod.cpp +++ b/plugins/channeltx/modais/aismod.cpp @@ -109,6 +109,19 @@ void AISMod::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void AISMod::setCenterFrequency(qint64 frequency) +{ + AISModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAISMod *msgToGUI = MsgConfigureAISMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool AISMod::handleMessage(const Message& cmd) { if (MsgConfigureAISMod::match(cmd)) diff --git a/plugins/channeltx/modais/aismod.h b/plugins/channeltx/modais/aismod.h index 5610d92de..47cf91c86 100644 --- a/plugins/channeltx/modais/aismod.h +++ b/plugins/channeltx/modais/aismod.h @@ -162,6 +162,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index c9f0c6634..c9b6a65bf 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -112,6 +112,19 @@ void AMMod::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void AMMod::setCenterFrequency(qint64 frequency) +{ + AMModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAMMod *msgToGUI = MsgConfigureAMMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool AMMod::handleMessage(const Message& cmd) { if (MsgConfigureAMMod::match(cmd)) diff --git a/plugins/channeltx/modam/ammod.h b/plugins/channeltx/modam/ammod.h index 785404035..8120dd995 100644 --- a/plugins/channeltx/modam/ammod.h +++ b/plugins/channeltx/modam/ammod.h @@ -184,6 +184,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index f3c414555..f34794aaf 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -211,6 +211,19 @@ bool ATVMod::handleMessage(const Message& cmd) } } +void ATVMod::setCenterFrequency(qint64 frequency) +{ + ATVModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureATVMod *msgToGUI = MsgConfigureATVMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void ATVMod::applySettings(const ATVModSettings& settings, bool force) { qDebug() << "ATVMod::applySettings:" diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index 239642d87..227400ce6 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -256,6 +256,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.cpp b/plugins/channeltx/modchirpchat/chirpchatmod.cpp index e139ebbe3..16b7496a4 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmod.cpp @@ -136,6 +136,19 @@ bool ChirpChatMod::handleMessage(const Message& cmd) } } +void ChirpChatMod::setCenterFrequency(qint64 frequency) +{ + ChirpChatModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureChirpChatMod *msgToGUI = MsgConfigureChirpChatMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void ChirpChatMod::applySettings(const ChirpChatModSettings& settings, bool force) { qDebug() << "ChirpChatMod::applySettings:" diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.h b/plugins/channeltx/modchirpchat/chirpchatmod.h index 008cca810..4b25b1346 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.h +++ b/plugins/channeltx/modchirpchat/chirpchatmod.h @@ -99,6 +99,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/moddatv/datvmod.cpp b/plugins/channeltx/moddatv/datvmod.cpp index 300257dc9..3b4324979 100644 --- a/plugins/channeltx/moddatv/datvmod.cpp +++ b/plugins/channeltx/moddatv/datvmod.cpp @@ -199,6 +199,17 @@ bool DATVMod::handleMessage(const Message& cmd) } } +void DATVMod::setCenterFrequency(qint64 frequency) +{ + DATVModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) { + m_guiMessageQueue->push(MsgConfigureDATVMod::create(settings, false)); + } +} + void DATVMod::applySettings(const DATVModSettings& settings, bool force) { qDebug() << "DATVMod::applySettings:" @@ -354,8 +365,9 @@ int DATVMod::webapiSettingsPutPatch( MsgConfigureDATVMod *msg = MsgConfigureDATVMod::create(settings, force); m_inputMessageQueue.push(msg); - if (m_guiMessageQueue) + if (m_guiMessageQueue) { m_guiMessageQueue->push(MsgConfigureDATVMod::create(settings, force)); + } if (channelSettingsKeys.contains("tsFileName")) { diff --git a/plugins/channeltx/moddatv/datvmod.h b/plugins/channeltx/moddatv/datvmod.h index 7c36b0e2c..6181775fd 100644 --- a/plugins/channeltx/moddatv/datvmod.h +++ b/plugins/channeltx/moddatv/datvmod.h @@ -212,6 +212,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modfreedv/freedvmod.cpp b/plugins/channeltx/modfreedv/freedvmod.cpp index 06a8d3043..471b449e2 100644 --- a/plugins/channeltx/modfreedv/freedvmod.cpp +++ b/plugins/channeltx/modfreedv/freedvmod.cpp @@ -111,6 +111,19 @@ void FreeDVMod::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void FreeDVMod::setCenterFrequency(qint64 frequency) +{ + FreeDVModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureFreeDVMod *msgToGUI = MsgConfigureFreeDVMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool FreeDVMod::handleMessage(const Message& cmd) { if (MsgConfigureFreeDVMod::match(cmd)) diff --git a/plugins/channeltx/modfreedv/freedvmod.h b/plugins/channeltx/modfreedv/freedvmod.h index a52428794..20c289b01 100644 --- a/plugins/channeltx/modfreedv/freedvmod.h +++ b/plugins/channeltx/modfreedv/freedvmod.h @@ -188,6 +188,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 986e00f39..649a25e62 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -108,6 +108,19 @@ void NFMMod::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void NFMMod::setCenterFrequency(qint64 frequency) +{ + NFMModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureNFMMod *msgToGUI = MsgConfigureNFMMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool NFMMod::handleMessage(const Message& cmd) { if (MsgConfigureNFMMod::match(cmd)) diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index 50b29a807..c0f90bc08 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -184,6 +184,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modpacket/packetmod.cpp b/plugins/channeltx/modpacket/packetmod.cpp index fadc6dd5e..34803a918 100644 --- a/plugins/channeltx/modpacket/packetmod.cpp +++ b/plugins/channeltx/modpacket/packetmod.cpp @@ -154,6 +154,19 @@ bool PacketMod::handleMessage(const Message& cmd) } } +void PacketMod::setCenterFrequency(qint64 frequency) +{ + PacketModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigurePacketMod *msgToGUI = MsgConfigurePacketMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + void PacketMod::applySettings(const PacketModSettings& settings, bool force) { qDebug() << "PacketMod::applySettings:" diff --git a/plugins/channeltx/modpacket/packetmod.h b/plugins/channeltx/modpacket/packetmod.h index 22f060f05..3e1747e0e 100644 --- a/plugins/channeltx/modpacket/packetmod.h +++ b/plugins/channeltx/modpacket/packetmod.h @@ -152,6 +152,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index cd73a9d91..cd18905bc 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -109,6 +109,19 @@ void SSBMod::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void SSBMod::setCenterFrequency(qint64 frequency) +{ + SSBModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureSSBMod *msgToGUI = MsgConfigureSSBMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool SSBMod::handleMessage(const Message& cmd) { if (MsgConfigureSSBMod::match(cmd)) diff --git a/plugins/channeltx/modssb/ssbmod.h b/plugins/channeltx/modssb/ssbmod.h index 92dd20e69..80492e357 100644 --- a/plugins/channeltx/modssb/ssbmod.h +++ b/plugins/channeltx/modssb/ssbmod.h @@ -186,6 +186,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index ce35f8779..6e2dc7b85 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -106,6 +106,19 @@ void WFMMod::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void WFMMod::setCenterFrequency(qint64 frequency) +{ + WFMModSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureWFMMod *msgToGUI = MsgConfigureWFMMod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool WFMMod::handleMessage(const Message& cmd) { if (MsgConfigureWFMMod::match(cmd)) diff --git a/plugins/channeltx/modwfm/wfmmod.h b/plugins/channeltx/modwfm/wfmmod.h index 0db306b1f..ee0271e56 100644 --- a/plugins/channeltx/modwfm/wfmmod.h +++ b/plugins/channeltx/modwfm/wfmmod.h @@ -184,6 +184,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/channeltx/remotesource/remotesource.h b/plugins/channeltx/remotesource/remotesource.h index e569ea923..e6df69d65 100644 --- a/plugins/channeltx/remotesource/remotesource.h +++ b/plugins/channeltx/remotesource/remotesource.h @@ -188,6 +188,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_frequencyOffset; } + virtual void setCenterFrequency(qint64) {} virtual int getNbSinkStreams() const { return 0; } virtual int getNbSourceStreams() const { return 1; } diff --git a/plugins/channeltx/udpsource/udpsource.cpp b/plugins/channeltx/udpsource/udpsource.cpp index 56f99a4aa..437dfaf19 100644 --- a/plugins/channeltx/udpsource/udpsource.cpp +++ b/plugins/channeltx/udpsource/udpsource.cpp @@ -91,6 +91,19 @@ void UDPSource::pull(SampleVector::iterator& begin, unsigned int nbSamples) m_basebandSource->pull(begin, nbSamples); } +void UDPSource::setCenterFrequency(qint64 frequency) +{ + UDPSourceSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureUDPSource *msgToGUI = MsgConfigureUDPSource::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + bool UDPSource::handleMessage(const Message& cmd) { if (MsgConfigureChannelizer::match(cmd)) diff --git a/plugins/channeltx/udpsource/udpsource.h b/plugins/channeltx/udpsource/udpsource.h index 0f61567a1..7eddec550 100644 --- a/plugins/channeltx/udpsource/udpsource.h +++ b/plugins/channeltx/udpsource/udpsource.h @@ -105,6 +105,7 @@ public: virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; } + virtual void setCenterFrequency(qint64 frequency); virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); diff --git a/plugins/feature/CMakeLists.txt b/plugins/feature/CMakeLists.txt index 75e9b4e59..9941e2681 100644 --- a/plugins/feature/CMakeLists.txt +++ b/plugins/feature/CMakeLists.txt @@ -24,6 +24,7 @@ if (NOT SERVER_MODE) if (SGP4_FOUND AND Qt5Positioning_FOUND AND Qt5Charts_FOUND AND Qt5TextToSpeech_FOUND) add_subdirectory(satellitetracker) endif() + add_subdirectory(jogdialcontroller) else() if (SGP4_FOUND AND Qt5Positioning_FOUND AND Qt5Charts_FOUND) add_subdirectory(satellitetracker) diff --git a/plugins/feature/demodanalyzer/demodanalyzer.cpp b/plugins/feature/demodanalyzer/demodanalyzer.cpp index 21ffbd8a5..2bc4bf808 100644 --- a/plugins/feature/demodanalyzer/demodanalyzer.cpp +++ b/plugins/feature/demodanalyzer/demodanalyzer.cpp @@ -213,7 +213,7 @@ bool DemodAnalyzer::deserialize(const QByteArray& data) void DemodAnalyzer::applySettings(const DemodAnalyzerSettings& settings, bool force) { qDebug() << "DemodAnalyzer::applySettings:" - << " m_channelIndex: " << settings.m_log2Decim + << " m_log2Decim: " << settings.m_log2Decim << " m_title: " << settings.m_title << " m_rgbColor: " << settings.m_rgbColor << " m_useReverseAPI: " << settings.m_useReverseAPI diff --git a/plugins/feature/jogdialcontroller/CMakeLists.txt b/plugins/feature/jogdialcontroller/CMakeLists.txt new file mode 100644 index 000000000..49e3b3ce1 --- /dev/null +++ b/plugins/feature/jogdialcontroller/CMakeLists.txt @@ -0,0 +1,54 @@ +project(jogdialcontroller) + +set(jogdialcontroller_SOURCES + jogdialcontroller.cpp + jogdialcontrollersettings.cpp + jogdialcontrollerplugin.cpp + jogdialcontrollerwebapiadapter.cpp +) + +set(jogdialcontroller_HEADERS + jogdialcontroller.h + jogdialcontrollersettings.h + jogdialcontrollerplugin.h + jogdialcontrollerwebapiadapter.h +) + +include_directories( + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client +) + +if(NOT SERVER_MODE) + set(jogdialcontroller_SOURCES + ${jogdialcontroller_SOURCES} + jogdialcontrollergui.cpp + jogdialcontrollergui.ui + ) + set(jogdialcontroller_HEADERS + ${jogdialcontroller_HEADERS} + jogdialcontrollergui.h + ) + + set(TARGET_NAME jogdialcontroller) + set(TARGET_LIB "Qt5::Widgets") + set(TARGET_LIB_GUI "sdrgui") + set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) +else() + set(TARGET_NAME jogdialcontrollersrv) + set(TARGET_LIB "") + set(TARGET_LIB_GUI "") + set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) +endif() + +add_library(${TARGET_NAME} SHARED + ${jogdialcontroller_SOURCES} +) + +target_link_libraries(${TARGET_NAME} + Qt5::Core + ${TARGET_LIB} + sdrbase + ${TARGET_LIB_GUI} +) + +install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/feature/jogdialcontroller/jogdialcontroller.cpp b/plugins/feature/jogdialcontroller/jogdialcontroller.cpp new file mode 100644 index 000000000..43199bba7 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontroller.cpp @@ -0,0 +1,648 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include "SWGFeatureSettings.h" +#include "SWGFeatureActions.h" +#include "SWGDeviceState.h" + +#include "dsp/dspcommands.h" +#include "dsp/dspengine.h" +#include "dsp/dspdevicesourceengine.h" +#include "dsp/dspdevicesinkengine.h" +#include "dsp/devicesamplesource.h" +#include "dsp/devicesamplesink.h" +#include "device/deviceset.h" +#include "channel/channelapi.h" +#include "device/deviceapi.h" +#include "commands/commandkeyreceiver.h" +#include "maincore.h" + +#include "jogdialcontroller.h" + +MESSAGE_CLASS_DEFINITION(JogdialController::MsgConfigureJogdialController, Message) +MESSAGE_CLASS_DEFINITION(JogdialController::MsgStartStop, Message) +MESSAGE_CLASS_DEFINITION(JogdialController::MsgRefreshChannels, Message) +MESSAGE_CLASS_DEFINITION(JogdialController::MsgReportChannels, Message) +MESSAGE_CLASS_DEFINITION(JogdialController::MsgReportControl, Message) +MESSAGE_CLASS_DEFINITION(JogdialController::MsgSelectChannel, Message) + +const char* const JogdialController::m_featureIdURI = "sdrangel.feature.jogdialcontroller"; +const char* const JogdialController::m_featureId = "JogdialController"; + +JogdialController::JogdialController(WebAPIAdapterInterface *webAPIAdapterInterface) : + Feature(m_featureIdURI, webAPIAdapterInterface), + m_selectedDevice(nullptr), + m_selectedChannel(nullptr), + m_selectedIndex(-1), + m_deviceElseChannelControl(true), + m_multiplier(1) +{ + qDebug("JogdialController::JogdialController: webAPIAdapterInterface: %p", webAPIAdapterInterface); + setObjectName(m_featureId); + m_state = StIdle; + m_errorMessage = "JogdialController error"; + m_networkManager = new QNetworkAccessManager(); + connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + connect(&m_repeatTimer, SIGNAL(timeout()), this, SLOT(handleRepeat())); +} + +JogdialController::~JogdialController() +{ + disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + delete m_networkManager; +} + +void JogdialController::start() +{ + qDebug("JogdialController::start"); + m_state = StRunning; +} + +void JogdialController::stop() +{ + qDebug("JogdialController::stop"); + m_state = StIdle; +} + +bool JogdialController::handleMessage(const Message& cmd) +{ + if (MsgConfigureJogdialController::match(cmd)) + { + MsgConfigureJogdialController& cfg = (MsgConfigureJogdialController&) cmd; + qDebug() << "JogdialController::handleMessage: MsgConfigureJogdialController"; + applySettings(cfg.getSettings(), cfg.getForce()); + + return true; + } + else if (MsgStartStop::match(cmd)) + { + MsgStartStop& cfg = (MsgStartStop&) cmd; + qDebug() << "JogdialController::handleMessage: MsgStartStop: start:" << cfg.getStartStop(); + + if (cfg.getStartStop()) { + start(); + } else { + stop(); + } + + return true; + } + else if (MsgRefreshChannels::match(cmd)) + { + qDebug() << "JogdialController::handleMessage: MsgRefreshChannels"; + updateChannels(); + return true; + } + else if (MsgSelectChannel::match(cmd)) + { + MsgSelectChannel& cfg = (MsgSelectChannel&) cmd; + int index = cfg.getIndex(); + + if ((index >= 0) && (index < m_availableChannels.size())) + { + DeviceAPI *selectedDevice = m_availableChannels[cfg.getIndex()].m_deviceAPI; + ChannelAPI *selectedChannel = m_availableChannels[cfg.getIndex()].m_channelAPI; + QString channelId; + selectedChannel->getIdentifier(channelId); + qDebug() << "JogdialController::handleMessage: MsgSelectChannel" + << "device:" << selectedDevice->getHardwareId() + << "channel:" << channelId; + m_selectedDevice = selectedDevice; + m_selectedChannel = selectedChannel; + m_selectedIndex = index; + } + else + { + qWarning("JogdialController::handleMessage: MsgSelectChannel: index out of range: %d", index); + } + + return true; + } + else + { + return false; + } +} + +QByteArray JogdialController::serialize() const +{ + return m_settings.serialize(); +} + +bool JogdialController::deserialize(const QByteArray& data) +{ + if (m_settings.deserialize(data)) + { + MsgConfigureJogdialController *msg = MsgConfigureJogdialController::create(m_settings, true); + m_inputMessageQueue.push(msg); + return true; + } + else + { + m_settings.resetToDefaults(); + MsgConfigureJogdialController *msg = MsgConfigureJogdialController::create(m_settings, true); + m_inputMessageQueue.push(msg); + return false; + } +} + +void JogdialController::applySettings(const JogdialControllerSettings& settings, bool force) +{ + qDebug() << "JogdialController::applySettings:" + << " m_title: " << settings.m_title + << " m_rgbColor: " << settings.m_rgbColor + << " m_useReverseAPI: " << settings.m_useReverseAPI + << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress + << " m_reverseAPIPort: " << settings.m_reverseAPIPort + << " m_reverseAPIFeatureSetIndex: " << settings.m_reverseAPIFeatureSetIndex + << " m_reverseAPIFeatureIndex: " << settings.m_reverseAPIFeatureIndex + << " force: " << force; + + QList reverseAPIKeys; + + if ((m_settings.m_title != settings.m_title) || force) { + reverseAPIKeys.append("title"); + } + if ((m_settings.m_rgbColor != settings.m_rgbColor) || force) { + reverseAPIKeys.append("rgbColor"); + } + + if (settings.m_useReverseAPI) + { + bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || + (m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) || + (m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) || + (m_settings.m_reverseAPIFeatureSetIndex != settings.m_reverseAPIFeatureSetIndex) || + (m_settings.m_reverseAPIFeatureIndex != settings.m_reverseAPIFeatureIndex); + webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); + } + + m_settings = settings; +} + +void JogdialController::updateChannels() +{ + MainCore *mainCore = MainCore::instance(); + // MessagePipes& messagePipes = mainCore->getMessagePipes(); + std::vector& deviceSets = mainCore->getDeviceSets(); + std::vector::const_iterator it = deviceSets.begin(); + m_availableChannels.clear(); + + int deviceIndex = 0; + + for (; it != deviceSets.end(); ++it, deviceIndex++) + { + DSPDeviceSourceEngine *deviceSourceEngine = (*it)->m_deviceSourceEngine; + DSPDeviceSinkEngine *deviceSinkEngine = (*it)->m_deviceSinkEngine; + DeviceAPI *device = (*it)->m_deviceAPI; + device->getHardwareId(); + + if (deviceSourceEngine || deviceSinkEngine) + { + // DeviceSampleSource *deviceSource = deviceSourceEngine->getSource(); + // quint64 deviceCenterFrequency = deviceSource->getCenterFrequency(); + // int basebandSampleRate = deviceSource->getSampleRate(); + + for (int chi = 0; chi < (*it)->getNumberOfChannels(); chi++) + { + ChannelAPI *channel = (*it)->getChannelAt(chi); + QString channelId; + channel->getIdentifier(channelId); + JogdialControllerSettings::AvailableChannel availableChannel = + JogdialControllerSettings::AvailableChannel{ + deviceSinkEngine != nullptr, + deviceIndex, + chi, + device, + channel, + device->getHardwareId(), + channelId + }; + m_availableChannels.push_back(availableChannel); + } + } + } + + if (getMessageQueueToGUI()) + { + MsgReportChannels *msgToGUI = MsgReportChannels::create(); + QList& msgAvailableChannels = msgToGUI->getAvailableChannels(); + msgAvailableChannels = m_availableChannels; + getMessageQueueToGUI()->push(msgToGUI); + } +} + +void JogdialController::channelUp() +{ + if ((m_selectedIndex < 0) || (m_availableChannels.size() == 0)) { + return; + } + + m_selectedIndex++; + + if (m_selectedIndex >= m_availableChannels.size()) { + m_selectedIndex = 0; + } + + m_selectedDevice = m_availableChannels.at(m_selectedIndex).m_deviceAPI; + m_selectedChannel = m_availableChannels.at(m_selectedIndex).m_channelAPI; + + if (getMessageQueueToGUI()) + { + MsgSelectChannel *msgToGUI = MsgSelectChannel::create(m_selectedIndex); + getMessageQueueToGUI()->push(msgToGUI); + } +} + +void JogdialController::channelDown() +{ + if ((m_selectedIndex < 0) || (m_availableChannels.size() == 0)) { + return; + } + + m_selectedIndex--; + + if (m_selectedIndex < 0) { + m_selectedIndex = m_availableChannels.size() - 1; + } + + m_selectedDevice = m_availableChannels.at(m_selectedIndex).m_deviceAPI; + m_selectedChannel = m_availableChannels.at(m_selectedIndex).m_channelAPI; + + if (getMessageQueueToGUI()) + { + MsgSelectChannel *msgToGUI = MsgSelectChannel::create(m_selectedIndex); + getMessageQueueToGUI()->push(msgToGUI); + } +} + +int JogdialController::webapiRun(bool run, + SWGSDRangel::SWGDeviceState& response, + QString& errorMessage) +{ + (void) errorMessage; + getFeatureStateStr(*response.getState()); + MsgStartStop *msg = MsgStartStop::create(run); + getInputMessageQueue()->push(msg); + return 202; +} + +int JogdialController::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setJogdialControllerSettings(new SWGSDRangel::SWGJogdialControllerSettings()); + response.getJogdialControllerSettings()->init(); + webapiFormatFeatureSettings(response, m_settings); + return 200; +} + +int JogdialController::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + JogdialControllerSettings settings = m_settings; + webapiUpdateFeatureSettings(settings, featureSettingsKeys, response); + + MsgConfigureJogdialController *msg = MsgConfigureJogdialController::create(settings, force); + m_inputMessageQueue.push(msg); + + qDebug("JogdialController::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureJogdialController *msgToGUI = MsgConfigureJogdialController::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatFeatureSettings(response, settings); + + return 200; +} + +void JogdialController::webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const JogdialControllerSettings& settings) +{ + if (response.getJogdialControllerSettings()->getTitle()) { + *response.getJogdialControllerSettings()->getTitle() = settings.m_title; + } else { + response.getJogdialControllerSettings()->setTitle(new QString(settings.m_title)); + } + + response.getJogdialControllerSettings()->setRgbColor(settings.m_rgbColor); + response.getJogdialControllerSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + + if (response.getJogdialControllerSettings()->getReverseApiAddress()) { + *response.getJogdialControllerSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; + } else { + response.getJogdialControllerSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } + + response.getJogdialControllerSettings()->setReverseApiPort(settings.m_reverseAPIPort); + response.getJogdialControllerSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex); + response.getJogdialControllerSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex); +} + +void JogdialController::webapiUpdateFeatureSettings( + JogdialControllerSettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response) +{ + if (featureSettingsKeys.contains("title")) { + settings.m_title = *response.getJogdialControllerSettings()->getTitle(); + } + if (featureSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = response.getJogdialControllerSettings()->getRgbColor(); + } + if (featureSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = response.getJogdialControllerSettings()->getUseReverseApi() != 0; + } + if (featureSettingsKeys.contains("reverseAPIAddress")) { + settings.m_reverseAPIAddress = *response.getJogdialControllerSettings()->getReverseApiAddress(); + } + if (featureSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = response.getJogdialControllerSettings()->getReverseApiPort(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureSetIndex")) { + settings.m_reverseAPIFeatureSetIndex = response.getJogdialControllerSettings()->getReverseApiFeatureSetIndex(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) { + settings.m_reverseAPIFeatureIndex = response.getJogdialControllerSettings()->getReverseApiFeatureIndex(); + } +} + +void JogdialController::webapiReverseSendSettings(QList& featureSettingsKeys, const JogdialControllerSettings& settings, bool force) +{ + SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings(); + // swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet()); + // swgFeatureSettings->setOriginatorFeatureSetIndex(getDeviceSetIndex()); + swgFeatureSettings->setFeatureType(new QString("JogdialAnalyzer")); + swgFeatureSettings->setJogdialControllerSettings(new SWGSDRangel::SWGJogdialControllerSettings()); + SWGSDRangel::SWGJogdialControllerSettings *swgJogdialControllerSettings = swgFeatureSettings->getJogdialControllerSettings(); + + // transfer data that has been modified. When force is on transfer all data except reverse API data + + if (featureSettingsKeys.contains("title") || force) { + swgJogdialControllerSettings->setTitle(new QString(settings.m_title)); + } + if (featureSettingsKeys.contains("rgbColor") || force) { + swgJogdialControllerSettings->setRgbColor(settings.m_rgbColor); + } + + QString channelSettingsURL = QString("http://%1:%2/sdrangel/featureset/%3/feature/%4/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIFeatureSetIndex) + .arg(settings.m_reverseAPIFeatureIndex); + m_networkRequest.setUrl(QUrl(channelSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgFeatureSettings->asJson().toUtf8()); + buffer->seek(0); + + // Always use PATCH to avoid passing reverse API settings + QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); + buffer->setParent(reply); + + delete swgFeatureSettings; +} + +void JogdialController::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "JogdialController::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + } + else + { + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("JogdialController::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + } + + reply->deleteLater(); +} + +void JogdialController::handleChannelMessageQueue(MessageQueue* messageQueue) +{ + Message* message; + + while ((message = messageQueue->pop()) != nullptr) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +void JogdialController::commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release) +{ + (void) release; + + if (key == Qt::Key_C) + { + m_deviceElseChannelControl = false; + + if (m_guiMessageQueue) { + m_guiMessageQueue->push(MsgReportControl::create(false)); + } + } + else if (key == Qt::Key_D) + { + m_deviceElseChannelControl = true; + + if (m_guiMessageQueue) { + m_guiMessageQueue->push(MsgReportControl::create(true)); + } + } + else if (key == Qt::Key_Left) + { + channelDown(); + } + else if (key == Qt::Key_Right) + { + channelUp(); + } + else if (key == Qt::Key_Up) + { + m_repeatTimer.stop(); + + if (keyModifiers == Qt::NoModifier) { + stepFrequency(1); + } else if (keyModifiers == Qt::ControlModifier) { + stepFrequency(10); + } else if (keyModifiers == Qt::ShiftModifier) { + stepFrequency(100); + } else if (keyModifiers == (Qt::ControlModifier | Qt::ShiftModifier)) { + stepFrequency(1000); + } + } + else if (key == Qt::Key_Down) + { + m_repeatTimer.stop(); + + if (keyModifiers == Qt::NoModifier) { + stepFrequency(-1); + } else if (keyModifiers == Qt::ControlModifier) { + stepFrequency(-10); + } else if (keyModifiers == Qt::ShiftModifier) { + stepFrequency(-100); + } else if (keyModifiers == (Qt::ControlModifier | Qt::ShiftModifier)) { + stepFrequency(-1000); + } + } + else if (key == Qt::Key_Home) + { + resetChannelFrequency(); + } + else if (key == Qt::Key_0) + { + m_repeatTimer.stop(); + } + else if (key == Qt::Key_1) + { + m_multiplier = 1; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_2) + { + m_multiplier = 10; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_3) + { + m_multiplier = 100; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_4) + { + m_multiplier = 1000; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_5) + { + m_multiplier = 10000; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_6) + { + m_multiplier = 100000; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_7) + { + m_multiplier = 1000000; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_Exclam) + { + m_multiplier = -1; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_At) + { + m_multiplier = -10; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_NumberSign) + { + m_multiplier = -100; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_Dollar) + { + m_multiplier = -1000; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_Percent) + { + m_multiplier = -10000; + m_repeatTimer.start(m_repeatms); + } + else if ((key == Qt::Key_Dead_Circumflex) || (key == Qt::Key_AsciiCircum)) + { + m_multiplier = -100000; + m_repeatTimer.start(m_repeatms); + } + else if (key == Qt::Key_Ampersand) + { + m_multiplier = -1000000; + m_repeatTimer.start(m_repeatms); + } +} + +void JogdialController::resetChannelFrequency() +{ + if (m_selectedChannel) { + m_selectedChannel->setCenterFrequency(0); + } +} + +void JogdialController::stepFrequency(int step) +{ + qDebug("JogdialController::stepFrequency: step: %d", step); + if (m_deviceElseChannelControl) + { + if (m_selectedDevice) + { + DSPDeviceSourceEngine *sourceEngine = m_selectedDevice->getDeviceSourceEngine(); + DSPDeviceSinkEngine *sinkEngine = m_selectedDevice->getDeviceSinkEngine(); + + if (sourceEngine) + { + quint64 frequency = sourceEngine->getSource()->getCenterFrequency(); + qDebug("JogdialController::stepFrequency: frequency: %llu", frequency); + sourceEngine->getSource()->setCenterFrequency(frequency + step*1000LL); + } + + if (sinkEngine) + { + quint64 frequency = sinkEngine->getSink()->getCenterFrequency(); + sinkEngine->getSink()->setCenterFrequency(frequency + step*1000LL); + } + } + } + else + { + if (m_selectedChannel) + { + qint64 frequency = m_selectedChannel->getCenterFrequency(); + m_selectedChannel->setCenterFrequency(frequency + step); + } + } +} + +void JogdialController::handleRepeat() +{ + stepFrequency(m_multiplier); +} diff --git a/plugins/feature/jogdialcontroller/jogdialcontroller.h b/plugins/feature/jogdialcontroller/jogdialcontroller.h new file mode 100644 index 000000000..00163d6d4 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontroller.h @@ -0,0 +1,223 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_JOGDIALCONTROLLER_H_ +#define INCLUDE_FEATURE_JOGDIALCONTROLLER_H_ + +#include +#include +#include + +#include "feature/feature.h" +#include "util/message.h" + +#include "jogdialcontrollersettings.h" + +class WebAPIAdapterInterface; +class QNetworkAccessManager; +class QNetworkReply; + +namespace SWGSDRangel { + class SWGDeviceState; +} + +class JogdialController : public Feature +{ + Q_OBJECT +public: + class MsgConfigureJogdialController : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const JogdialControllerSettings& getSettings() const { return m_settings; } + bool getForce() const { return m_force; } + + static MsgConfigureJogdialController* create(const JogdialControllerSettings& settings, bool force) { + return new MsgConfigureJogdialController(settings, force); + } + + private: + JogdialControllerSettings m_settings; + bool m_force; + + MsgConfigureJogdialController(const JogdialControllerSettings& settings, bool force) : + Message(), + m_settings(settings), + m_force(force) + { } + }; + + class MsgStartStop : public Message { + MESSAGE_CLASS_DECLARATION + + public: + bool getStartStop() const { return m_startStop; } + + static MsgStartStop* create(bool startStop) { + return new MsgStartStop(startStop); + } + + protected: + bool m_startStop; + + MsgStartStop(bool startStop) : + Message(), + m_startStop(startStop) + { } + }; + + class MsgRefreshChannels : public Message { + MESSAGE_CLASS_DECLARATION + + public: + static MsgRefreshChannels* create() { + return new MsgRefreshChannels(); + } + + protected: + MsgRefreshChannels() : + Message() + { } + }; + + class MsgReportChannels : public Message { + MESSAGE_CLASS_DECLARATION + + public: + QList& getAvailableChannels() { return m_availableChannels; } + + static MsgReportChannels* create() { + return new MsgReportChannels(); + } + + private: + QList m_availableChannels; + + MsgReportChannels() : + Message() + {} + }; + + class MsgSelectChannel : public Message { + MESSAGE_CLASS_DECLARATION + + public: + int getIndex() const { return m_index; } + static MsgSelectChannel* create(int index) { + return new MsgSelectChannel(index); + } + + protected: + int m_index; + + MsgSelectChannel(int index) : + Message(), + m_index(index) + { } + }; + + class MsgReportControl : public Message { + MESSAGE_CLASS_DECLARATION + + public: + bool getDeviceElseChannel() const { return m_deviceElseChannel; } + + static MsgReportControl* create(bool deviceElseChannel) { + return new MsgReportControl(deviceElseChannel); + } + + protected: + bool m_deviceElseChannel; + + MsgReportControl(bool deviceElseChannel) : + Message(), + m_deviceElseChannel(deviceElseChannel) + { } + }; + + JogdialController(WebAPIAdapterInterface *webAPIAdapterInterface); + virtual ~JogdialController(); + virtual void destroy() { delete this; } + virtual bool handleMessage(const Message& cmd); + + virtual void getIdentifier(QString& id) const { id = objectName(); } + virtual void getTitle(QString& title) const { title = m_settings.m_title; } + + virtual QByteArray serialize() const; + virtual bool deserialize(const QByteArray& data); + + virtual int webapiRun(bool run, + SWGSDRangel::SWGDeviceState& response, + QString& errorMessage); + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + void resetChannelFrequency(); + void stepFrequency(int step); + + static void webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const JogdialControllerSettings& settings); + + static void webapiUpdateFeatureSettings( + JogdialControllerSettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response); + + static const char* const m_featureIdURI; + static const char* const m_featureId; + +public slots: + void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release); + +private: + JogdialControllerSettings m_settings; + QList m_availableChannels; + DeviceAPI *m_selectedDevice; + ChannelAPI *m_selectedChannel; + int m_selectedIndex; + bool m_deviceElseChannelControl; + int m_multiplier; + QTimer m_repeatTimer; + static const int m_repeatms = 100; + + QNetworkAccessManager *m_networkManager; + QNetworkRequest m_networkRequest; + + void start(); + void stop(); + void applySettings(const JogdialControllerSettings& settings, bool force = false); + void updateChannels(); + void channelUp(); + void channelDown(); + void webapiReverseSendSettings(QList& featureSettingsKeys, const JogdialControllerSettings& settings, bool force); + +private slots: + void networkManagerFinished(QNetworkReply *reply); + void handleChannelMessageQueue(MessageQueue *messageQueues); + void handleRepeat(); +}; + +#endif // INCLUDE_FEATURE_DEMODANALYZER_H_ diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp b/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp new file mode 100644 index 000000000..2b45a6941 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp @@ -0,0 +1,362 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include "feature/featureuiset.h" +#include "gui/basicfeaturesettingsdialog.h" +#include "device/deviceset.h" +#include "util/db.h" +#include "maincore.h" + +#include "ui_jogdialcontrollergui.h" +#include "jogdialcontroller.h" +#include "jogdialcontrollergui.h" + +JogdialControllerGUI* JogdialControllerGUI::create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature) +{ + JogdialControllerGUI* gui = new JogdialControllerGUI(pluginAPI, featureUISet, feature); + return gui; +} + +void JogdialControllerGUI::destroy() +{ + delete this; +} + +void JogdialControllerGUI::resetToDefaults() +{ + m_settings.resetToDefaults(); + displaySettings(); + applySettings(true); +} + +QByteArray JogdialControllerGUI::serialize() const +{ + return m_settings.serialize(); +} + +bool JogdialControllerGUI::deserialize(const QByteArray& data) +{ + if (m_settings.deserialize(data)) + { + displaySettings(); + applySettings(true); + return true; + } + else + { + resetToDefaults(); + return false; + } +} + +bool JogdialControllerGUI::handleMessage(const Message& message) +{ + if (JogdialController::MsgConfigureJogdialController::match(message)) + { + qDebug("JogdialControllerGUI::handleMessage: JogdialController::MsgConfigureJogdialController"); + const JogdialController::MsgConfigureJogdialController& cfg = (JogdialController::MsgConfigureJogdialController&) message; + m_settings = cfg.getSettings(); + blockApplySettings(true); + displaySettings(); + blockApplySettings(false); + + return true; + } + else if (JogdialController::MsgReportChannels::match(message)) + { + qDebug("JogdialControllerGUI::handleMessage: JogdialController::MsgReportChannels"); + JogdialController::MsgReportChannels& report = (JogdialController::MsgReportChannels&) message; + m_availableChannels = report.getAvailableChannels(); + updateChannelList(); + + return true; + } + else if (JogdialController::MsgReportControl::match(message)) + { + qDebug("JogdialControllerGUI::handleMessage: JogdialController::MsgReportControl"); + JogdialController::MsgReportControl& report = (JogdialController::MsgReportControl&) message; + ui->controlLabel->setText(report.getDeviceElseChannel() ? "D" : "C"); + + return true; + } + else if (JogdialController::MsgSelectChannel::match(message)) + { + qDebug("JogdialControllerGUI::handleMessage: JogdialController::MsgSelectChannel"); + JogdialController::MsgSelectChannel& report = (JogdialController::MsgSelectChannel&) message; + int index = report.getIndex(); + + if ((index >= 0) && (index < m_availableChannels.size())) + { + ui->channels->blockSignals(true); + ui->channels->setCurrentIndex(index); + ui->channels->blockSignals(false); + } + + return true; + } + + return false; +} + +void JogdialControllerGUI::handleInputMessages() +{ + Message* message; + + while ((message = getInputMessageQueue()->pop())) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +void JogdialControllerGUI::onWidgetRolled(QWidget* widget, bool rollDown) +{ + (void) widget; + (void) rollDown; + + m_settings.m_rollupState = saveState(); + applySettings(); +} + +JogdialControllerGUI::JogdialControllerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent) : + FeatureGUI(parent), + ui(new Ui::JogdialControllerGUI), + m_pluginAPI(pluginAPI), + m_featureUISet(featureUISet), + m_doApplySettings(true), + m_lastFeatureState(0), + m_selectedChannel(nullptr) +{ + ui->setupUi(this); + m_helpURL = "plugins/feature/jogdialcontroller/readme.md"; + setAttribute(Qt::WA_DeleteOnClose, true); + setChannelWidget(false); + connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + + m_jogdialController = reinterpret_cast(feature); + m_jogdialController->setMessageQueueToGUI(&m_inputMessageQueue); + + m_featureUISet->addRollupWidget(this); + + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); + connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); + + connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); + m_statusTimer.start(1000); + + connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); + this->installEventFilter(&m_commandKeyReceiver); + + displaySettings(); + applySettings(true); +} + +JogdialControllerGUI::~JogdialControllerGUI() +{ + delete ui; +} + +void JogdialControllerGUI::blockApplySettings(bool block) +{ + m_doApplySettings = !block; +} + +void JogdialControllerGUI::displaySettings() +{ + setTitleColor(m_settings.m_rgbColor); + setWindowTitle(m_settings.m_title); + blockApplySettings(true); + restoreState(m_settings.m_rollupState); + blockApplySettings(false); +} + +void JogdialControllerGUI::updateChannelList() +{ + ui->channels->blockSignals(true); + ui->channels->clear(); + + QList::const_iterator it = m_availableChannels.begin(); + int selectedItem = -1; + + for (int i = 0; it != m_availableChannels.end(); ++it, i++) + { + ui->channels->addItem(tr("%1%2:%3 %4") + .arg(it->m_tx ? "T" : "R") + .arg(it->m_deviceSetIndex) + .arg(it->m_channelIndex) + .arg(it->m_channelId) + ); + + if (it->m_channelAPI == m_selectedChannel) { + selectedItem = i; + } + } + + int currentSelectedChannelIndex = ui->channels->currentIndex(); + ui->channels->blockSignals(false); + + if (m_availableChannels.size() > 0) + { + if (selectedItem >= 0) { + ui->channels->setCurrentIndex(selectedItem); + } else { + ui->channels->setCurrentIndex(0); + } + } + + if (currentSelectedChannelIndex == ui->channels->currentIndex()) { + on_channels_currentIndexChanged(ui->channels->currentIndex()); // force sending + } +} + +void JogdialControllerGUI::leaveEvent(QEvent*) +{ +} + +void JogdialControllerGUI::enterEvent(QEvent*) +{ +} + +void JogdialControllerGUI::onMenuDialogCalled(const QPoint &p) +{ + if (m_contextMenuType == ContextMenuChannelSettings) + { + BasicFeatureSettingsDialog dialog(this); + dialog.setTitle(m_settings.m_title); + dialog.setColor(m_settings.m_rgbColor); + dialog.setUseReverseAPI(m_settings.m_useReverseAPI); + dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); + dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); + dialog.setReverseAPIFeatureSetIndex(m_settings.m_reverseAPIFeatureSetIndex); + dialog.setReverseAPIFeatureIndex(m_settings.m_reverseAPIFeatureIndex); + + dialog.move(p); + dialog.exec(); + + m_settings.m_rgbColor = dialog.getColor().rgb(); + m_settings.m_title = dialog.getTitle(); + m_settings.m_useReverseAPI = dialog.useReverseAPI(); + m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); + m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); + m_settings.m_reverseAPIFeatureSetIndex = dialog.getReverseAPIFeatureSetIndex(); + m_settings.m_reverseAPIFeatureIndex = dialog.getReverseAPIFeatureIndex(); + + setWindowTitle(m_settings.m_title); + setTitleColor(m_settings.m_rgbColor); + + applySettings(); + } + + resetContextMenuType(); +} + +void JogdialControllerGUI::on_startStop_toggled(bool checked) +{ + if (checked) + { + setFocus(); + setFocusPolicy(Qt::StrongFocus); + connect(&m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)), + m_jogdialController, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool))); + } + else + { + disconnect(&m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)), + m_jogdialController, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool))); + setFocusPolicy(Qt::NoFocus); + clearFocus(); + } + + JogdialController::MsgStartStop *message = JogdialController::MsgStartStop::create(checked); + m_jogdialController->getInputMessageQueue()->push(message); +} + +void JogdialControllerGUI::on_devicesRefresh_clicked() +{ + JogdialController::MsgRefreshChannels *msg = JogdialController::MsgRefreshChannels::create(); + m_jogdialController->getInputMessageQueue()->push(msg); +} + +void JogdialControllerGUI::on_channels_currentIndexChanged(int index) +{ + if ((index >= 0) && (index < m_availableChannels.size())) + { + m_selectedChannel = m_availableChannels[index].m_channelAPI; + JogdialController::MsgSelectChannel *msg = JogdialController::MsgSelectChannel::create(index); + m_jogdialController->getInputMessageQueue()->push(msg); + } +} + +void JogdialControllerGUI::tick() +{ +} + +void JogdialControllerGUI::updateStatus() +{ + int state = m_jogdialController->getState(); + + if (m_lastFeatureState != state) + { + switch (state) + { + case Feature::StNotStarted: + ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); + break; + case Feature::StIdle: + ui->startStop->setStyleSheet("QToolButton { background-color : blue; }"); + break; + case Feature::StRunning: + ui->startStop->setStyleSheet("QToolButton { background-color : green; }"); + break; + case Feature::StError: + ui->startStop->setStyleSheet("QToolButton { background-color : red; }"); + QMessageBox::information(this, tr("Message"), m_jogdialController->getErrorMessage()); + break; + default: + break; + } + + m_lastFeatureState = state; + } +} + +void JogdialControllerGUI::applySettings(bool force) +{ + if (m_doApplySettings) + { + JogdialController::MsgConfigureJogdialController* message = JogdialController::MsgConfigureJogdialController::create( m_settings, force); + m_jogdialController->getInputMessageQueue()->push(message); + } +} + +void JogdialControllerGUI::focusInEvent(QFocusEvent*) +{ + qDebug("JogdialControllerGUI::focusInEvent"); + ui->focusIndicator->setStyleSheet("QLabel { background-color: rgb(85, 232, 85); border-radius: 8px; }"); // green + ui->focusIndicator->setToolTip("Active"); +} + +void JogdialControllerGUI::focusOutEvent(QFocusEvent*) +{ + qDebug("JogdialControllerGUI::focusOutEvent"); + ui->focusIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }"); // gray + ui->focusIndicator->setToolTip("Idle"); +} diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollergui.h b/plugins/feature/jogdialcontroller/jogdialcontrollergui.h new file mode 100644 index 000000000..a03e82329 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollergui.h @@ -0,0 +1,93 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_JOGDIALCONTROLLERGUI_H_ +#define INCLUDE_FEATURE_JOGDIALCONTROLLERGUI_H_ + +#include +#include + +#include "feature/featuregui.h" +#include "util/messagequeue.h" +#include "commands/commandkeyreceiver.h" +#include "jogdialcontrollersettings.h" + +class PluginAPI; +class FeatureUISet; +class JogdialController; +class Feature; + +namespace Ui { + class JogdialControllerGUI; +} + +class JogdialControllerGUI : public FeatureGUI { + Q_OBJECT +public: + static JogdialControllerGUI* create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature); + virtual void destroy(); + + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } + +protected: + void focusInEvent(QFocusEvent* e); + void focusOutEvent(QFocusEvent *e); + +private: + Ui::JogdialControllerGUI* ui; + PluginAPI* m_pluginAPI; + FeatureUISet* m_featureUISet; + JogdialControllerSettings m_settings; + bool m_doApplySettings; + + JogdialController* m_jogdialController; + MessageQueue m_inputMessageQueue; + QTimer m_statusTimer; + int m_lastFeatureState; + QList m_availableChannels; + ChannelAPI *m_selectedChannel; + CommandKeyReceiver m_commandKeyReceiver; + + explicit JogdialControllerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr); + virtual ~JogdialControllerGUI(); + + void blockApplySettings(bool block); + void applySettings(bool force = false); + void displaySettings(); + void updateChannelList(); + bool handleMessage(const Message& message); + + void leaveEvent(QEvent*); + void enterEvent(QEvent*); + +private slots: + void onMenuDialogCalled(const QPoint &p); + void onWidgetRolled(QWidget* widget, bool rollDown); + void handleInputMessages(); + void on_startStop_toggled(bool checked); + void on_devicesRefresh_clicked(); + void on_device_currentIndexChanged(int index); + void on_channels_currentIndexChanged(int index); + void updateStatus(); + void tick(); +}; + + +#endif // INCLUDE_FEATURE_JOGDIALCONTROLLERGUI_H_ diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui b/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui new file mode 100644 index 000000000..5b9a8e687 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollergui.ui @@ -0,0 +1,212 @@ + + + JogdialControllerGUI + + + + 0 + 0 + 365 + 105 + + + + + 0 + 0 + + + + + 340 + 100 + + + + + Liberation Sans + 9 + + + + Jogdial Controller + + + + + 0 + 0 + 360 + 81 + + + + + 360 + 0 + + + + Settings + + + + 3 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + start/stop plugin + + + + + + + :/play.png + :/stop.png:/play.png + + + + + + + + 0 + 0 + + + + + 16 + 16 + + + + Idle + + + QLabel { background-color: gray; border-radius: 8px; } + + + + + + + + + + + 24 + 16777215 + + + + Refresh indexes of available device sets + + + + + + + :/recycle.png:/recycle.png + + + + + + + Chan + + + + + + + + 200 + 0 + + + + Channel to control + + + + + + + Device (D) or channel (C) control + + + D + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + RollupWidget + QWidget +
gui/rollupwidget.h
+ 1 +
+ + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
+
+ + + + +
diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollerplugin.cpp b/plugins/feature/jogdialcontroller/jogdialcontrollerplugin.cpp new file mode 100644 index 000000000..e221f748f --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollerplugin.cpp @@ -0,0 +1,80 @@ +////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + + +#include +#include "plugin/pluginapi.h" + +#ifndef SERVER_MODE +#include "jogdialcontrollergui.h" +#endif +#include "jogdialcontroller.h" +#include "jogdialcontrollerplugin.h" +#include "jogdialcontrollerwebapiadapter.h" + +const PluginDescriptor JogdialControllerPlugin::m_pluginDescriptor = { + JogdialController::m_featureId, + QStringLiteral("Jogdial Controller"), + QStringLiteral("6.18.0"), + QStringLiteral("(c) Edouard Griffiths, F4EXB"), + QStringLiteral("https://github.com/f4exb/sdrangel"), + true, + QStringLiteral("https://github.com/f4exb/sdrangel") +}; + +JogdialControllerPlugin::JogdialControllerPlugin(QObject* parent) : + QObject(parent), + m_pluginAPI(nullptr) +{ +} + +const PluginDescriptor& JogdialControllerPlugin::getPluginDescriptor() const +{ + return m_pluginDescriptor; +} + +void JogdialControllerPlugin::initPlugin(PluginAPI* pluginAPI) +{ + m_pluginAPI = pluginAPI; + + // register RigCtl Server feature + m_pluginAPI->registerFeature(JogdialController::m_featureIdURI, JogdialController::m_featureId, this); +} + +#ifdef SERVER_MODE +FeatureGUI* JogdialControllerPlugin::createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const +{ + (void) featureUISet; + (void) feature; + return nullptr; +} +#else +FeatureGUI* JogdialControllerPlugin::createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const +{ + return JogdialControllerGUI::create(m_pluginAPI, featureUISet, feature); +} +#endif + +Feature* JogdialControllerPlugin::createFeature(WebAPIAdapterInterface* webAPIAdapterInterface) const +{ + return new JogdialController(webAPIAdapterInterface); +} + +FeatureWebAPIAdapter* JogdialControllerPlugin::createFeatureWebAPIAdapter() const +{ + return new JogdialControllerWebAPIAdapter(); +} diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollerplugin.h b/plugins/feature/jogdialcontroller/jogdialcontrollerplugin.h new file mode 100644 index 000000000..e85ddd052 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollerplugin.h @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_JOGDIALCONTROLLERPLUGIN_H +#define INCLUDE_FEATURE_JOGDIALCONTROLLERPLUGIN_H + +#include +#include "plugin/plugininterface.h" + +class FeatureGUI; +class WebAPIAdapterInterface; + +class JogdialControllerPlugin : public QObject, PluginInterface { + Q_OBJECT + Q_INTERFACES(PluginInterface) + Q_PLUGIN_METADATA(IID "sdrangel.feature.jogdialcontroller") + +public: + explicit JogdialControllerPlugin(QObject* parent = nullptr); + + const PluginDescriptor& getPluginDescriptor() const; + void initPlugin(PluginAPI* pluginAPI); + + virtual FeatureGUI* createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const; + virtual Feature* createFeature(WebAPIAdapterInterface *webAPIAdapterInterface) const; + virtual FeatureWebAPIAdapter* createFeatureWebAPIAdapter() const; + +private: + static const PluginDescriptor m_pluginDescriptor; + + PluginAPI* m_pluginAPI; +}; + +#endif // INCLUDE_FEATURE_JOGDIALCONTROLLERPLUGIN_H diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollersettings.cpp b/plugins/feature/jogdialcontroller/jogdialcontrollersettings.cpp new file mode 100644 index 000000000..58eade8f1 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollersettings.cpp @@ -0,0 +1,132 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include + +#include "util/simpleserializer.h" +#include "settings/serializable.h" + +#include "jogdialcontrollersettings.h" + +const QStringList JogdialControllerSettings::m_channelTypes = { + QStringLiteral("AISDemod"), + QStringLiteral("AISMod"), + QStringLiteral("AMDemod"), + QStringLiteral("AMMod"), + QStringLiteral("DABDemod"), + QStringLiteral("DSDDemod"), + QStringLiteral("NFMDemod"), + QStringLiteral("NFMMod"), + QStringLiteral("PacketDemod"), + QStringLiteral("PacketMod"), + QStringLiteral("SSBDemod"), + QStringLiteral("SSBMod"), + QStringLiteral("WFMDemod"), + QStringLiteral("WFMMod"), +}; + +const QStringList JogdialControllerSettings::m_channelURIs = { + QStringLiteral("sdrangel.channel.aisdemod"), + QStringLiteral("sdrangel.channel.modais"), + QStringLiteral("sdrangel.channel.amdemod"), + QStringLiteral("sdrangel.channeltx.modam"), + QStringLiteral("sdrangel.channel.dabdemod"), + QStringLiteral("sdrangel.channel.dsddemod"), + QStringLiteral("sdrangel.channel.nfmdemod"), + QStringLiteral("sdrangel.channeltx.modnfm"), + QStringLiteral("sdrangel.channel.packetdemod"), + QStringLiteral("sdrangel.channeltx.modpacket"), + QStringLiteral("sdrangel.channel.ssbdemod"), + QStringLiteral("sdrangel.channeltx.modssb"), + QStringLiteral("sdrangel.channel.wfmdemod"), + QStringLiteral("sdrangel.channeltx.modwfm"), +}; + +JogdialControllerSettings::JogdialControllerSettings() +{ + resetToDefaults(); +} + +void JogdialControllerSettings::resetToDefaults() +{ + m_title = "Jogdial Controller"; + m_rgbColor = QColor(3, 198, 252).rgb(); + m_useReverseAPI = false; + m_reverseAPIAddress = "127.0.0.1"; + m_reverseAPIPort = 8888; + m_reverseAPIFeatureSetIndex = 0; + m_reverseAPIFeatureIndex = 0; +} + +QByteArray JogdialControllerSettings::serialize() const +{ + SimpleSerializer s(1); + + s.writeString(5, m_title); + s.writeU32(6, m_rgbColor); + s.writeBool(7, m_useReverseAPI); + s.writeString(8, m_reverseAPIAddress); + s.writeU32(9, m_reverseAPIPort); + s.writeU32(10, m_reverseAPIFeatureSetIndex); + s.writeU32(11, m_reverseAPIFeatureIndex); + s.writeBlob(12, m_rollupState); + + return s.final(); +} + +bool JogdialControllerSettings::deserialize(const QByteArray& data) +{ + SimpleDeserializer d(data); + + if (!d.isValid()) + { + resetToDefaults(); + return false; + } + + if (d.getVersion() == 1) + { + QByteArray bytetmp; + uint32_t utmp; + QString strtmp; + + d.readString(5, &m_title, "Jogdial Controller"); + d.readU32(6, &m_rgbColor, QColor(3, 198, 252).rgb()); + d.readBool(7, &m_useReverseAPI, false); + d.readString(8, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(9, &utmp, 0); + + if ((utmp > 1023) && (utmp < 65535)) { + m_reverseAPIPort = utmp; + } else { + m_reverseAPIPort = 8888; + } + + d.readU32(10, &utmp, 0); + m_reverseAPIFeatureSetIndex = utmp > 99 ? 99 : utmp; + d.readU32(11, &utmp, 0); + m_reverseAPIFeatureIndex = utmp > 99 ? 99 : utmp; + d.readBlob(12, &m_rollupState); + + return true; + } + else + { + resetToDefaults(); + return false; + } +} diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollersettings.h b/plugins/feature/jogdialcontroller/jogdialcontrollersettings.h new file mode 100644 index 000000000..440fd0248 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollersettings.h @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_JOGDIALCONTROLLERSETTINGS_H_ +#define INCLUDE_FEATURE_JOGDIALCONTROLLERSETTINGS_H_ + +#include +#include + +#include "util/message.h" + +class Serializable; +class ChannelAPI; +class DeviceAPI; + +struct JogdialControllerSettings +{ + struct AvailableChannel + { + bool m_tx; + int m_deviceSetIndex; + int m_channelIndex; + DeviceAPI *m_deviceAPI; + ChannelAPI *m_channelAPI; + QString m_deviceId; + QString m_channelId; + + AvailableChannel() = default; + AvailableChannel(const AvailableChannel&) = default; + AvailableChannel& operator=(const AvailableChannel&) = default; + }; + + QString m_title; + quint32 m_rgbColor; + bool m_useReverseAPI; + QString m_reverseAPIAddress; + uint16_t m_reverseAPIPort; + uint16_t m_reverseAPIFeatureSetIndex; + uint16_t m_reverseAPIFeatureIndex; + QByteArray m_rollupState; + + JogdialControllerSettings(); + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + + static const QStringList m_channelTypes; + static const QStringList m_channelURIs; +}; + +#endif // INCLUDE_FEATURE_JOGDIALCONTROLLERSETTINGS_H_ diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollerwebapiadapter.cpp b/plugins/feature/jogdialcontroller/jogdialcontrollerwebapiadapter.cpp new file mode 100644 index 000000000..f38c4eed9 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollerwebapiadapter.cpp @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "SWGFeatureSettings.h" +#include "jogdialcontroller.h" +#include "jogdialcontrollerwebapiadapter.h" + +JogdialControllerWebAPIAdapter::JogdialControllerWebAPIAdapter() +{} + +JogdialControllerWebAPIAdapter::~JogdialControllerWebAPIAdapter() +{} + +int JogdialControllerWebAPIAdapter::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings()); + response.getDemodAnalyzerSettings()->init(); + JogdialController::webapiFormatFeatureSettings(response, m_settings); + + return 200; +} + +int JogdialControllerWebAPIAdapter::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) force; // no action + (void) errorMessage; + JogdialController::webapiUpdateFeatureSettings(m_settings, featureSettingsKeys, response); + + return 200; +} diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollerwebapiadapter.h b/plugins/feature/jogdialcontroller/jogdialcontrollerwebapiadapter.h new file mode 100644 index 000000000..0c3a355f2 --- /dev/null +++ b/plugins/feature/jogdialcontroller/jogdialcontrollerwebapiadapter.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_JOGDIALCONTROLLER_WEBAPIADAPTER_H +#define INCLUDE_JOGDIALCONTROLLER_WEBAPIADAPTER_H + +#include "feature/featurewebapiadapter.h" +#include "jogdialcontrollersettings.h" + +/** + * Standalone API adapter only for the settings + */ +class JogdialControllerWebAPIAdapter : public FeatureWebAPIAdapter { +public: + JogdialControllerWebAPIAdapter(); + virtual ~JogdialControllerWebAPIAdapter(); + + virtual QByteArray serialize() const { return m_settings.serialize(); } + virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); } + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + +private: + JogdialControllerSettings m_settings; +}; + +#endif // INCLUDE_DEMODANALYZER_WEBAPIADAPTER_H diff --git a/plugins/feature/jogdialcontroller/readme.md b/plugins/feature/jogdialcontroller/readme.md new file mode 100644 index 000000000..1268a4e49 --- /dev/null +++ b/plugins/feature/jogdialcontroller/readme.md @@ -0,0 +1,297 @@ +

Jogdial Controller Feature Plugin

+ +

Introduction

+ +This plugin aims at supporting frequency control via a "jog dial". A jog dial, jog wheel, shuttle dial, or shuttle wheel is a type of knob, ring, wheel, or dial which allows the user to shuttle or jog through audio or video media. + +It is designed to support the Contour ShuttleXpress and ShuttlePro products but as it is keyboard keys based any device capable of reproducing the same key sequences (including a standard keyboard - see next) can interact with this plugin. + +In the last section you will find details about the key sequences and placement of supported knobs on the ShuttleXpress and ShuttlePro. + +Note that it is based on Qt keyboard events. These events are supported only for GUI applications therefore this plugin is not built in the server variant. + +

Interface

+ +![Jogdial controller GUI](../../../doc/img/JogdialController_plugin.png) + +

1: Start/Stop

+ +Use this toggle to activate or deactivate the plugin. Note that for the control to be effective the plugin should also have the focus. You can check the focus state with the focus indicator (2) + +

2: Focus indicator

+ +This indicator turns green if the plugin has focus. To set the focus on the plugin just click anywhere on it. The controls are effective only if the plugin has focus. + +

3: Refresh channels list

+ +Use this button to refresh the list of available channels. It will scan through all the device sets presents in the instance to list their channels in the combo box next (4). + +Note that on first start the list in (4) is empty therefore you must press this button right after the plugin is started with (1) + +

4: Select channel

+ +Use this combo box to select which channel to control. The list item is formatted this way: + + - R ot T for a source (Rx) or sink (Tx) device set + - The sequence number of the device set + - The sequence number of the channel after the semicolon separator + - The type of channel + +The frequency of the device of the device set the channel belongs to can also be controlled when device control is selected. The type of control is displayed in (5) + +To select the type of control: + + - Press K5 on the Contour device or ¨D" (shift+D) on the keyboard for device control + - Press K9 on the Contour device or ¨C" (shift+C) on the keyboard for channel control + +

5: Control type indicator

+ +It displays "D" when in device control or "C" when in channel control mode. + +

Contour products and keyboard control

+ +

Contour devices

+ +The Controur devices generally have a central "jog" wheel inside a spring loaded ring called the "shuttle" wheel plus a series of buttons. + +ShuttleXpress layout + +![ShuttleXpress layout](../../../doc/img/ShuttleXpressLayout.png) + +ShuttlePRO layout + +![ShuttlePRO layout](../../../doc/img/ShuttlePROLayout.png) + +The **jog wheel** is used to go up and down in discrete frequency units. You can use the Ctl and Shift keys on the keyboard simultaneously to select the frequency step: + + - No key: ± 1 Hz for channels ± 1 kHz for devices + - Ctl key: ± 10 Hz for channels ± 10 kHz for devices + - Shift key: ± 100 Hz for channels ± 100 kHz for devices + - Ctl+Shift key: ± 1 kHz for channels ± 1 MHz for devices + + +The **shuttle wheel** has a central rest position and 7 positions on the left and 7 on the right. The left positions are used to go down in frequency and the right positions to go up. The frequency increments or decrements are sent every 100 ms as long as the shuttle position is maintained. It stops at rest (central) position. The further you go from the center the larger the frequency increment or decrement at each step. The amount is multiplied by 10 from one position to the next as you move away from the center. Thus to summarize: + + - Center: rest position stops moving + - ± 1 step: moves ± 1 unit (1 Hz for channels, 1 kHz for devices) + - ± 2 steps: moves ± 10 units + - ± 3 steps: moves ± 100 units + - ± 4 steps: moves ± 1000 units (1 kHz for channels, 1 MHz for devices) + - ± 5 steps: moves ± 10000 units + - ± 6 steps: moves ± 100000 units + - ± 7 steps: moves ± 1000000 units (1 MHz for channels, 1 GHz for devices) + +The **keys** are mapped as follows: + + - K5: Select device control + - K6: Move down through the list of available channels + - K7: Center the channel (set its frequency to 0) - useful when you loose the channel out of the baseband window + - K8: Move up through the list of available channels + - K9: Select channel control + +

Mapping to keyboard and keyboard control

+ +The contour devices proceed by mapping their events to keyboard events and this makes them very adaptable. The Jogdial Controller feature is keyboard event based so you may as well use your keyboard for control. In that case for better visual mapping it is recommended to use a US or US International keyboard. + +Contour provides software to perform the mapping on Windows. So when running on Windows please refer to Contour documentation to implement the keyboard sequence mapping that is described next. + +When running on Linux ou may use [ShuttlePRO](https://github.com/nanosyzygy/ShuttlePRO) for keyboard mapping. It will work also for the ShuttleXpress with minor changes. You will have to identify the path of the Shuttle device and run the program against it in a terminal. See the last section for details. + +

Keyboard mapping

+ +The shuttle devices controls are mapped according to the following table. K5 to K9 represent the shuttle keys. S-7 to S7 represent the shuttle (outer ring) positions S0 being the rest middle position. JL is a jog step to the left and JR a jog step to the right: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ShuttleKeyboardKey sequence (US)Action
K5DShift+DDevice control
K6Previous channel
K7HomeHomeCenter channel
K8Next channel
K9CShift+CChannel control
S-7&Shift+7Continuous -1 MHz / -1 GHz move
S-6^Shift+6Continuous -100 kHz / -100 MHz move
S-5%Shift+5Continuous -10 kHz / -10 MHz move
S-4$Shift+4Continuous -1 kHz / -1 MHz move
S-3#Shift+3Continuous -100 Hz / -100 kHz move
S-2@Shift+2Continuous -10 Hz / -10 kHz move
S-1!Shift+1Continuous -1 Hz / -1 kHz move
S000Stop continuous move
S111Continuous +1 Hz / +1 kHz move
S222Continuous +10 Hz / +10 kHz move
S333Continuous +100 Hz / +100 kHz move
S444Continuous +1 kHz / +1 MHz move
S555Continuous +10 kHz / +10 MHz move
S666Continuous +100 kHz / +100 MHz move
S777Continuous +1 MHz / +1 GHz move
JLSingle -1/-10/-100/-1000 (Hz/kHz) move
JRSingle +1/+10/+100/+1000 (Hz/kHz) move
+ +

US keyboard mapping

+ +![US keyboard layout](../../../doc/img/USKeyboardLayout.png) + +

Running the Contour devices in Linux

+ +As briefly introduced earlier you may use [ShuttlePRO](https://github.com/nanosyzygy/ShuttlePRO) for keyboard mapping. + +The program will normally work as-is for ShuttlePRO. It will also work for ShuttleXpress with a few adaptations detailed next. + +Firstly you need to add the proper udev rules that are slightly different. In fact you just need to change the "ATTR" line by: +``` +ATTRS{name}=="Contour Design ShuttleXpress" MODE="0644" +``` +Secondly the device path is different for ShuttleXPress. You have to look for your device in the path starting with `/dev/input/by-id/usb-Contour_Design_` In most cases this will be: `/dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00` + +You will then use this path as argument to the `shuttlepro` program: + +`shuttlepro /dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00` + +You may change the argument in the `shuttle` script for convenience: + +`exec shuttlepro /dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00` + +In any case you need to specify the mapping in the `~/.shuttlerc` file by adding a section for SDRangel like this: +``` +[SDRangel] + K5 "D" + K6 XK_Left + K7 XK_Home + K8 XK_Right + K9 "C" + + S-7 XK_Shift_L/D "7" + S-6 XK_Shift_L/D "6" + S-5 XK_Shift_L/D "5" + S-4 XK_Shift_L/D "4" + S-3 XK_Shift_L/D "3" + S-2 XK_Shift_L/D "2" + S-1 XK_Shift_L/D "1" + S0 "0" + S1 "1" + S2 "2" + S3 "3" + S4 "4" + S5 "5" + S6 "6" + S7 "7" + + JL XK_Down + JR XK_Up +``` + diff --git a/plugins/samplesource/remoteinput/remoteinput.cpp b/plugins/samplesource/remoteinput/remoteinput.cpp index eed96a204..117bd4de3 100644 --- a/plugins/samplesource/remoteinput/remoteinput.cpp +++ b/plugins/samplesource/remoteinput/remoteinput.cpp @@ -148,7 +148,12 @@ quint64 RemoteInput::getCenterFrequency() const void RemoteInput::setCenterFrequency(qint64 centerFrequency) { - (void) centerFrequency; + qint64 streamFrequency = m_remoteInputUDPHandler->getCenterFrequency(); + qint64 deviceFrequency = m_remoteChannelSettings.m_deviceCenterFrequency; + deviceFrequency += centerFrequency - streamFrequency; + RemoteChannelSettings remoteChannelSettings = m_remoteChannelSettings; + remoteChannelSettings.m_deviceCenterFrequency = deviceFrequency; + applyRemoteChannelSettings(remoteChannelSettings); } std::time_t RemoteInput::getStartingTimeStamp() const diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index 3189b9798..07b76100f 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -87,6 +87,7 @@ set(sdrbase_SOURCES channel/remotedatareadqueue.cpp commands/command.cpp + commands/commandkeyreceiver.cpp dsp/afsquelch.cpp dsp/agc.cpp @@ -259,6 +260,7 @@ set(sdrbase_HEADERS channel/remotedatablock.h commands/command.h + commands/commandkeyreceiver.h dsp/afsquelch.h dsp/autocorrector.h diff --git a/sdrbase/channel/channelapi.h b/sdrbase/channel/channelapi.h index e876b6505..9ee6b34ea 100644 --- a/sdrbase/channel/channelapi.h +++ b/sdrbase/channel/channelapi.h @@ -58,6 +58,7 @@ public: virtual void setName(const QString& name) { m_name = name; } virtual const QString& getName() const { return m_name; } virtual qint64 getCenterFrequency() const = 0; //!< Applies to a default stream + virtual void setCenterFrequency(qint64 frequency) = 0; virtual QByteArray serialize() const = 0; virtual bool deserialize(const QByteArray& data) = 0; diff --git a/sdrgui/gui/commandkeyreceiver.cpp b/sdrbase/commands/commandkeyreceiver.cpp similarity index 98% rename from sdrgui/gui/commandkeyreceiver.cpp rename to sdrbase/commands/commandkeyreceiver.cpp index 7871a50bf..eac6c9287 100644 --- a/sdrgui/gui/commandkeyreceiver.cpp +++ b/sdrbase/commands/commandkeyreceiver.cpp @@ -15,10 +15,11 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include #include #include +#include "commandkeyreceiver.h" + const std::vector CommandKeyReceiver::m_composeKeys = {Qt::Key_Shift, Qt::Key_Control, Qt::Key_Meta, Qt::Key_Alt, Qt::Key_AltGr}; CommandKeyReceiver::CommandKeyReceiver() : diff --git a/sdrgui/gui/commandkeyreceiver.h b/sdrbase/commands/commandkeyreceiver.h similarity index 97% rename from sdrgui/gui/commandkeyreceiver.h rename to sdrbase/commands/commandkeyreceiver.h index 696896217..09e9992f6 100644 --- a/sdrgui/gui/commandkeyreceiver.h +++ b/sdrbase/commands/commandkeyreceiver.h @@ -31,7 +31,7 @@ public: CommandKeyReceiver(); void setRelease(bool release) { m_release = release; } - void setPass(bool release) { m_release = release; } + void setPass(bool pass) { m_pass = pass; } protected: bool eventFilter(QObject* obj, QEvent* event); diff --git a/sdrbase/device/deviceapi.h b/sdrbase/device/deviceapi.h index 8259ad261..b11766a0d 100644 --- a/sdrbase/device/deviceapi.h +++ b/sdrbase/device/deviceapi.h @@ -144,6 +144,7 @@ public: DSPDeviceSourceEngine *getDeviceSourceEngine() { return m_deviceSourceEngine; } DSPDeviceSinkEngine *getDeviceSinkEngine() { return m_deviceSinkEngine; } + DSPDeviceMIMOEngine *getDeviceMIMOEngine() { return m_deviceMIMOEngine; } void addSourceBuddy(DeviceAPI* buddy); void addSinkBuddy(DeviceAPI* buddy); diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index bc939c17f..520361305 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -5269,6 +5269,9 @@ margin-bottom: 20px; "DemodAnalyzerSettings" : { "$ref" : "#/definitions/DemodAnalyzerSettings" }, + "JogdialControllerSettings" : { + "$ref" : "#/definitions/JogdialControllerSettings" + }, "GS232ControllerSettings" : { "$ref" : "#/definitions/GS232ControllerSettings" }, @@ -6689,6 +6692,33 @@ margin-bottom: 20px; } }, "description" : "Interferometer" +}; + defs.JogdialControllerSettings = { + "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API\n * 1 - yes\n * 0 - no\n" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + } + }, + "description" : "JogdialController" }; defs.KiwiSDRReport = { "properties" : { @@ -51653,7 +51683,7 @@ except ApiException as e:
- Generated 2021-12-29T17:23:49.058+01:00 + Generated 2022-01-04T21:15:15.924+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml index c466e2259..c22789b42 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml @@ -23,6 +23,8 @@ FeatureSettings: $ref: "/doc/swagger/include/APRS.yaml#/APRSSettings" DemodAnalyzerSettings: $ref: "/doc/swagger/include/DemodAnalyzer.yaml#/DemodAnalyzerSettings" + JogdialControllerSettings: + $ref: "/doc/swagger/include/JogdialController.yaml#/JogdialControllerSettings" GS232ControllerSettings: $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerSettings" MapSettings: diff --git a/sdrbase/resources/webapi/doc/swagger/include/JogdialController.yaml b/sdrbase/resources/webapi/doc/swagger/include/JogdialController.yaml new file mode 100644 index 000000000..a5be68eba --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/JogdialController.yaml @@ -0,0 +1,21 @@ +JogdialControllerSettings: + description: JogdialController + properties: + title: + type: string + rgbColor: + type: integer + useReverseAPI: + type: integer + description: > + Synchronize with reverse API + * 1 - yes + * 0 - no + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index fa800fa4a..f0c749f60 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -4795,6 +4795,11 @@ bool WebAPIRequestMapper::getFeatureSettings( featureSettings->setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings()); featureSettings->getDemodAnalyzerSettings()->fromJsonObject(settingsJsonObject); } + else if (featureSettingsKey == "JogdialControllerSettings") + { + featureSettings->setJogdialControllerSettings(new SWGSDRangel::SWGJogdialControllerSettings()); + featureSettings->getJogdialControllerSettings()->fromJsonObject(settingsJsonObject); + } else if (featureSettingsKey == "GS232ControllerSettings") { featureSettings->setGs232ControllerSettings(new SWGSDRangel::SWGGS232ControllerSettings()); diff --git a/sdrbase/webapi/webapiutils.cpp b/sdrbase/webapi/webapiutils.cpp index bca630f72..4db7cc6fc 100644 --- a/sdrbase/webapi/webapiutils.cpp +++ b/sdrbase/webapi/webapiutils.cpp @@ -268,6 +268,7 @@ const QMap WebAPIUtils::m_featureTypeToSettingsKey = { {"AntennaTools", "AntennaToolsSettings"}, {"APRS", "APRSSettings"}, {"DemodAnalyzer", "DemodAnalyzerSettings"}, + {"JogdialController", "JogdialControllerSettings"}, {"GS232Controller", "GS232ControllerSettings"}, {"Map", "MapSettings"}, {"PERTester", "PERTesterSettings"}, @@ -294,6 +295,7 @@ const QMap WebAPIUtils::m_featureURIToSettingsKey = { {"sdrangel.feature.antennatools", "AntennaToolsSettings"}, {"sdrangel.feature.aprs", "APRSSettings"}, {"sdrangel.feature.demodanalyzer", "DemodAnalyzerSettings"}, + {"sdrangel.feature.jogdialcontroller", "JogdialControllerSettings"}, {"sdrangel.feature.gs232controller", "GS232ControllerSettings"}, {"sdrangel.feature.map", "MapSettings"}, {"sdrangel.feature.pertester", "PERTesterSettings"}, diff --git a/sdrgui/CMakeLists.txt b/sdrgui/CMakeLists.txt index e2a9f60b5..b8e66ce04 100644 --- a/sdrgui/CMakeLists.txt +++ b/sdrgui/CMakeLists.txt @@ -21,7 +21,6 @@ set(sdrgui_SOURCES gui/clickablelabel.cpp gui/colormapper.cpp gui/commanditem.cpp - gui/commandkeyreceiver.cpp gui/commandoutputdialog.cpp gui/crightclickenabler.cpp gui/customtextedit.cpp @@ -109,7 +108,6 @@ set(sdrgui_HEADERS gui/channelwindow.h gui/colormapper.h gui/commanditem.h - gui/commandkeyreceiver.h gui/commandoutputdialog.h gui/crightclickenabler.h gui/customtextedit.h diff --git a/sdrgui/gui/cwkeyergui.cpp b/sdrgui/gui/cwkeyergui.cpp index ad91dfb1f..fa89aa94e 100644 --- a/sdrgui/gui/cwkeyergui.cpp +++ b/sdrgui/gui/cwkeyergui.cpp @@ -24,7 +24,7 @@ #include "dsp/cwkeyer.h" #include "util/simpleserializer.h" #include "util/messagequeue.h" -#include "commandkeyreceiver.h" +#include "commands/commandkeyreceiver.h" #include "mainwindow.h" CWKeyerGUI::CWKeyerGUI(QWidget* parent) : diff --git a/sdrgui/gui/editcommanddialog.cpp b/sdrgui/gui/editcommanddialog.cpp index f9e01a82e..14fe7eef3 100644 --- a/sdrgui/gui/editcommanddialog.cpp +++ b/sdrgui/gui/editcommanddialog.cpp @@ -18,7 +18,7 @@ #include "editcommanddialog.h" #include "ui_editcommanddialog.h" #include "commands/command.h" -#include "commandkeyreceiver.h" +#include "commands/commandkeyreceiver.h" #include #include diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 91fe3cf2f..208902fce 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -41,7 +41,7 @@ #include "feature/featureuiset.h" #include "feature/featureset.h" #include "feature/feature.h" -#include "gui/commandkeyreceiver.h" +#include "commands/commandkeyreceiver.h" #include "gui/indicator.h" #include "gui/presetitem.h" #include "gui/commanditem.h" diff --git a/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml b/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml index d3004e06b..85c36496e 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml @@ -23,6 +23,8 @@ FeatureSettings: $ref: "http://swgserver:8081/api/swagger/include/APRS.yaml#/APRSSettings" DemodAnalyzerSettings: $ref: "http://swgserver:8081/api/swagger/include/DemodAnalyzer.yaml#/DemodAnalyzerSettings" + JogdialControllerSettings: + $ref: "http://swgserver:8081/api/swagger/include/JogdialController.yaml#/JogdialControllerSettings" GS232ControllerSettings: $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerSettings" MapSettings: diff --git a/swagger/sdrangel/api/swagger/include/JogdialController.yaml b/swagger/sdrangel/api/swagger/include/JogdialController.yaml new file mode 100644 index 000000000..a5be68eba --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/JogdialController.yaml @@ -0,0 +1,21 @@ +JogdialControllerSettings: + description: JogdialController + properties: + title: + type: string + rgbColor: + type: integer + useReverseAPI: + type: integer + description: > + Synchronize with reverse API + * 1 - yes + * 0 - no + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index bc939c17f..520361305 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -5269,6 +5269,9 @@ margin-bottom: 20px; "DemodAnalyzerSettings" : { "$ref" : "#/definitions/DemodAnalyzerSettings" }, + "JogdialControllerSettings" : { + "$ref" : "#/definitions/JogdialControllerSettings" + }, "GS232ControllerSettings" : { "$ref" : "#/definitions/GS232ControllerSettings" }, @@ -6689,6 +6692,33 @@ margin-bottom: 20px; } }, "description" : "Interferometer" +}; + defs.JogdialControllerSettings = { + "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API\n * 1 - yes\n * 0 - no\n" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + } + }, + "description" : "JogdialController" }; defs.KiwiSDRReport = { "properties" : { @@ -51653,7 +51683,7 @@ except ApiException as e:
- Generated 2021-12-29T17:23:49.058+01:00 + Generated 2022-01-04T21:15:15.924+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp index fb4a8d25b..459be10e0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp @@ -44,6 +44,8 @@ SWGFeatureSettings::SWGFeatureSettings() { m_aprs_settings_isSet = false; demod_analyzer_settings = nullptr; m_demod_analyzer_settings_isSet = false; + jogdial_controller_settings = nullptr; + m_jogdial_controller_settings_isSet = false; gs232_controller_settings = nullptr; m_gs232_controller_settings_isSet = false; map_settings = nullptr; @@ -84,6 +86,8 @@ SWGFeatureSettings::init() { m_aprs_settings_isSet = false; demod_analyzer_settings = new SWGDemodAnalyzerSettings(); m_demod_analyzer_settings_isSet = false; + jogdial_controller_settings = new SWGJogdialControllerSettings(); + m_jogdial_controller_settings_isSet = false; gs232_controller_settings = new SWGGS232ControllerSettings(); m_gs232_controller_settings_isSet = false; map_settings = new SWGMapSettings(); @@ -124,6 +128,9 @@ SWGFeatureSettings::cleanup() { if(demod_analyzer_settings != nullptr) { delete demod_analyzer_settings; } + if(jogdial_controller_settings != nullptr) { + delete jogdial_controller_settings; + } if(gs232_controller_settings != nullptr) { delete gs232_controller_settings; } @@ -177,6 +184,8 @@ SWGFeatureSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&demod_analyzer_settings, pJson["DemodAnalyzerSettings"], "SWGDemodAnalyzerSettings", "SWGDemodAnalyzerSettings"); + ::SWGSDRangel::setValue(&jogdial_controller_settings, pJson["JogdialControllerSettings"], "SWGJogdialControllerSettings", "SWGJogdialControllerSettings"); + ::SWGSDRangel::setValue(&gs232_controller_settings, pJson["GS232ControllerSettings"], "SWGGS232ControllerSettings", "SWGGS232ControllerSettings"); ::SWGSDRangel::setValue(&map_settings, pJson["MapSettings"], "SWGMapSettings", "SWGMapSettings"); @@ -233,6 +242,9 @@ SWGFeatureSettings::asJsonObject() { if((demod_analyzer_settings != nullptr) && (demod_analyzer_settings->isSet())){ toJsonValue(QString("DemodAnalyzerSettings"), demod_analyzer_settings, obj, QString("SWGDemodAnalyzerSettings")); } + if((jogdial_controller_settings != nullptr) && (jogdial_controller_settings->isSet())){ + toJsonValue(QString("JogdialControllerSettings"), jogdial_controller_settings, obj, QString("SWGJogdialControllerSettings")); + } if((gs232_controller_settings != nullptr) && (gs232_controller_settings->isSet())){ toJsonValue(QString("GS232ControllerSettings"), gs232_controller_settings, obj, QString("SWGGS232ControllerSettings")); } @@ -341,6 +353,16 @@ SWGFeatureSettings::setDemodAnalyzerSettings(SWGDemodAnalyzerSettings* demod_ana this->m_demod_analyzer_settings_isSet = true; } +SWGJogdialControllerSettings* +SWGFeatureSettings::getJogdialControllerSettings() { + return jogdial_controller_settings; +} +void +SWGFeatureSettings::setJogdialControllerSettings(SWGJogdialControllerSettings* jogdial_controller_settings) { + this->jogdial_controller_settings = jogdial_controller_settings; + this->m_jogdial_controller_settings_isSet = true; +} + SWGGS232ControllerSettings* SWGFeatureSettings::getGs232ControllerSettings() { return gs232_controller_settings; @@ -450,6 +472,9 @@ SWGFeatureSettings::isSet(){ if(demod_analyzer_settings && demod_analyzer_settings->isSet()){ isObjectUpdated = true; break; } + if(jogdial_controller_settings && jogdial_controller_settings->isSet()){ + isObjectUpdated = true; break; + } if(gs232_controller_settings && gs232_controller_settings->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h index 177080513..1918aef52 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h @@ -28,6 +28,7 @@ #include "SWGAntennaToolsSettings.h" #include "SWGDemodAnalyzerSettings.h" #include "SWGGS232ControllerSettings.h" +#include "SWGJogdialControllerSettings.h" #include "SWGMapSettings.h" #include "SWGPERTesterSettings.h" #include "SWGRigCtlServerSettings.h" @@ -79,6 +80,9 @@ public: SWGDemodAnalyzerSettings* getDemodAnalyzerSettings(); void setDemodAnalyzerSettings(SWGDemodAnalyzerSettings* demod_analyzer_settings); + SWGJogdialControllerSettings* getJogdialControllerSettings(); + void setJogdialControllerSettings(SWGJogdialControllerSettings* jogdial_controller_settings); + SWGGS232ControllerSettings* getGs232ControllerSettings(); void setGs232ControllerSettings(SWGGS232ControllerSettings* gs232_controller_settings); @@ -131,6 +135,9 @@ private: SWGDemodAnalyzerSettings* demod_analyzer_settings; bool m_demod_analyzer_settings_isSet; + SWGJogdialControllerSettings* jogdial_controller_settings; + bool m_jogdial_controller_settings_isSet; + SWGGS232ControllerSettings* gs232_controller_settings; bool m_gs232_controller_settings_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGJogdialControllerSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGJogdialControllerSettings.cpp new file mode 100644 index 000000000..255abcfa7 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGJogdialControllerSettings.cpp @@ -0,0 +1,250 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGJogdialControllerSettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGJogdialControllerSettings::SWGJogdialControllerSettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGJogdialControllerSettings::SWGJogdialControllerSettings() { + title = nullptr; + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_isSet = false; + use_reverse_api = 0; + m_use_reverse_api_isSet = false; + reverse_api_address = nullptr; + m_reverse_api_address_isSet = false; + reverse_api_port = 0; + m_reverse_api_port_isSet = false; + reverse_api_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; +} + +SWGJogdialControllerSettings::~SWGJogdialControllerSettings() { + this->cleanup(); +} + +void +SWGJogdialControllerSettings::init() { + title = new QString(""); + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_isSet = false; + use_reverse_api = 0; + m_use_reverse_api_isSet = false; + reverse_api_address = new QString(""); + m_reverse_api_address_isSet = false; + reverse_api_port = 0; + m_reverse_api_port_isSet = false; + reverse_api_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; +} + +void +SWGJogdialControllerSettings::cleanup() { + if(title != nullptr) { + delete title; + } + + + if(reverse_api_address != nullptr) { + delete reverse_api_address; + } + + + +} + +SWGJogdialControllerSettings* +SWGJogdialControllerSettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGJogdialControllerSettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + + ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); + + ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString"); + + ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_feature_set_index, pJson["reverseAPIFeatureSetIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_feature_index, pJson["reverseAPIFeatureIndex"], "qint32", ""); + +} + +QString +SWGJogdialControllerSettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGJogdialControllerSettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(title != nullptr && *title != QString("")){ + toJsonValue(QString("title"), title, obj, QString("QString")); + } + if(m_rgb_color_isSet){ + obj->insert("rgbColor", QJsonValue(rgb_color)); + } + if(m_use_reverse_api_isSet){ + obj->insert("useReverseAPI", QJsonValue(use_reverse_api)); + } + if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ + toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString")); + } + if(m_reverse_api_port_isSet){ + obj->insert("reverseAPIPort", QJsonValue(reverse_api_port)); + } + if(m_reverse_api_feature_set_index_isSet){ + obj->insert("reverseAPIFeatureSetIndex", QJsonValue(reverse_api_feature_set_index)); + } + if(m_reverse_api_feature_index_isSet){ + obj->insert("reverseAPIFeatureIndex", QJsonValue(reverse_api_feature_index)); + } + + return obj; +} + +QString* +SWGJogdialControllerSettings::getTitle() { + return title; +} +void +SWGJogdialControllerSettings::setTitle(QString* title) { + this->title = title; + this->m_title_isSet = true; +} + +qint32 +SWGJogdialControllerSettings::getRgbColor() { + return rgb_color; +} +void +SWGJogdialControllerSettings::setRgbColor(qint32 rgb_color) { + this->rgb_color = rgb_color; + this->m_rgb_color_isSet = true; +} + +qint32 +SWGJogdialControllerSettings::getUseReverseApi() { + return use_reverse_api; +} +void +SWGJogdialControllerSettings::setUseReverseApi(qint32 use_reverse_api) { + this->use_reverse_api = use_reverse_api; + this->m_use_reverse_api_isSet = true; +} + +QString* +SWGJogdialControllerSettings::getReverseApiAddress() { + return reverse_api_address; +} +void +SWGJogdialControllerSettings::setReverseApiAddress(QString* reverse_api_address) { + this->reverse_api_address = reverse_api_address; + this->m_reverse_api_address_isSet = true; +} + +qint32 +SWGJogdialControllerSettings::getReverseApiPort() { + return reverse_api_port; +} +void +SWGJogdialControllerSettings::setReverseApiPort(qint32 reverse_api_port) { + this->reverse_api_port = reverse_api_port; + this->m_reverse_api_port_isSet = true; +} + +qint32 +SWGJogdialControllerSettings::getReverseApiFeatureSetIndex() { + return reverse_api_feature_set_index; +} +void +SWGJogdialControllerSettings::setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index) { + this->reverse_api_feature_set_index = reverse_api_feature_set_index; + this->m_reverse_api_feature_set_index_isSet = true; +} + +qint32 +SWGJogdialControllerSettings::getReverseApiFeatureIndex() { + return reverse_api_feature_index; +} +void +SWGJogdialControllerSettings::setReverseApiFeatureIndex(qint32 reverse_api_feature_index) { + this->reverse_api_feature_index = reverse_api_feature_index; + this->m_reverse_api_feature_index_isSet = true; +} + + +bool +SWGJogdialControllerSettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(title && *title != QString("")){ + isObjectUpdated = true; break; + } + if(m_rgb_color_isSet){ + isObjectUpdated = true; break; + } + if(m_use_reverse_api_isSet){ + isObjectUpdated = true; break; + } + if(reverse_api_address && *reverse_api_address != QString("")){ + isObjectUpdated = true; break; + } + if(m_reverse_api_port_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_set_index_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_index_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGJogdialControllerSettings.h b/swagger/sdrangel/code/qt5/client/SWGJogdialControllerSettings.h new file mode 100644 index 000000000..03200e4d0 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGJogdialControllerSettings.h @@ -0,0 +1,95 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGJogdialControllerSettings.h + * + * JogdialController + */ + +#ifndef SWGJogdialControllerSettings_H_ +#define SWGJogdialControllerSettings_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGJogdialControllerSettings: public SWGObject { +public: + SWGJogdialControllerSettings(); + SWGJogdialControllerSettings(QString* json); + virtual ~SWGJogdialControllerSettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGJogdialControllerSettings* fromJson(QString &jsonString) override; + + QString* getTitle(); + void setTitle(QString* title); + + qint32 getRgbColor(); + void setRgbColor(qint32 rgb_color); + + qint32 getUseReverseApi(); + void setUseReverseApi(qint32 use_reverse_api); + + QString* getReverseApiAddress(); + void setReverseApiAddress(QString* reverse_api_address); + + qint32 getReverseApiPort(); + void setReverseApiPort(qint32 reverse_api_port); + + qint32 getReverseApiFeatureSetIndex(); + void setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index); + + qint32 getReverseApiFeatureIndex(); + void setReverseApiFeatureIndex(qint32 reverse_api_feature_index); + + + virtual bool isSet() override; + +private: + QString* title; + bool m_title_isSet; + + qint32 rgb_color; + bool m_rgb_color_isSet; + + qint32 use_reverse_api; + bool m_use_reverse_api_isSet; + + QString* reverse_api_address; + bool m_reverse_api_address_isSet; + + qint32 reverse_api_port; + bool m_reverse_api_port_isSet; + + qint32 reverse_api_feature_set_index; + bool m_reverse_api_feature_set_index_isSet; + + qint32 reverse_api_feature_index; + bool m_reverse_api_feature_index_isSet; + +}; + +} + +#endif /* SWGJogdialControllerSettings_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 55f71bde5..10fca4e2e 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -149,6 +149,7 @@ #include "SWGInstanceFeaturesResponse.h" #include "SWGInstanceSummaryResponse.h" #include "SWGInterferometerSettings.h" +#include "SWGJogdialControllerSettings.h" #include "SWGKiwiSDRReport.h" #include "SWGKiwiSDRSettings.h" #include "SWGLimeRFEDevice.h" @@ -984,6 +985,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGJogdialControllerSettings").compare(type) == 0) { + SWGJogdialControllerSettings *obj = new SWGJogdialControllerSettings(); + obj->init(); + return obj; + } if(QString("SWGKiwiSDRReport").compare(type) == 0) { SWGKiwiSDRReport *obj = new SWGKiwiSDRReport(); obj->init();