diff --git a/doc/img/VORLocalizer_plugin.png b/doc/img/VORLocalizer_plugin.png index 7573496fd..319c42aab 100644 Binary files a/doc/img/VORLocalizer_plugin.png and b/doc/img/VORLocalizer_plugin.png differ diff --git a/doc/img/VORLocalizer_plugin.xcf b/doc/img/VORLocalizer_plugin.xcf index 0e00f9049..930e0cdc9 100644 Binary files a/doc/img/VORLocalizer_plugin.xcf and b/doc/img/VORLocalizer_plugin.xcf differ diff --git a/doc/img/VORLocalizer_settings.png b/doc/img/VORLocalizer_settings.png index 7d8106fa1..8f57cf452 100644 Binary files a/doc/img/VORLocalizer_settings.png and b/doc/img/VORLocalizer_settings.png differ diff --git a/doc/img/VORLocalizer_settings.xcf b/doc/img/VORLocalizer_settings.xcf index fcff3ded4..b62d8525d 100644 Binary files a/doc/img/VORLocalizer_settings.xcf and b/doc/img/VORLocalizer_settings.xcf differ diff --git a/plugins/feature/vorlocalizer/readme.md b/plugins/feature/vorlocalizer/readme.md index 8aa20e626..057424524 100644 --- a/plugins/feature/vorlocalizer/readme.md +++ b/plugins/feature/vorlocalizer/readme.md @@ -31,13 +31,21 @@ When checked, radials on the map will drawn adjusted for magnetic declination. F

4: Round robin turn time

-Available VOR demodulator channels are allocated to service the selected VORs on the map and displayed in the VOR table (B). There could be less available channels than the number of VORs to service in which case the channel(s) of the same device can be used to service VORs in turn in a round robin fashion. This sets the time in seconds dedicated to each turn. More details on channels allocation agorithm is given in (6). +Available VOR demodulator channels are allocated to service the selected VORs on the map and displayed in the VOR table (B). There could be less available channels than the number of VORs to service in which case the channel(s) of the same device can be used to service VORs in turn in a round robin fashion. This sets the time in seconds dedicated to each turn. More details on channels allocation agorithm is given in (7). -

5: Center frequency shift

+

5: Round robin turn time progress

+ +Shows the round robin turn time progress + +

6: Force averaging over round robin turn time

+ +Averaging of radial direction and signal magnitudes normally take place only if there is more than one round robin turn for a device. This forces averaging even if only one round robin turn exists i.e. the channels for this device are active continuously. Such an averaging may help in getting a better position fix. + +

7: Center frequency shift

The center frequency of the device may be shifted from its value computed from VOR allocation. This can help moving the channel center away from the device DC if necessary. -

6: List of VOR demodulator channels in the system

+

8: List of VOR demodulator channels in the system

This combo is not used to select anything but just to show the VOR demodulators that have been detected and that will be used to service the list of selected VORs int the (B) table. @@ -47,7 +55,7 @@ Channels may be used in round robin turns if their number is not enough to cover When there is more than one turn for a device valid radial directions are averaged and the resulting average is used during the round robin loop. Averaging also takes place for reference and variable signal levels. -

7: Refresh VOR demodulators list and allocation

+

9: Refresh VOR demodulators list and allocation

Use this button to (re)scan the available VOR demodulators in the SDRangel instance and (re)run the round robin allocation. diff --git a/plugins/feature/vorlocalizer/vorlocalizer.cpp b/plugins/feature/vorlocalizer/vorlocalizer.cpp index a28c43ed0..5d0f37f5c 100644 --- a/plugins/feature/vorlocalizer/vorlocalizer.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizer.cpp @@ -134,7 +134,9 @@ bool VORLocalizer::handleMessage(const Message& cmd) return true; } - bool singlePlan = (m_vorSinglePlans.contains(navId)) ? m_vorSinglePlans[navId] : false; + bool singlePlan = (m_vorSinglePlans.contains(navId)) && !m_settings.m_forceRRAveraging ? + m_vorSinglePlans[navId] : + false; // qDebug() << "VORLocalizer::handleMessage: MainCore::MsgChannelReport(VORDemodSC): " // << "navId:" << navId @@ -289,6 +291,9 @@ void VORLocalizer::applySettings(const VORLocalizerSettings& settings, bool forc if ((m_settings.m_rrTime != settings.m_rrTime) || force) { reverseAPIKeys.append("rrTime"); } + if ((m_settings.m_forceRRAveraging != settings.m_forceRRAveraging) || force) { + reverseAPIKeys.append("forceRRAveraging"); + } if ((m_settings.m_centerShift != settings.m_centerShift) || force) { reverseAPIKeys.append("centerShift"); } @@ -440,6 +445,7 @@ void VORLocalizer::webapiFormatFeatureSettings( response.getVorLocalizerSettings()->setRgbColor(settings.m_rgbColor); response.getVorLocalizerSettings()->setMagDecAdjust(settings.m_magDecAdjust); response.getVorLocalizerSettings()->setRrTime(settings.m_rrTime); + response.getVorLocalizerSettings()->setForceRrAveraging(settings.m_forceRRAveraging ? 1 : 0); response.getVorLocalizerSettings()->setCenterShift(settings.m_centerShift); response.getVorLocalizerSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); @@ -472,6 +478,9 @@ void VORLocalizer::webapiUpdateFeatureSettings( if (featureSettingsKeys.contains("rrTime")) { settings.m_rrTime = response.getVorLocalizerSettings()->getRrTime(); } + if (featureSettingsKeys.contains("forceRRAveraging")) { + settings.m_forceRRAveraging = response.getVorLocalizerSettings()->getForceRrAveraging() != 0; + } if (featureSettingsKeys.contains("centerShift")) { settings.m_centerShift = response.getVorLocalizerSettings()->getCenterShift(); } @@ -515,6 +524,9 @@ void VORLocalizer::webapiReverseSendSettings(QList& channelSettingsKeys if (channelSettingsKeys.contains("rrTime") || force) { swgVORLocalizerSettings->setRrTime(settings.m_rrTime); } + if (channelSettingsKeys.contains("forceRRAveraging") || force) { + swgVORLocalizerSettings->setForceRrAveraging(settings.m_forceRRAveraging ? 1 : 0); + } if (channelSettingsKeys.contains("centerShift") || force) { swgVORLocalizerSettings->setCenterShift(settings.m_centerShift); } diff --git a/plugins/feature/vorlocalizer/vorlocalizergui.cpp b/plugins/feature/vorlocalizer/vorlocalizergui.cpp index c572df644..c25048bbc 100644 --- a/plugins/feature/vorlocalizer/vorlocalizergui.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizergui.cpp @@ -916,6 +916,11 @@ bool VORLocalizerGUI::handleMessage(const Message& message) vorGUI->m_frequencyItem->setForeground(QBrush(Qt::green)); } } + + ui->rrTurnTimeProgress->setMaximum(m_settings.m_rrTime); + ui->rrTurnTimeProgress->setValue(0); + ui->rrTurnTimeProgress->setToolTip(tr("Round robin turn %1s").arg(0)); + m_rrSecondsCount = 0; } return false; @@ -1215,7 +1220,8 @@ VORLocalizerGUI::VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe m_progressDialog(nullptr), m_vorModel(this), m_vors(nullptr), - m_lastFeatureState(0) + m_lastFeatureState(0), + m_rrSecondsCount(0) { ui->setupUi(this); @@ -1312,6 +1318,10 @@ VORLocalizerGUI::VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(1000); + ui->rrTurnTimeProgress->setMaximum(m_settings.m_rrTime); + ui->rrTurnTimeProgress->setValue(0); + ui->rrTurnTimeProgress->setToolTip(tr("Round robin turn time %1s").arg(0)); + displaySettings(); applySettings(true); } @@ -1362,6 +1372,7 @@ void VORLocalizerGUI::displaySettings() ui->rrTime->setValue(m_settings.m_rrTime); ui->centerShiftText->setText(tr("%1k").arg(m_settings.m_centerShift/1000)); ui->centerShift->setValue(m_settings.m_centerShift/1000); + ui->forceRRAveraging->setChecked(m_settings.m_forceRRAveraging); blockApplySettings(false); } @@ -1405,8 +1416,8 @@ void VORLocalizerGUI::updateStatus() void VORLocalizerGUI::tick() { - // Try to determine position, based on intersection of two radials - if (m_tickCount % 50) + // Try to determine position, based on intersection of two radials - every second + if (++m_tickCount == 20) { float lat, lon; @@ -1425,7 +1436,11 @@ void VORLocalizerGUI::tick() stationObject->setProperty("stationName", QVariant::fromValue(MainCore::instance()->getSettings().getStationName())); } } - } - m_tickCount++; + m_rrSecondsCount++; + ui->rrTurnTimeProgress->setMaximum(m_settings.m_rrTime); + ui->rrTurnTimeProgress->setValue(m_rrSecondsCount <= m_settings.m_rrTime ? m_rrSecondsCount : m_settings.m_rrTime); + ui->rrTurnTimeProgress->setToolTip(tr("Round robin turn time %1s").arg(m_rrSecondsCount)); + m_tickCount = 0; + } } diff --git a/plugins/feature/vorlocalizer/vorlocalizergui.h b/plugins/feature/vorlocalizer/vorlocalizergui.h index eeea8e5b4..24555f527 100644 --- a/plugins/feature/vorlocalizer/vorlocalizergui.h +++ b/plugins/feature/vorlocalizer/vorlocalizergui.h @@ -237,6 +237,7 @@ private: QIcon m_muteIcon; QTimer m_statusTimer; int m_lastFeatureState; + int m_rrSecondsCount; explicit VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr); virtual ~VORLocalizerGUI(); diff --git a/plugins/feature/vorlocalizer/vorlocalizergui.ui b/plugins/feature/vorlocalizer/vorlocalizergui.ui index e22dd69a8..a1e90d9ad 100644 --- a/plugins/feature/vorlocalizer/vorlocalizergui.ui +++ b/plugins/feature/vorlocalizer/vorlocalizergui.ui @@ -6,7 +6,7 @@ 0 0 - 398 + 462 893 @@ -18,7 +18,7 @@ - 352 + 462 0 @@ -42,7 +42,7 @@ 0 0 - 390 + 461 61 @@ -178,16 +178,10 @@ - 30 + 26 0 - - - 30 - 16777215 - - Sound volume (%) @@ -200,9 +194,34 @@ - - - Qt::Vertical + + + + 100 + 16 + + + + + 8 + + + + QProgressBar{border: 2px solid rgb(79, 79, 79); text-align: center;} +QToolTip{background-color: white; color: black;} + + + 24 + + + + + + + Force radials and signals magnitudes averaging over round robin turn + + + A @@ -245,7 +264,7 @@ - 30 + 26 0 @@ -330,7 +349,7 @@ 0 110 - 391 + 461 140 @@ -461,7 +480,7 @@ 0 260 - 391 + 461 581 diff --git a/plugins/feature/vorlocalizer/vorlocalizersettings.h b/plugins/feature/vorlocalizer/vorlocalizersettings.h index 0557374c9..7cf97a090 100644 --- a/plugins/feature/vorlocalizer/vorlocalizersettings.h +++ b/plugins/feature/vorlocalizer/vorlocalizersettings.h @@ -66,6 +66,7 @@ struct VORLocalizerSettings QString m_title; bool m_magDecAdjust; //!< Adjust for magnetic declination when drawing radials on the map int m_rrTime; //!< Round robin turn time in seconds + bool m_forceRRAveraging; //!< Force radial and signal magnitude averaging over RR turn int m_centerShift; //!< Center frequency shift to apply to move away from DC bool m_useReverseAPI; QString m_reverseAPIAddress; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 9a69e8788..6fd4a4850 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -9666,6 +9666,10 @@ margin-bottom: 20px; "type" : "integer", "description" : "Round robin turn time in seconds" }, + "forceRRAveraging" : { + "type" : "integer", + "description" : "Force radial and signal magnitudes averaging over the round robin turn\n * 0 - Do not force averaging\n * 1 - Force averaging\n" + }, "centerShift" : { "type" : "integer", "description" : "Shift of center frequency in Hz" @@ -44874,7 +44878,7 @@ except ApiException as e:
- Generated 2020-12-06T23:43:21.772+01:00 + Generated 2020-12-08T00:22:13.522+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/VORLocalizer.yaml b/sdrbase/resources/webapi/doc/swagger/include/VORLocalizer.yaml index fe1c2b669..e8cd2bc93 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/VORLocalizer.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/VORLocalizer.yaml @@ -22,6 +22,12 @@ VORLocalizerSettings: rrTime: description: Round robin turn time in seconds type: integer + forceRRAveraging: + type: integer + description: > + Force radial and signal magnitudes averaging over the round robin turn + * 0 - Do not force averaging + * 1 - Force averaging centerShift: description: Shift of center frequency in Hz type: integer diff --git a/swagger/sdrangel/api/swagger/include/VORLocalizer.yaml b/swagger/sdrangel/api/swagger/include/VORLocalizer.yaml index fe1c2b669..e8cd2bc93 100644 --- a/swagger/sdrangel/api/swagger/include/VORLocalizer.yaml +++ b/swagger/sdrangel/api/swagger/include/VORLocalizer.yaml @@ -22,6 +22,12 @@ VORLocalizerSettings: rrTime: description: Round robin turn time in seconds type: integer + forceRRAveraging: + type: integer + description: > + Force radial and signal magnitudes averaging over the round robin turn + * 0 - Do not force averaging + * 1 - Force averaging centerShift: description: Shift of center frequency in Hz type: integer diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 9a69e8788..6fd4a4850 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -9666,6 +9666,10 @@ margin-bottom: 20px; "type" : "integer", "description" : "Round robin turn time in seconds" }, + "forceRRAveraging" : { + "type" : "integer", + "description" : "Force radial and signal magnitudes averaging over the round robin turn\n * 0 - Do not force averaging\n * 1 - Force averaging\n" + }, "centerShift" : { "type" : "integer", "description" : "Shift of center frequency in Hz" @@ -44874,7 +44878,7 @@ except ApiException as e:
- Generated 2020-12-06T23:43:21.772+01:00 + Generated 2020-12-08T00:22:13.522+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.cpp index 4ea3cb05e..f1aaf08c8 100644 --- a/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.cpp @@ -46,6 +46,8 @@ SWGVORLocalizerSettings::SWGVORLocalizerSettings() { m_mag_dec_adjust_isSet = false; rr_time = 0; m_rr_time_isSet = false; + force_rr_averaging = 0; + m_force_rr_averaging_isSet = false; center_shift = 0; m_center_shift_isSet = false; } @@ -74,6 +76,8 @@ SWGVORLocalizerSettings::init() { m_mag_dec_adjust_isSet = false; rr_time = 0; m_rr_time_isSet = false; + force_rr_averaging = 0; + m_force_rr_averaging_isSet = false; center_shift = 0; m_center_shift_isSet = false; } @@ -94,6 +98,7 @@ SWGVORLocalizerSettings::cleanup() { + } SWGVORLocalizerSettings* @@ -125,6 +130,8 @@ SWGVORLocalizerSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&rr_time, pJson["rrTime"], "qint32", ""); + ::SWGSDRangel::setValue(&force_rr_averaging, pJson["forceRRAveraging"], "qint32", ""); + ::SWGSDRangel::setValue(¢er_shift, pJson["centerShift"], "qint32", ""); } @@ -170,6 +177,9 @@ SWGVORLocalizerSettings::asJsonObject() { if(m_rr_time_isSet){ obj->insert("rrTime", QJsonValue(rr_time)); } + if(m_force_rr_averaging_isSet){ + obj->insert("forceRRAveraging", QJsonValue(force_rr_averaging)); + } if(m_center_shift_isSet){ obj->insert("centerShift", QJsonValue(center_shift)); } @@ -267,6 +277,16 @@ SWGVORLocalizerSettings::setRrTime(qint32 rr_time) { this->m_rr_time_isSet = true; } +qint32 +SWGVORLocalizerSettings::getForceRrAveraging() { + return force_rr_averaging; +} +void +SWGVORLocalizerSettings::setForceRrAveraging(qint32 force_rr_averaging) { + this->force_rr_averaging = force_rr_averaging; + this->m_force_rr_averaging_isSet = true; +} + qint32 SWGVORLocalizerSettings::getCenterShift() { return center_shift; @@ -309,6 +329,9 @@ SWGVORLocalizerSettings::isSet(){ if(m_rr_time_isSet){ isObjectUpdated = true; break; } + if(m_force_rr_averaging_isSet){ + isObjectUpdated = true; break; + } if(m_center_shift_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.h b/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.h index 2e3617a17..194139528 100644 --- a/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGVORLocalizerSettings.h @@ -69,6 +69,9 @@ public: qint32 getRrTime(); void setRrTime(qint32 rr_time); + qint32 getForceRrAveraging(); + void setForceRrAveraging(qint32 force_rr_averaging); + qint32 getCenterShift(); void setCenterShift(qint32 center_shift); @@ -103,6 +106,9 @@ private: qint32 rr_time; bool m_rr_time_isSet; + qint32 force_rr_averaging; + bool m_force_rr_averaging_isSet; + qint32 center_shift; bool m_center_shift_isSet;