From 8fb31a147b4cc86ac76b573945ed06dd4bed8b68 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 14 Nov 2021 22:26:02 +0100 Subject: [PATCH] Packet modulator: API changes --- .../demodpacket/packetdemodsettings.h | 1 - plugins/channeltx/modpacket/packetmod.cpp | 60 ++++++++------ plugins/channeltx/modpacket/packetmod.h | 36 +++++---- .../channeltx/modpacket/packetmodbaseband.cpp | 6 +- plugins/channeltx/modpacket/packetmodgui.cpp | 16 ++-- .../channeltx/modpacket/packetmodsettings.cpp | 45 ++++++++++- sdrbase/resources/webapi/doc/html2/index.html | 36 ++++----- .../webapi/doc/swagger/include/PacketMod.yaml | 31 ++++---- .../api/swagger/include/PacketMod.yaml | 28 +++---- swagger/sdrangel/code/html2/index.html | 36 ++++----- .../code/qt5/client/SWGModelFactory.h | 6 -- .../code/qt5/client/SWGPacketModActions.cpp | 20 +++-- .../code/qt5/client/SWGPacketModActions.h | 7 +- .../code/qt5/client/SWGPacketModSettings.cpp | 78 +++++++++++++++---- .../code/qt5/client/SWGPacketModSettings.h | 20 ++++- 15 files changed, 254 insertions(+), 172 deletions(-) diff --git a/plugins/channelrx/demodpacket/packetdemodsettings.h b/plugins/channelrx/demodpacket/packetdemodsettings.h index 6a06288f5..df37115c0 100644 --- a/plugins/channelrx/demodpacket/packetdemodsettings.h +++ b/plugins/channelrx/demodpacket/packetdemodsettings.h @@ -60,7 +60,6 @@ struct PacketDemodSettings int m_columnIndexes[PACKETDEMOD_COLUMNS];//!< How the columns are ordered in the table int m_columnSizes[PACKETDEMOD_COLUMNS]; //!< Size of the columns in the table - static const int PACKETDEMOD_CHANNEL_BANDWIDTH = 9600; static const int PACKETDEMOD_CHANNEL_SAMPLE_RATE = 38400; // Must be integer multiple of baud rate (x32, x4) PacketDemodSettings(); diff --git a/plugins/channeltx/modpacket/packetmod.cpp b/plugins/channeltx/modpacket/packetmod.cpp index 94dd6e3c4..723807fae 100644 --- a/plugins/channeltx/modpacket/packetmod.cpp +++ b/plugins/channeltx/modpacket/packetmod.cpp @@ -49,7 +49,8 @@ #include "packetmod.h" MESSAGE_CLASS_DEFINITION(PacketMod::MsgConfigurePacketMod, Message) -MESSAGE_CLASS_DEFINITION(PacketMod::MsgTXPacketMod, Message) +MESSAGE_CLASS_DEFINITION(PacketMod::MsgTx, Message) +MESSAGE_CLASS_DEFINITION(PacketMod::MsgReportTx, Message) MESSAGE_CLASS_DEFINITION(PacketMod::MsgTXPacketBytes, Message) const char* const PacketMod::m_channelIdURI = "sdrangel.channeltx.modpacket"; @@ -122,12 +123,10 @@ bool PacketMod::handleMessage(const Message& cmd) return true; } - else if (MsgTXPacketMod::match(cmd)) + if (MsgTx::match(cmd)) { - // Forward a copy to baseband - MsgTXPacketMod* rep = new MsgTXPacketMod((MsgTXPacketMod&)cmd); - qDebug() << "PacketMod::handleMessage: MsgTXPacketMod"; - m_basebandSource->getInputMessageQueue()->push(rep); + MsgTx *msg = new MsgTx((const MsgTx&) cmd); + m_basebandSource->getInputMessageQueue()->push(msg); return true; } @@ -158,6 +157,8 @@ void PacketMod::applySettings(const PacketModSettings& settings, bool force) { qDebug() << "PacketMod::applySettings:" << " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset + << " m_modulation: " << settings.m_modulation + << " m_baud: " << settings.m_baud << " m_rfBandwidth: " << settings.m_rfBandwidth << " m_fmDeviation: " << settings.m_fmDeviation << " m_gain: " << settings.m_gain @@ -186,6 +187,14 @@ void PacketMod::applySettings(const PacketModSettings& settings, bool force) reverseAPIKeys.append("inputFrequencyOffset"); } + if ((settings.m_modulation != m_settings.m_modulation) || force) { + reverseAPIKeys.append("modulation"); + } + + if ((settings.m_baud != m_settings.m_baud) || force) { + reverseAPIKeys.append("baud"); + } + if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force) { reverseAPIKeys.append("rfBandwidth"); } @@ -476,8 +485,11 @@ void PacketMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("inputFrequencyOffset")) { settings.m_inputFrequencyOffset = response.getPacketModSettings()->getInputFrequencyOffset(); } - if (channelSettingsKeys.contains("mode")) { - settings.setMode(*response.getPacketModSettings()->getMode()); + if (channelSettingsKeys.contains("modulation")) { + settings.m_modulation = (PacketModSettings::Modulation) response.getPacketModSettings()->getModulation(); + } + if (channelSettingsKeys.contains("baud")) { + settings.m_baud = response.getPacketModSettings()->getBaud(); } if (channelSettingsKeys.contains("rfBandwidth")) { settings.m_rfBandwidth = response.getPacketModSettings()->getRfBandwidth(); @@ -647,25 +659,22 @@ int PacketMod::webapiActionsPost( { if (channelActionsKeys.contains("tx")) { - SWGSDRangel::SWGPacketModActions_tx* tx = swgPacketModActions->getTx(); - QString *callsignP = tx->getCallsign(); - QString *toP = tx->getTo(); - QString *viaP = tx->getVia(); - QString *dataP = tx->getData(); - if (callsignP && toP && viaP && dataP) + if (swgPacketModActions->getTx() != 0) { - QString callsign(*callsignP); - QString to(*toP); - QString via(*viaP); - QString data(*dataP); - - PacketMod::MsgTXPacketMod *msg = PacketMod::MsgTXPacketMod::create(callsign, to, via, data); + MsgTx *msg = MsgTx::create(); m_basebandSource->getInputMessageQueue()->push(msg); + + if (getMessageQueueToGUI()) + { + MsgReportTx *msg = MsgReportTx::create(); + getMessageQueueToGUI()->push(msg); + } + return 202; } else { - errorMessage = "Packet must contain callsign, to, via and data"; + errorMessage = "Packet must contain tx action"; return 400; } } @@ -685,7 +694,8 @@ int PacketMod::webapiActionsPost( void PacketMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const PacketModSettings& settings) { response.getPacketModSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); - response.getPacketModSettings()->setMode(new QString(settings.getMode())); + response.getPacketModSettings()->setModulation((int) settings.m_modulation); + response.getPacketModSettings()->setBaud(settings.m_baud); response.getPacketModSettings()->setRfBandwidth(settings.m_rfBandwidth); response.getPacketModSettings()->setFmDeviation(settings.m_fmDeviation); response.getPacketModSettings()->setGain(settings.m_gain); @@ -842,6 +852,12 @@ void PacketMod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("inputFrequencyOffset") || force) { swgPacketModSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset); } + if (channelSettingsKeys.contains("modulation") || force) { + swgPacketModSettings->setModulation((int) settings.m_modulation); + } + if (channelSettingsKeys.contains("baud") || force) { + swgPacketModSettings->setBaud((int) settings.m_baud); + } if (channelSettingsKeys.contains("rfBandwidth") || force) { swgPacketModSettings->setRfBandwidth(settings.m_rfBandwidth); } diff --git a/plugins/channeltx/modpacket/packetmod.h b/plugins/channeltx/modpacket/packetmod.h index 625868839..964867a58 100644 --- a/plugins/channeltx/modpacket/packetmod.h +++ b/plugins/channeltx/modpacket/packetmod.h @@ -67,28 +67,31 @@ public: { } }; - class MsgTXPacketMod : public Message { + class MsgTx : public Message { MESSAGE_CLASS_DECLARATION public: - static MsgTXPacketMod* create(QString callsign, QString to, QString via, QString data) - { - return new MsgTXPacketMod(callsign, to, via, data); + static MsgTx* create() { + return new MsgTx(); } - QString m_callsign; - QString m_to; - QString m_via; - QString m_data; + private: + MsgTx() : + Message() + { } + }; + + class MsgReportTx : public Message { + MESSAGE_CLASS_DECLARATION + + public: + static MsgReportTx* create() { + return new MsgReportTx(); + } private: - - MsgTXPacketMod(QString callsign, QString to, QString via, QString data) : - Message(), - m_callsign(callsign), - m_to(to), - m_via(via), - m_data(data) + MsgReportTx() : + Message() { } }; @@ -96,8 +99,7 @@ public: MESSAGE_CLASS_DECLARATION public: - static MsgTXPacketBytes* create(QByteArray data) - { + static MsgTXPacketBytes* create(QByteArray data) { return new MsgTXPacketBytes(data); } diff --git a/plugins/channeltx/modpacket/packetmodbaseband.cpp b/plugins/channeltx/modpacket/packetmodbaseband.cpp index bc1e164da..25d8c4007 100644 --- a/plugins/channeltx/modpacket/packetmodbaseband.cpp +++ b/plugins/channeltx/modpacket/packetmodbaseband.cpp @@ -150,10 +150,10 @@ bool PacketModBaseband::handleMessage(const Message& cmd) return true; } - else if (PacketMod::MsgTXPacketMod::match(cmd)) + else if (PacketMod::MsgTx::match(cmd)) { - PacketMod::MsgTXPacketMod& tx = (PacketMod::MsgTXPacketMod&) cmd; - m_source.addTXPacket(tx.m_callsign, tx.m_to, tx.m_via, tx.m_data); + qDebug() << "PacketModBaseband::handleMessage: MsgTx"; + m_source.addTXPacket(m_settings.m_callsign, m_settings.m_to, m_settings.m_via, m_settings.m_data); return true; } diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index 892333a93..0aaed7a05 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -88,6 +88,12 @@ bool PacketModGUI::handleMessage(const Message& message) blockApplySettings(false); return true; } + else if (PacketMod::MsgReportTx::match(message)) + { + QString str = m_settings.m_callsign + ">" + m_settings.m_to + "," + m_settings.m_via + ":" + m_settings.m_data; + ui->transmittedText->appendPlainText(str); + return true; + } else { return false; @@ -489,14 +495,10 @@ PacketModGUI::~PacketModGUI() void PacketModGUI::transmit() { - QString callsign = ui->callsign->text(); - QString to = ui->to->currentText(); - QString via = ui->via->currentText(); - QString data = ui->packet->text(); // TODO: Any validation? - QString str = callsign + ">" + to + "," + via + ":" + data; - ui->transmittedText->appendPlainText(str + "\n"); - PacketMod::MsgTXPacketMod *msg = PacketMod::MsgTXPacketMod::create(callsign, to, via, data); + QString str = m_settings.m_callsign + ">" + m_settings.m_to + "," + m_settings.m_via + ":" + m_settings.m_data; + ui->transmittedText->appendPlainText(str); + PacketMod::MsgTx *msg = PacketMod::MsgTx::create(); m_packetMod->getInputMessageQueue()->push(msg); } diff --git a/plugins/channeltx/modpacket/packetmodsettings.cpp b/plugins/channeltx/modpacket/packetmodsettings.cpp index a31cd2d06..601b6a852 100644 --- a/plugins/channeltx/modpacket/packetmodsettings.cpp +++ b/plugins/channeltx/modpacket/packetmodsettings.cpp @@ -89,11 +89,14 @@ bool PacketModSettings::setMode(QString mode) { int baud; bool valid; + bool setCommon = false; // First part of mode string should give baud rate baud = mode.split(" ")[0].toInt(&valid); - if (!valid) + + if (!valid) { return false; + } if (mode.endsWith("AFSK")) { @@ -102,22 +105,56 @@ bool PacketModSettings::setMode(QString mode) m_scramble = false; m_rfBandwidth = 12500.0f; m_fmDeviation = 2500.0f; - m_spectrumRate = 8000; m_modulation = PacketModSettings::AFSK; + m_markFrequency = 2200; + m_spaceFrequency = 1200; + setCommon = true; } else if (mode.endsWith("FSK")) { // G3RUH - http://www.jrmiller.demon.co.uk/products/figs/man9k6.pdf m_baud = baud; m_scramble = true; + m_polynomial = 0x10800; m_rfBandwidth = 20000.0f; m_fmDeviation = 3000.0f; - m_spectrumRate = 24000; - m_bpf = false; m_modulation = PacketModSettings::FSK; + m_beta = 0.5f; + m_symbolSpan = 6; + setCommon = true; } else + { return false; + } + + if (baud <= 2400) { + m_spectrumRate = 8000; + } else { + m_spectrumRate = 24000; + } + + if (setCommon) + { + m_ax25PreFlags = 5; + m_ax25PostFlags = 4; + m_ax25PID = 0xf0; + m_ax25Control = 3; + m_preEmphasis = false; + m_preEmphasisTau = 531e-6f; // Narrowband FM + m_preEmphasisHighFreq = 3000.0f; + m_lpfTaps = 301; + m_rampUpBits = 8; + m_rampDownBits = 8; + m_rampRange = 60; + m_modulateWhileRamping = true; + m_bpf = false; + m_bpfLowCutoff = m_spaceFrequency - 400.0f; + m_bpfHighCutoff = m_markFrequency + 400.0f; + m_bpfTaps = 301; + m_pulseShaping = true; + } + return true; } diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index af7dbff7d..317fc7d63 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -8222,27 +8222,11 @@ margin-bottom: 20px; defs.PacketModActions = { "properties" : { "tx" : { - "$ref" : "#/definitions/PacketModActions_tx" + "type" : "integer", + "description" : "Transmit with current data\n * 0 - Do nothing\n * 1 - Transmit\n" } }, "description" : "PacketMod" -}; - defs.PacketModActions_tx = { - "properties" : { - "callsign" : { - "type" : "string" - }, - "to" : { - "type" : "string" - }, - "via" : { - "type" : "string" - }, - "data" : { - "type" : "string" - } - }, - "description" : "Transmit a packet\n" }; defs.PacketModReport = { "properties" : { @@ -8266,9 +8250,13 @@ margin-bottom: 20px; "type" : "integer", "format" : "int64" }, - "mode" : { - "type" : "string", - "description" : "Transmission mode\n * \"1200 AFSK\"\n * \"9600 FSK\".\n" + "modulation" : { + "type" : "integer", + "description" : "Modulation mode\n * 0 - AFSK\n * 1 - FSK\n" + }, + "baud" : { + "type" : "integer", + "description" : "Baud rate" }, "rfBandwidth" : { "type" : "number", @@ -8333,6 +8321,10 @@ margin-bottom: 20px; "type" : "number", "format" : "float" }, + "preEmphasisLowFreq" : { + "type" : "number", + "format" : "float" + }, "preEmphasisHighFreq" : { "type" : "number", "format" : "float" @@ -51298,7 +51290,7 @@ except ApiException as e:
- Generated 2021-11-11T23:23:22.877+01:00 + Generated 2021-11-13T22:32:53.016+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/PacketMod.yaml b/sdrbase/resources/webapi/doc/swagger/include/PacketMod.yaml index a769c904d..6db640ed4 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/PacketMod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/PacketMod.yaml @@ -4,12 +4,15 @@ PacketModSettings: inputFrequencyOffset: type: integer format: int64 - mode: - type: string + modulation: + type: integer description: > - Transmission mode - * "1200 AFSK" - * "9600 FSK". + Modulation mode + * 0 - AFSK + * 1 - FSK + baud: + type: integer + description: Baud rate rfBandwidth: type: number format: float @@ -57,6 +60,9 @@ PacketModSettings: preEmphasisTau: type: number format: float + preEmphasisLowFreq: + type: number + format: float preEmphasisHighFreq: type: number format: float @@ -163,15 +169,8 @@ PacketModActions: description: PacketMod properties: tx: - type: object - properties: - callsign: - type: string - to: - type: string - via: - type: string - data: - type: string + type: integer description: > - Transmit a packet + Transmit with current data + * 0 - Do nothing + * 1 - Transmit diff --git a/swagger/sdrangel/api/swagger/include/PacketMod.yaml b/swagger/sdrangel/api/swagger/include/PacketMod.yaml index a769c904d..17d393803 100644 --- a/swagger/sdrangel/api/swagger/include/PacketMod.yaml +++ b/swagger/sdrangel/api/swagger/include/PacketMod.yaml @@ -4,12 +4,15 @@ PacketModSettings: inputFrequencyOffset: type: integer format: int64 - mode: - type: string + modulation: + type: integer description: > - Transmission mode - * "1200 AFSK" - * "9600 FSK". + Modulation mode + * 0 - AFSK + * 1 - FSK + baud: + type: integer + description: Baud rate rfBandwidth: type: number format: float @@ -163,15 +166,8 @@ PacketModActions: description: PacketMod properties: tx: - type: object - properties: - callsign: - type: string - to: - type: string - via: - type: string - data: - type: string + type: integer description: > - Transmit a packet + Transmit with current data + * 0 - Do nothing + * 1 - Transmit diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index af7dbff7d..317fc7d63 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -8222,27 +8222,11 @@ margin-bottom: 20px; defs.PacketModActions = { "properties" : { "tx" : { - "$ref" : "#/definitions/PacketModActions_tx" + "type" : "integer", + "description" : "Transmit with current data\n * 0 - Do nothing\n * 1 - Transmit\n" } }, "description" : "PacketMod" -}; - defs.PacketModActions_tx = { - "properties" : { - "callsign" : { - "type" : "string" - }, - "to" : { - "type" : "string" - }, - "via" : { - "type" : "string" - }, - "data" : { - "type" : "string" - } - }, - "description" : "Transmit a packet\n" }; defs.PacketModReport = { "properties" : { @@ -8266,9 +8250,13 @@ margin-bottom: 20px; "type" : "integer", "format" : "int64" }, - "mode" : { - "type" : "string", - "description" : "Transmission mode\n * \"1200 AFSK\"\n * \"9600 FSK\".\n" + "modulation" : { + "type" : "integer", + "description" : "Modulation mode\n * 0 - AFSK\n * 1 - FSK\n" + }, + "baud" : { + "type" : "integer", + "description" : "Baud rate" }, "rfBandwidth" : { "type" : "number", @@ -8333,6 +8321,10 @@ margin-bottom: 20px; "type" : "number", "format" : "float" }, + "preEmphasisLowFreq" : { + "type" : "number", + "format" : "float" + }, "preEmphasisHighFreq" : { "type" : "number", "format" : "float" @@ -51298,7 +51290,7 @@ except ApiException as e:
- Generated 2021-11-11T23:23:22.877+01:00 + Generated 2021-11-13T22:32:53.016+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index e01291356..f09328177 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -189,7 +189,6 @@ #include "SWGPacketDemodReport.h" #include "SWGPacketDemodSettings.h" #include "SWGPacketModActions.h" -#include "SWGPacketModActions_tx.h" #include "SWGPacketModReport.h" #include "SWGPacketModSettings.h" #include "SWGPagerDemodReport.h" @@ -1184,11 +1183,6 @@ namespace SWGSDRangel { obj->init(); return obj; } - if(QString("SWGPacketModActions_tx").compare(type) == 0) { - SWGPacketModActions_tx *obj = new SWGPacketModActions_tx(); - obj->init(); - return obj; - } if(QString("SWGPacketModReport").compare(type) == 0) { SWGPacketModReport *obj = new SWGPacketModReport(); obj->init(); diff --git a/swagger/sdrangel/code/qt5/client/SWGPacketModActions.cpp b/swagger/sdrangel/code/qt5/client/SWGPacketModActions.cpp index aafe779af..e988621c7 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPacketModActions.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGPacketModActions.cpp @@ -28,7 +28,7 @@ SWGPacketModActions::SWGPacketModActions(QString* json) { } SWGPacketModActions::SWGPacketModActions() { - tx = nullptr; + tx = 0; m_tx_isSet = false; } @@ -38,15 +38,13 @@ SWGPacketModActions::~SWGPacketModActions() { void SWGPacketModActions::init() { - tx = new SWGPacketModActions_tx(); + tx = 0; m_tx_isSet = false; } void SWGPacketModActions::cleanup() { - if(tx != nullptr) { - delete tx; - } + } SWGPacketModActions* @@ -60,7 +58,7 @@ SWGPacketModActions::fromJson(QString &json) { void SWGPacketModActions::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&tx, pJson["tx"], "SWGPacketModActions_tx", "SWGPacketModActions_tx"); + ::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", ""); } @@ -78,19 +76,19 @@ SWGPacketModActions::asJson () QJsonObject* SWGPacketModActions::asJsonObject() { QJsonObject* obj = new QJsonObject(); - if((tx != nullptr) && (tx->isSet())){ - toJsonValue(QString("tx"), tx, obj, QString("SWGPacketModActions_tx")); + if(m_tx_isSet){ + obj->insert("tx", QJsonValue(tx)); } return obj; } -SWGPacketModActions_tx* +qint32 SWGPacketModActions::getTx() { return tx; } void -SWGPacketModActions::setTx(SWGPacketModActions_tx* tx) { +SWGPacketModActions::setTx(qint32 tx) { this->tx = tx; this->m_tx_isSet = true; } @@ -100,7 +98,7 @@ bool SWGPacketModActions::isSet(){ bool isObjectUpdated = false; do{ - if(tx && tx->isSet()){ + if(m_tx_isSet){ isObjectUpdated = true; break; } }while(false); diff --git a/swagger/sdrangel/code/qt5/client/SWGPacketModActions.h b/swagger/sdrangel/code/qt5/client/SWGPacketModActions.h index fa048fe2f..70bb6c7fc 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPacketModActions.h +++ b/swagger/sdrangel/code/qt5/client/SWGPacketModActions.h @@ -22,7 +22,6 @@ #include -#include "SWGPacketModActions_tx.h" #include "SWGObject.h" #include "export.h" @@ -42,14 +41,14 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGPacketModActions* fromJson(QString &jsonString) override; - SWGPacketModActions_tx* getTx(); - void setTx(SWGPacketModActions_tx* tx); + qint32 getTx(); + void setTx(qint32 tx); virtual bool isSet() override; private: - SWGPacketModActions_tx* tx; + qint32 tx; bool m_tx_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.cpp index 46384f24b..310c19722 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.cpp @@ -30,8 +30,10 @@ SWGPacketModSettings::SWGPacketModSettings(QString* json) { SWGPacketModSettings::SWGPacketModSettings() { input_frequency_offset = 0L; m_input_frequency_offset_isSet = false; - mode = nullptr; - m_mode_isSet = false; + modulation = 0; + m_modulation_isSet = false; + baud = 0; + m_baud_isSet = false; rf_bandwidth = 0.0f; m_rf_bandwidth_isSet = false; fm_deviation = 0.0f; @@ -70,6 +72,8 @@ SWGPacketModSettings::SWGPacketModSettings() { m_pre_emphasis_isSet = false; pre_emphasis_tau = 0.0f; m_pre_emphasis_tau_isSet = false; + pre_emphasis_low_freq = 0.0f; + m_pre_emphasis_low_freq_isSet = false; pre_emphasis_high_freq = 0.0f; m_pre_emphasis_high_freq_isSet = false; lpf_taps = 0; @@ -140,8 +144,10 @@ void SWGPacketModSettings::init() { input_frequency_offset = 0L; m_input_frequency_offset_isSet = false; - mode = new QString(""); - m_mode_isSet = false; + modulation = 0; + m_modulation_isSet = false; + baud = 0; + m_baud_isSet = false; rf_bandwidth = 0.0f; m_rf_bandwidth_isSet = false; fm_deviation = 0.0f; @@ -180,6 +186,8 @@ SWGPacketModSettings::init() { m_pre_emphasis_isSet = false; pre_emphasis_tau = 0.0f; m_pre_emphasis_tau_isSet = false; + pre_emphasis_low_freq = 0.0f; + m_pre_emphasis_low_freq_isSet = false; pre_emphasis_high_freq = 0.0f; m_pre_emphasis_high_freq_isSet = false; lpf_taps = 0; @@ -245,9 +253,9 @@ SWGPacketModSettings::init() { void SWGPacketModSettings::cleanup() { - if(mode != nullptr) { - delete mode; - } + + + @@ -326,7 +334,9 @@ void SWGPacketModSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", ""); - ::SWGSDRangel::setValue(&mode, pJson["mode"], "QString", "QString"); + ::SWGSDRangel::setValue(&modulation, pJson["modulation"], "qint32", ""); + + ::SWGSDRangel::setValue(&baud, pJson["baud"], "qint32", ""); ::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", ""); @@ -366,6 +376,8 @@ SWGPacketModSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&pre_emphasis_tau, pJson["preEmphasisTau"], "float", ""); + ::SWGSDRangel::setValue(&pre_emphasis_low_freq, pJson["preEmphasisLowFreq"], "float", ""); + ::SWGSDRangel::setValue(&pre_emphasis_high_freq, pJson["preEmphasisHighFreq"], "float", ""); ::SWGSDRangel::setValue(&lpf_taps, pJson["lpfTaps"], "qint32", ""); @@ -445,8 +457,11 @@ SWGPacketModSettings::asJsonObject() { if(m_input_frequency_offset_isSet){ obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset)); } - if(mode != nullptr && *mode != QString("")){ - toJsonValue(QString("mode"), mode, obj, QString("QString")); + if(m_modulation_isSet){ + obj->insert("modulation", QJsonValue(modulation)); + } + if(m_baud_isSet){ + obj->insert("baud", QJsonValue(baud)); } if(m_rf_bandwidth_isSet){ obj->insert("rfBandwidth", QJsonValue(rf_bandwidth)); @@ -505,6 +520,9 @@ SWGPacketModSettings::asJsonObject() { if(m_pre_emphasis_tau_isSet){ obj->insert("preEmphasisTau", QJsonValue(pre_emphasis_tau)); } + if(m_pre_emphasis_low_freq_isSet){ + obj->insert("preEmphasisLowFreq", QJsonValue(pre_emphasis_low_freq)); + } if(m_pre_emphasis_high_freq_isSet){ obj->insert("preEmphasisHighFreq", QJsonValue(pre_emphasis_high_freq)); } @@ -609,14 +627,24 @@ SWGPacketModSettings::setInputFrequencyOffset(qint64 input_frequency_offset) { this->m_input_frequency_offset_isSet = true; } -QString* -SWGPacketModSettings::getMode() { - return mode; +qint32 +SWGPacketModSettings::getModulation() { + return modulation; } void -SWGPacketModSettings::setMode(QString* mode) { - this->mode = mode; - this->m_mode_isSet = true; +SWGPacketModSettings::setModulation(qint32 modulation) { + this->modulation = modulation; + this->m_modulation_isSet = true; +} + +qint32 +SWGPacketModSettings::getBaud() { + return baud; +} +void +SWGPacketModSettings::setBaud(qint32 baud) { + this->baud = baud; + this->m_baud_isSet = true; } float @@ -809,6 +837,16 @@ SWGPacketModSettings::setPreEmphasisTau(float pre_emphasis_tau) { this->m_pre_emphasis_tau_isSet = true; } +float +SWGPacketModSettings::getPreEmphasisLowFreq() { + return pre_emphasis_low_freq; +} +void +SWGPacketModSettings::setPreEmphasisLowFreq(float pre_emphasis_low_freq) { + this->pre_emphasis_low_freq = pre_emphasis_low_freq; + this->m_pre_emphasis_low_freq_isSet = true; +} + float SWGPacketModSettings::getPreEmphasisHighFreq() { return pre_emphasis_high_freq; @@ -1117,7 +1155,10 @@ SWGPacketModSettings::isSet(){ if(m_input_frequency_offset_isSet){ isObjectUpdated = true; break; } - if(mode && *mode != QString("")){ + if(m_modulation_isSet){ + isObjectUpdated = true; break; + } + if(m_baud_isSet){ isObjectUpdated = true; break; } if(m_rf_bandwidth_isSet){ @@ -1177,6 +1218,9 @@ SWGPacketModSettings::isSet(){ if(m_pre_emphasis_tau_isSet){ isObjectUpdated = true; break; } + if(m_pre_emphasis_low_freq_isSet){ + isObjectUpdated = true; break; + } if(m_pre_emphasis_high_freq_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.h b/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.h index 254689c99..db721abb8 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGPacketModSettings.h @@ -45,8 +45,11 @@ public: qint64 getInputFrequencyOffset(); void setInputFrequencyOffset(qint64 input_frequency_offset); - QString* getMode(); - void setMode(QString* mode); + qint32 getModulation(); + void setModulation(qint32 modulation); + + qint32 getBaud(); + void setBaud(qint32 baud); float getRfBandwidth(); void setRfBandwidth(float rf_bandwidth); @@ -105,6 +108,9 @@ public: float getPreEmphasisTau(); void setPreEmphasisTau(float pre_emphasis_tau); + float getPreEmphasisLowFreq(); + void setPreEmphasisLowFreq(float pre_emphasis_low_freq); + float getPreEmphasisHighFreq(); void setPreEmphasisHighFreq(float pre_emphasis_high_freq); @@ -202,8 +208,11 @@ private: qint64 input_frequency_offset; bool m_input_frequency_offset_isSet; - QString* mode; - bool m_mode_isSet; + qint32 modulation; + bool m_modulation_isSet; + + qint32 baud; + bool m_baud_isSet; float rf_bandwidth; bool m_rf_bandwidth_isSet; @@ -262,6 +271,9 @@ private: float pre_emphasis_tau; bool m_pre_emphasis_tau_isSet; + float pre_emphasis_low_freq; + bool m_pre_emphasis_low_freq_isSet; + float pre_emphasis_high_freq; bool m_pre_emphasis_high_freq_isSet;